Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/psm.h File Reference

Package state machine to handle a package from a transaction set. More...

Go to the source code of this file.

Data Structures

struct  rpmpsm_s

Defines

#define PSM_VERBOSE   0x8000
#define PSM_INTERNAL   0x4000
#define PSM_SYSCALL   0x2000
#define PSM_DEAD   0x1000
#define _fv(_a)   ((_a) | PSM_VERBOSE)
#define _fi(_a)   ((_a) | PSM_INTERNAL)
#define _fs(_a)   ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
#define _fd(_a)   ((_a) | (PSM_INTERNAL | PSM_DEAD))
#define rpmpsmUnlink(_psm, _msg)   XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
#define rpmpsmLink(_psm, _msg)   XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)

Typedefs

typedef enum pkgStage_e pkgStage

Enumerations

enum  pkgStage_e {
  PSM_UNKNOWN = 0, PSM_INIT = 1, PSM_PRE = 2, PSM_PROCESS = 3,
  PSM_POST = 4, PSM_UNDO = 5, PSM_FINI = 6, PSM_PKGINSTALL = 7,
  PSM_PKGERASE = 8, PSM_PKGCOMMIT = 10, PSM_PKGSAVE = 12, PSM_CREATE = 17,
  PSM_NOTIFY = 22, PSM_DESTROY = 23, PSM_COMMIT = 25, PSM_CHROOT_IN = 51,
  PSM_CHROOT_OUT = 52, PSM_SCRIPT = 53, PSM_TRIGGERS = 54, PSM_IMMED_TRIGGERS = 55,
  PSM_RPMIO_FLAGS = 56, PSM_RPMDB_LOAD = 97, PSM_RPMDB_ADD = 98, PSM_RPMDB_REMOVE = 99
}

Functions

rpmpsm rpmpsmUnlink (rpmpsm psm, const char *msg)
 Unreference a package state machine instance.

rpmpsm XrpmpsmUnlink (rpmpsm psm, const char *msg, const char *fn, unsigned ln)
rpmpsm rpmpsmLink (rpmpsm psm, const char *msg)
 Reference a package state machine instance.

rpmpsm XrpmpsmLink (rpmpsm psm, const char *msg, const char *fn, unsigned ln)
rpmpsm rpmpsmFree (rpmpsm psm)
 Destroy a package state machine.

rpmpsm rpmpsmNew (rpmts ts, rpmte te, rpmfi fi)
 Create and load a package state machine.

rpmRC rpmpsmStage (rpmpsm psm, pkgStage stage)
 Package state machine driver.


Variables

int _psm_debug


Detailed Description

Package state machine to handle a package from a transaction set.

Definition in file psm.h.


Define Documentation

#define _fd _a       ((_a) | (PSM_INTERNAL | PSM_DEAD))
 

Definition at line 23 of file psm.h.

#define _fi _a       ((_a) | PSM_INTERNAL)
 

Definition at line 21 of file psm.h.

#define _fs _a       ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
 

Definition at line 22 of file psm.h.

#define _fv _a       ((_a) | PSM_VERBOSE)
 

Definition at line 20 of file psm.h.

#define PSM_DEAD   0x1000
 

Definition at line 19 of file psm.h.

#define PSM_INTERNAL   0x4000
 

Definition at line 17 of file psm.h.

#define PSM_SYSCALL   0x2000
 

Definition at line 18 of file psm.h.

#define PSM_VERBOSE   0x8000
 

Definition at line 16 of file psm.h.

#define rpmpsmLink _psm,
_msg       XrpmpsmLink(_psm, _msg, __FILE__, __LINE__)
 

Definition at line 149 of file psm.h.

Referenced by psmRegisterFork(), and rpmpsmNew().

#define rpmpsmUnlink _psm,
_msg       XrpmpsmUnlink(_psm, _msg, __FILE__, __LINE__)
 

Definition at line 130 of file psm.h.

Referenced by rpmpsmFree().


Typedef Documentation

typedef enum pkgStage_e pkgStage
 

Referenced by pkgStageString(), and rpmpsmStage().


Enumeration Type Documentation

enum pkgStage_e
 

Enumeration values:
PSM_UNKNOWN 
PSM_INIT 
PSM_PRE 
PSM_PROCESS 
PSM_POST 
PSM_UNDO 
PSM_FINI 
PSM_PKGINSTALL 
PSM_PKGERASE 
PSM_PKGCOMMIT 
PSM_PKGSAVE 
PSM_CREATE 
PSM_NOTIFY 
PSM_DESTROY 
PSM_COMMIT 
PSM_CHROOT_IN 
PSM_CHROOT_OUT 
PSM_SCRIPT 
PSM_TRIGGERS 
PSM_IMMED_TRIGGERS 
PSM_RPMIO_FLAGS 
PSM_RPMDB_LOAD 
PSM_RPMDB_ADD 
PSM_RPMDB_REMOVE 

Definition at line 24 of file psm.h.


Function Documentation

rpmpsm rpmpsmFree rpmpsm    psm
 

Destroy a package state machine.

Parameters:
psm  package state machine
Returns:
NULL always

Definition at line 1351 of file psm.c.

References _free(), rpmpsm_s::fi, rpmpsm_s::nrefs, rpmfiFree(), rpmpsmUnlink, rpmteFree(), rpmtsFree(), rpmpsm_s::te, and rpmpsm_s::ts.

Referenced by psmWaitUnregister(), rpmtsRun(), and rpmVerifyScript().

rpmpsm rpmpsmLink rpmpsm    psm,
const char *    msg
 

Reference a package state machine instance.

Parameters:
psm  package state machine
msg 
Returns:
new package state machine reference

rpmpsm rpmpsmNew rpmts    ts,
rpmte    te,
rpmfi    fi
 

Create and load a package state machine.

Parameters:
ts  transaction set
te  transaction set element
fi  file info set
Returns:
new package state machine

Definition at line 1382 of file psm.c.

References rpmpsm_s::fi, rpmfi, rpmfiLink, rpmpsmLink, rpmte, rpmts, rpmtsLink, rpmpsm_s::te, rpmpsm_s::ts, and xcalloc().

Referenced by rpmtsRun(), and rpmVerifyScript().

rpmRC rpmpsmStage rpmpsm    psm,
pkgStage    stage
 

Package state machine driver.

Todo:
Packages w/o files never get a callback, hence don't get displayed on install with -v.

Definition at line 1405 of file psm.c.

References _, _free(), rpmpsm_s::amount, rpmlead::archnum, rpmpsm_s::cfd, rpmpsm_s::chrootDone, rpmpsm_s::countCorrection, CPIO_MAP_GID, CPIO_MAP_MODE, CPIO_MAP_PATH, CPIO_MAP_UID, dbiOpen(), errno, FA_COPYOUT, rpmpsm_s::failedFile, Fclose(), rpmpsm_s::fd, fdDup(), Fdopen(), Ferror(), Fflush(), rpmpsm_s::fi, fileAction, Fileno(), Fopen(), FSM_PKGBUILD, FSM_PKGCOMMIT, FSM_PKGERASE, FSM_PKGINSTALL, fsmSetup(), fsmTeardown(), Fstrerror(), gnameToGid(), rpmpsm_s::goal, HEADER_MAGIC_YES, headerAddEntry(), headerCopyLoad(), headerFree(), headerFreeData(), headerFreeIterator(), headerGetEntry(), headerInitIterator(), headerIsEntry(), headerLink(), headerNew(), headerNextIterator(), headerRegenSigHeader(), headerReload(), headerSprintf(), headerWrite(), HFD_t, HGE_t, hPTR_t, int_32, rpmlead::major, markReplacedFiles(), rpmpsm_s::mi, rpmlead::minor, rpmlead::name, rpmpsm_s::npkgs_installed, rpmpsm_s::oh, rpmlead::osnum, rpmpsm_s::pkgfn, pkgStage, pkgStageString(), rpmpsm_s::pkgURL, rpmpsm_s::progTag, PSM_CHROOT_IN, PSM_CHROOT_OUT, PSM_COMMIT, PSM_CREATE, PSM_DESTROY, PSM_FINI, PSM_IMMED_TRIGGERS, PSM_INIT, PSM_NOTIFY, PSM_PKGCOMMIT, PSM_PKGERASE, PSM_PKGINSTALL, PSM_PKGSAVE, PSM_POST, PSM_PRE, PSM_PROCESS, PSM_RPMDB_ADD, PSM_RPMDB_LOAD, PSM_RPMDB_REMOVE, PSM_RPMIO_FLAGS, PSM_SCRIPT, PSM_TRIGGERS, PSM_UNDO, PSM_UNKNOWN, rpmpsm_s::rc, RPM_CHAR_TYPE, RPM_INT32_TYPE, RPMCALLBACK_CPIO_ERROR, RPMCALLBACK_INST_PROGRESS, RPMCALLBACK_INST_START, RPMCALLBACK_UNINST_START, RPMCALLBACK_UNINST_STOP, RPMCALLBACK_UNPACK_ERROR, rpmdbAdd(), rpmdbCountPackages(), rpmdbFreeIterator(), rpmdbGetIteratorOffset(), RPMDBI_PACKAGES, rpmdbNextIterator(), rpmdbRemove(), rpmdbSetIteratorRE(), RPMERR_CPIO, RPMERR_NOSPACE, RPMERR_SCRIPT, rpmError, rpmfi, rpmfiBuildFNames(), rpmfiFC(), rpmfiInit(), RPMFILE_STATE_NORMAL, rpmfiNext(), rpmFreeSignature(), rpmGenPath(), rpmGetArchInfo(), rpmGetOsInfo(), rpmGetPath(), rpmpsm_s::rpmio_flags, RPMLEAD_BINARY, RPMMESS_DEBUG, RPMMESS_VERBOSE, RPMMESS_WARNING, rpmMessage, RPMMIRE_DEFAULT, rpmRC, RPMRC_FAIL, RPMRC_OK, RPMSENSE_TRIGGERIN, RPMSENSE_TRIGGERPOSTUN, RPMSENSE_TRIGGERUN, RPMSIGTYPE_HEADERSIG, RPMTAG_ARCH, RPMTAG_ARCHIVESIZE, RPMTAG_BASENAMES, RPMTAG_DEFAULTPREFIX, RPMTAG_EPOCH, RPMTAG_FILEGROUPNAME, RPMTAG_FILESTATES, RPMTAG_FILEUSERNAME, RPMTAG_HEADERIMAGE, RPMTAG_HEADERIMMUTABLE, RPMTAG_HEADERSIGNATURES, RPMTAG_INSTALLCOLOR, RPMTAG_INSTALLTIME, RPMTAG_NAME, RPMTAG_ORIGBASENAMES, RPMTAG_OS, RPMTAG_PAYLOADCOMPRESSOR, RPMTAG_POSTIN, RPMTAG_POSTINPROG, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, RPMTAG_PREIN, RPMTAG_PREINPROG, RPMTAG_PREUN, RPMTAG_PREUNPROG, RPMTAG_RELEASE, RPMTAG_REMOVETID, RPMTAG_TRIGGERNAME, RPMTAG_VERSION, rpmteFd(), rpmteN(), RPMTRANS_FLAG_APPLYONLY, RPMTRANS_FLAG_JUSTDB, RPMTRANS_FLAG_NOPOST, RPMTRANS_FLAG_NOPOSTUN, RPMTRANS_FLAG_NOPRE, RPMTRANS_FLAG_NOPREUN, RPMTRANS_FLAG_NOTRIGGERIN, RPMTRANS_FLAG_NOTRIGGERPOSTUN, RPMTRANS_FLAG_NOTRIGGERPREIN, RPMTRANS_FLAG_NOTRIGGERUN, RPMTRANS_FLAG_PKGCOMMIT, RPMTRANS_FLAG_TEST, rpmts, RPMTS_OP_DBADD, RPMTS_OP_DBREMOVE, rpmtsChrootDone(), rpmtsColor(), rpmtsCurrDir(), rpmtsFlags(), rpmtsGetRdb(), rpmtsGetTid(), rpmtsInitIterator(), rpmtsNotify(), rpmtsOp(), rpmtsRootDir(), rpmtsSetChrootDone(), rpmtsVSFlags(), RPMVSF_NOHDRCHK, rpmWriteSignature(), runImmedTriggers(), runInstScript(), runTriggers(), rpmpsm_s::scriptArg, rpmpsm_s::scriptTag, rpmpsm_s::sense, rpmlead::signature_type, rpmpsm_s::stepName, stpcpy(), tag2sln(), rpmpsm_s::te, rpmpsm_s::total, rpmpsm_s::ts, rpmlead::type, uint_32, unameToUid(), urlPath(), rpmpsm_s::what, writeLead(), xcalloc(), and xmalloc().

Referenced by rpmInstallSourcePackage(), rpmtsRun(), and rpmVerifyScript().

rpmpsm rpmpsmUnlink rpmpsm    psm,
const char *    msg
 

Unreference a package state machine instance.

Parameters:
psm  package state machine
msg 
Returns:
NULL always

rpmpsm XrpmpsmLink rpmpsm    psm,
const char *    msg,
const char *    fn,
unsigned    ln
 

Todo:
Remove debugging entry from the ABI.

Definition at line 1338 of file psm.c.

References _psm_debug, and rpmpsm_s::nrefs.

rpmpsm XrpmpsmUnlink rpmpsm    psm,
const char *    msg,
const char *    fn,
unsigned    ln
 

Todo:
Remove debugging entry from the ABI.

Definition at line 1327 of file psm.c.

References _psm_debug, and rpmpsm_s::nrefs.


Variable Documentation

int _psm_debug
 

Definition at line 11 of file psm.h.

Referenced by XrpmpsmLink(), and XrpmpsmUnlink().


Generated on Sun Oct 26 13:02:05 2003 for rpm by doxygen1.2.18