rpm  5.4.14
Macros | Typedefs | Enumerations | Functions | Variables
psm.h File Reference

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

#include <rpmsq.h>
#include <rpmfi.h>
Include dependency graph for psm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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)   ((rpmpsm)rpmioUnlinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
 
#define rpmpsmLink(_psm, _msg)   ((rpmpsm)rpmioLinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
 
#define rpmpsmFree(_psm, _msg)   ((rpmpsm)rpmioFreePoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
 
#define rpmpsmUNSAFE   rpmpsmSTAGE
 

Typedefs

typedef struct rpmpsm_s * rpmpsm
 Package state machine data. More...
 
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. More...
 
rpmpsm rpmpsmLink (rpmpsm psm, const char *msg)
 Reference a package state machine instance. More...
 
rpmpsm rpmpsmFree (rpmpsm psm, const char *msg)
 Destroy a package state machine. More...
 
rpmpsm rpmpsmNew (rpmts ts, rpmte te, rpmfi fi)
 Create and load a package state machine. More...
 
rpmRC rpmpsmStage (rpmpsm psm, pkgStage stage)
 Package state machine driver. More...
 
rpmRC rpmpsmScriptStage (rpmpsm psm, rpmTag scriptTag, rpmTag progTag)
 Run rpmpsmStage(PSM_SCRIPT) for scriptTag and progTag. More...
 
void rpmpsmSetAsync (rpmpsm psm, int async)
 

Variables

int _psm_debug
 

Detailed Description

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

Definition in file psm.h.

Macro Definition Documentation

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

Definition at line 32 of file psm.h.

#define _fi (   _a)    ((_a) | PSM_INTERNAL)

Definition at line 30 of file psm.h.

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

Definition at line 31 of file psm.h.

#define _fv (   _a)    ((_a) | PSM_VERBOSE)

Definition at line 29 of file psm.h.

#define PSM_DEAD   0x1000

Definition at line 28 of file psm.h.

#define PSM_INTERNAL   0x4000

Definition at line 26 of file psm.h.

#define PSM_SYSCALL   0x2000

Definition at line 27 of file psm.h.

#define PSM_VERBOSE   0x8000

Definition at line 25 of file psm.h.

#define rpmpsmFree (   _psm,
  _msg 
)    ((rpmpsm)rpmioFreePoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))

Definition at line 187 of file psm.h.

#define rpmpsmLink (   _psm,
  _msg 
)    ((rpmpsm)rpmioLinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))

Definition at line 174 of file psm.h.

#define rpmpsmUnlink (   _psm,
  _msg 
)    ((rpmpsm)rpmioUnlinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))

Definition at line 162 of file psm.h.

#define rpmpsmUNSAFE   rpmpsmSTAGE

Definition at line 210 of file psm.h.

Typedef Documentation

typedef enum pkgStage_e pkgStage

Enumeration Type Documentation

enum pkgStage_e
Enumerator
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 33 of file psm.h.

Function Documentation

rpmpsm rpmpsmFree ( rpmpsm  psm,
const char *  msg 
)

Destroy a package state machine.

Parameters
psmpackage state machine
Returns
NULL on last dereference

Referenced by _processFailedPackage(), rpmInstallSourcePackage(), rpmtsProcess(), rpmtsRepackage(), rpmtsRunScript(), and rpmVerifyScript().

rpmpsm rpmpsmLink ( rpmpsm  psm,
const char *  msg 
)

Reference a package state machine instance.

Parameters
psmpackage state machine
msg
Returns
new package state machine reference

Referenced by rpmpsmNew().

rpmpsm rpmpsmNew ( rpmts  ts,
rpmte  te,
rpmfi  fi 
)

Create and load a package state machine.

Parameters
tstransaction set
tetransaction set element
fifile info set
Returns
new package state machine

Definition at line 1825 of file psm.c.

References memset(), msg, NULL, rpmfiLink(), rpmpsmGetPool(), rpmpsmLink(), rpmtsLink(), te, and xcalloc().

Referenced by _processFailedPackage(), rpmInstallSourcePackage(), rpmtsProcess(), rpmtsRepackage(), rpmtsRunScript(), and rpmVerifyScript().

rpmRC rpmpsmScriptStage ( rpmpsm  psm,
rpmTag  scriptTag,
rpmTag  progTag 
)

Run rpmpsmStage(PSM_SCRIPT) for scriptTag and progTag.

Parameters
psmpackage state machine data
scriptTagscriptlet tag to execute
progTagscriptlet prog tag to execute
Returns
0 on success

Definition at line 1763 of file psm.c.

References assert(), NULL, PSM_SCRIPT, rpmpsmStage(), RPMTAG_POSTTRANS, RPMTAG_PRETRANS, RPMTAG_SANITYCHECK, and RPMTAG_VERIFYSCRIPT.

Referenced by rpmtsRunScript(), and rpmVerifyScript().

void rpmpsmSetAsync ( rpmpsm  psm,
int  async 
)

Definition at line 1750 of file psm.c.

References assert(), F_CLR, F_SET, and NULL.

Referenced by rpmtsProcess().

rpmRC rpmpsmStage ( rpmpsm  psm,
pkgStage  stage 
)

Package state machine driver.

Parameters
psmpackage state machine data
stagenext stage
Returns
0 on success
Todo:
Packages w/o files never get a callback, hence don't get displayed on install with -v.

Definition at line 2197 of file psm.c.

References _, _free(), alloca(), rpmDataType_u::argv, assert(), _HE_s::c, Chdir(), Chroot(), D_, dbi, dbiOpen(), digest, errno, F_CLR, F_ISSET, F_SET, FA_COPYOUT, Fclose(), fdDup(), Fdopen(), FDSTAT_DIGEST, fdstat_op(), FDSTAT_READ, FDSTAT_WRITE, Ferror(), Fflush(), fi, Fileno(), Fopen(), fsmSetup(), fsmTeardown(), Fstrerror(), hCopyTag(), headerCopyLoad(), headerFini(), headerFree, headerGet(), headerGetInstance(), headerInit(), headerIsEntry(), headerLink(), headerNew(), headerNext(), headerPut(), headerRegenSigHeader(), headerReload(), headerSetInstance(), headerSprintf(), hLoadTID(), hSaveFlinks(), int, IOSM_MAP_GID, IOSM_MAP_MODE, IOSM_MAP_PATH, IOSM_MAP_UID, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_SBIT_CHECK, iosmStrerror(), memset(), msg, nb, NULL, _HE_s::p, pkgStageString(), populateInstallHeader(), postPopulateInstallHeader(), 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, rpmDataType_u::ptr, ptr, rc, RPM_BIN_TYPE, RPM_STRING_TYPE, RPM_UINT32_TYPE, RPMCALLBACK_CPIO_ERROR, RPMCALLBACK_INST_PROGRESS, RPMCALLBACK_INST_START, RPMCALLBACK_UNINST_START, RPMCALLBACK_UNINST_STOP, RPMCALLBACK_UNPACK_ERROR, rpmdbAdd(), rpmdbCountPackages(), RPMDBI_PACKAGES, rpmdbRemove(), rpmdsNew(), rpmExpand(), rpmfiFC(), RPMFILE_STATE_NORMAL, rpmGenPath(), rpmGetPath(), rpmHeaderFormats, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_INFO, rpmmiAddPattern(), rpmmiFree(), rpmmiInstance(), rpmmiNext(), RPMMIRE_STRCMP, rpmMkdirPath(), rpmpkgSizeof(), rpmpkgWrite(), rpmpsmNext(), RPMRC_FAIL, RPMRC_OK, rpmswAdd(), rpmswEnter(), rpmswExit(), RPMTAG_ARCH, RPMTAG_ARCHIVESIZE, RPMTAG_BLINKHDRID, RPMTAG_BLINKNEVRA, RPMTAG_BLINKPKGID, RPMTAG_DEFAULTPREFIX, RPMTAG_DISTEPOCH, RPMTAG_EPOCH, RPMTAG_FILEGROUPNAME, RPMTAG_FILEPATHS, RPMTAG_FILEUSERNAME, RPMTAG_HEADERIMAGE, RPMTAG_HEADERIMMUTABLE, RPMTAG_HEADERSIGNATURES, RPMTAG_INSTALLTID, RPMTAG_NAME, RPMTAG_ORIGBASENAMES, RPMTAG_ORIGPATHS, RPMTAG_OS, RPMTAG_PACKAGEDIGEST, RPMTAG_PACKAGEORIGIN, RPMTAG_PACKAGESTAT, RPMTAG_PAYLOADCOMPRESSOR, RPMTAG_PAYLOADFORMAT, RPMTAG_POSTIN, RPMTAG_POSTINPROG, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, RPMTAG_PREIN, RPMTAG_PREINPROG, RPMTAG_PREUN, RPMTAG_PREUNPROG, RPMTAG_RELEASE, RPMTAG_REMOVETID, RPMTAG_SHA1HEADER, RPMTAG_TRIGGERNAME, RPMTAG_VERSION, rpmTagTable, rpmteA(), rpmteD(), rpmteE(), rpmteFd(), rpmteHdrid(), rpmteN(), rpmteNEVR(), rpmteO(), rpmteR(), rpmteSetDBInstance(), rpmteSetHeader(), rpmteV(), RPMTRANS_FLAG_APPLYONLY, RPMTRANS_FLAG_JUSTDB, RPMTRANS_FLAG_NOPOST, RPMTRANS_FLAG_NOPOSTUN, RPMTRANS_FLAG_NOPRE, RPMTRANS_FLAG_NOPREUN, RPMTRANS_FLAG_NORPMDB, RPMTRANS_FLAG_NOTRIGGERIN, RPMTRANS_FLAG_NOTRIGGERPOSTUN, RPMTRANS_FLAG_NOTRIGGERPREIN, RPMTRANS_FLAG_NOTRIGGERUN, RPMTRANS_FLAG_PKGCOMMIT, RPMTRANS_FLAG_TEST, RPMTRANS_TYPE_AUTOROLLBACK, RPMTRANS_TYPE_ROLLBACK, RPMTS_OP_COMPRESS, RPMTS_OP_DBADD, RPMTS_OP_DBREMOVE, RPMTS_OP_DIGEST, RPMTS_OP_UNCOMPRESS, rpmtsChrootDone(), rpmtsColor(), rpmtsCurrDir(), rpmtsFlags(), rpmtsGetRdb(), rpmtsGetTid(), rpmtsInitIterator(), rpmtsNotify(), rpmtsOp(), rpmtsRootDir(), rpmtsSetChrootDone(), rpmtsType(), rpmtsVSFlags(), RPMVSF_NOHDRCHK, runImmedTriggers(), runInstScript(), runTriggers(), s, snprintf(), st, stpcpy(), rpmDataType_u::str, strcmp(), _HE_s::t, t, _HE_s::tag, tag2sln(), uh, rpmDataType_u::ui32p, urlPath(), void, xmalloc, xstrdup(), and xx.

Referenced by _processFailedPackage(), rpmInstallSourcePackage(), rpmpsmNext(), rpmpsmScriptStage(), rpmtsProcess(), and rpmtsRepackage().

rpmpsm rpmpsmUnlink ( rpmpsm  psm,
const char *  msg 
)

Unreference a package state machine instance.

Parameters
psmpackage state machine
msg
Returns
NULL on last dereference

Variable Documentation

int _psm_debug

Definition at line 72 of file psm.c.