rpm
5.4.10
|
Package state machine to handle a package from a transaction set. More...
#include "system.h"
#include <rpmio_internal.h>
#include <rpmcb.h>
#include <rpmsx.h>
#include <rpmmacro.h>
#include <rpmurl.h>
#include <rpmaug.h>
#include <rpmficl.h>
#include <rpmjs.h>
#include <rpmlua.h>
#include <rpmperl.h>
#include <rpmpython.h>
#include <rpmruby.h>
#include <rpmsm.h>
#include <rpmsql.h>
#include <rpmsquirrel.h>
#include <rpmtcl.h>
#include <rpmtag.h>
#include <rpmtypes.h>
#include <pkgio.h>
#include <rpmdb.h>
#include <rpmtxn.h>
#include "signature.h"
#include <rpmlib.h>
#include "rpmfi.h"
#include "fsm.h"
#include "psm.h"
#include "rpmds.h"
#include "rpmte.h"
#include "rpmts.h"
#include "misc.h"
#include <rpmcli.h>
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | _MIRE_INTERNAL /* XXX mireApply doesn't tell which pattern matched. */ |
#define | _RPMDB_INTERNAL |
#define | _RPMFI_INTERNAL |
#define | _RPMSQ_INTERNAL |
#define | _RPMPSM_INTERNAL |
#define | F_ISSET(_psm, _FLAG) ((_psm)->flags & (RPMPSM_FLAGS_##_FLAG)) |
#define | F_SET(_psm, _FLAG) (*((unsigned *)&(_psm)->flags) |= (RPMPSM_FLAGS_##_FLAG)) |
#define | F_CLR(_psm, _FLAG) (*((unsigned *)&(_psm)->flags) &= ~(RPMPSM_FLAGS_##_FLAG)) |
#define | _RPMEVR_INTERNAL |
#define | _RPMDS_INTERNAL |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_INTERNAL /* XXX ts->notify */ |
#define | PATT_ISDIR(patt, len) |
#define | _PSM_DEBUG 0 |
Functions | |
static rpmRC | createDir (rpmts ts, rpmfi fi, const char **fn, const char *name) |
rpmRC | rpmInstallSourcePackage (rpmts ts, void *_fd, const char **specFilePtr, const char **cookie) |
Install source package. More... | |
static const char * | tag2sln (rpmTag tag) |
Return scriptlet name from tag. More... | |
static rpmScriptID | tag2slx (rpmTag tag) |
Return scriptlet id from tag. More... | |
static pid_t | psmWait (rpmpsm psm) |
Wait for child process to be reaped. More... | |
static rpmRC | runScript (rpmpsm psm, Header h, const char *sln, HE_t Phe, const char *script, int arg1, int arg2, ARGV_t matches) |
Run scriptlet with args. More... | |
static rpmRC | runInstScript (rpmpsm psm) |
Retrieve and run scriptlet from header. More... | |
static rpmRC | handleOneTrigger (const rpmpsm psm, Header sourceH, Header triggeredH, int arg2) |
Execute triggers. More... | |
static int | rpmdbTriggerGlobs (rpmpsm psm) |
static rpmRC | runTriggersLoop (rpmpsm psm, rpmTag tagno, int arg2) |
Run a dependency set loop against rpmdb triggers. More... | |
static rpmRC | runTriggers (rpmpsm psm) |
Run trigger scripts in the database that are fired by this header. More... | |
static rpmRC | runImmedTriggers (rpmpsm psm) |
Run triggers from this header that are fired by headers in the database. More... | |
static rpmfi | rpmtsiFi (const rpmtsi tsi) |
Return transaction element's file info. More... | |
static rpmRC | handleOneScriptTrigger (const rpmpsm psm, rpmds sourceDs, Header triggeredH, int arg2) |
Execute triggers. More... | |
static rpmRC | runScriptTriggersLoop (rpmpsm psm, rpmTag tagno, int arg2) |
Run a dependency set loop against rpmdb triggers. More... | |
static rpmRC | runScriptTriggers (rpmpsm psm) |
Run trigger scripts in the database that are fired by this header. More... | |
static const char * | pkgStageString (pkgStage a) |
void | rpmpsmSetAsync (rpmpsm psm, int async) |
rpmRC | rpmpsmScriptStage (rpmpsm psm, rpmTag scriptTag, rpmTag progTag) |
Run rpmpsmStage(PSM_SCRIPT) for scriptTag and progTag. More... | |
static void | rpmpsmFini (void *_psm) |
static rpmpsm | rpmpsmGetPool (rpmioPool pool) |
rpmpsm | rpmpsmNew (rpmts ts, rpmte te, rpmfi fi) |
Create and load a package state machine. More... | |
static rpmuint32_t | hLoadTID (Header h, rpmTag tag) |
Load a transaction id from a header. More... | |
static int | hCopyTag (Header sh, Header th, rpmTag tag) |
Copy a tag from a source to a target header. More... | |
static int | hSaveBlinks (Header h, const struct rpmChainLink_s *blink) |
Save backward link(s) of an upgrade chain into a header. More... | |
static int | hSaveFlinks (Header h, const struct rpmChainLink_s *flink) |
Save forward link(s) of an upgrade chain into a header. More... | |
static int | populateInstallHeader (const rpmts ts, const rpmte te, rpmfi fi) |
Add per-transaction data to an install header. More... | |
static int | postPopulateInstallHeader (const rpmts ts, const rpmpsm psm, rpmfi fi) |
Add fi->states to an install header. More... | |
static int | rpmpsmNext (rpmpsm psm, pkgStage nstage) |
rpmRC | rpmpsmStage (rpmpsm psm, pkgStage stage) |
Package state machine driver. More... | |
Variables | |
int | _psm_debug = 0 |
int | _psm_threads = 0 |
static const char * | SCRIPT_PATH |
static int | ldconfig_done = 0 |
static const char * | ldconfig_path = "/sbin/ldconfig" |
static rpmTag | _trigger_tag |
rpmioPool | _psmPool |
Package state machine to handle a package from a transaction set.
Definition in file psm.c.
#define _MIRE_INTERNAL /* XXX mireApply doesn't tell which pattern matched. */ |
#define F_CLR | ( | _psm, | |
_FLAG | |||
) | (*((unsigned *)&(_psm)->flags) &= ~(RPMPSM_FLAGS_##_FLAG)) |
Definition at line 52 of file psm.c.
Referenced by rpmpsmSetAsync(), and rpmpsmStage().
#define F_ISSET | ( | _psm, | |
_FLAG | |||
) | ((_psm)->flags & (RPMPSM_FLAGS_##_FLAG)) |
Definition at line 49 of file psm.c.
Referenced by rpmpsmStage(), rpmsqlI(), rpmsqlNew(), and runScript().
#define F_SET | ( | _psm, | |
_FLAG | |||
) | (*((unsigned *)&(_psm)->flags) |= (RPMPSM_FLAGS_##_FLAG)) |
Definition at line 50 of file psm.c.
Referenced by rpmpsmSetAsync(), and rpmpsmStage().
#define PATT_ISDIR | ( | patt, | |
len | |||
) |
Definition at line 71 of file psm.c.
Referenced by handleOneTrigger(), runImmedTriggers(), runScriptTriggersLoop(), and runTriggersLoop().
Definition at line 183 of file psm.c.
References _, _free(), Access(), Chown(), rpmGenPath(), rpmlog(), RPMLOG_ERR, rpmMkdirPath(), RPMRC_OK, rpmtsRootDir(), W_OK, and xstrdup().
Referenced by rpmInstallSourcePackage().
|
static |
Execute triggers.
psm | package state machine data |
sourceH | |
triggeredH | |
arg2 |
Definition at line 1763 of file psm.c.
References _free(), _psm_debug, alloca(), rpmDataType_u::argv, argvAdd(), argvFree(), _HE_s::c, headerGet(), mireClean(), mireFree(), mireNew(), mireRegcomp(), mireRegexec(), _HE_s::p, rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, rpmdbCountPackages(), rpmdsCount(), rpmdsFlags(), rpmdsFree(), rpmdsInit(), rpmdsIx(), rpmdsMatch(), rpmdsN(), rpmdsNegateRC(), rpmdsNew(), rpmdsNext(), rpmdsSetIx(), rpmdsSetNoPromote(), rpmdsTagN(), rpmlog(), RPMLOG_DEBUG, RPMMIRE_GLOB, RPMMIRE_PCRE, RPMRC_FAIL, RPMRC_OK, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_NAME, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, rpmtsGetRdb(), runScript(), stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, and xmalloc.
Referenced by runScriptTriggersLoop().
|
static |
Execute triggers.
psm | package state machine data |
sourceH | |
triggeredH | |
arg2 |
Definition at line 1249 of file psm.c.
References _free(), alloca(), rpmDataType_u::argv, argvAdd(), argvFree(), _HE_s::c, Glob_pattern_p(), headerGet(), mireClean(), mireFree(), mireNew(), mireRegcomp(), mireRegexec(), _HE_s::p, PATT_ISDIR, rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, rpmdbCountPackages(), rpmdsFlags(), rpmdsFree(), rpmdsInit(), rpmdsLink(), rpmdsMatch(), rpmdsN(), rpmdsNegateRC(), rpmdsNew(), rpmdsNext(), rpmdsSetNoPromote(), RPMMIRE_GLOB, RPMMIRE_PCRE, RPMRC_FAIL, RPMRC_OK, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, rpmtsGetRdb(), runScript(), stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, and xmalloc.
Referenced by runImmedTriggers(), and runTriggersLoop().
Copy a tag from a source to a target header.
sh | source header |
th | target header |
tag | tag to copy |
Definition at line 2274 of file psm.c.
References _free(), alloca(), _HE_s::c, headerGet(), headerPut(), _HE_s::p, rpmDataType_u::ptr, and _HE_s::tag.
Referenced by rpmpsmStage().
|
static |
Load a transaction id from a header.
h | header |
tag | tag to load |
Definition at line 2252 of file psm.c.
References _free(), alloca(), headerGet(), _HE_s::p, rpmDataType_u::ptr, _HE_s::tag, and rpmDataType_u::ui32p.
Referenced by rpmpsmStage().
|
static |
Save backward link(s) of an upgrade chain into a header.
h | header |
*blink | backward links |
< End of chain marker.
Definition at line 2294 of file psm.c.
References alloca(), rpmDataType_u::argv, argvCount(), argvData(), _HE_s::c, headerPut(), _HE_s::p, RPM_STRING_ARRAY_TYPE, RPMTAG_BLINKHDRID, RPMTAG_BLINKNEVRA, RPMTAG_BLINKPKGID, RPMTE_CHAIN_END, _HE_s::t, and _HE_s::tag.
Referenced by populateInstallHeader().
|
static |
Save forward link(s) of an upgrade chain into a header.
h | header |
*flink | forward links |
Definition at line 2349 of file psm.c.
References alloca(), rpmDataType_u::argv, argvCount(), argvData(), _HE_s::c, headerPut(), _HE_s::p, RPM_STRING_ARRAY_TYPE, RPMTAG_FLINKHDRID, RPMTAG_FLINKNEVRA, RPMTAG_FLINKPKGID, RPMTE_CHAIN_END, _HE_s::t, and _HE_s::tag.
Referenced by rpmpsmStage().
|
static |
Definition at line 2091 of file psm.c.
References 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_POSTTRANS, PSM_PRE, PSM_PRETRANS, PSM_PROCESS, PSM_RPMDB_ADD, PSM_RPMDB_LOAD, PSM_RPMDB_REMOVE, PSM_RPMIO_FLAGS, PSM_SCRIPT, PSM_TRIGGERS, PSM_UNDO, and PSM_UNKNOWN.
Referenced by rpmpsmStage().
Add per-transaction data to an install header.
ts | transaction set |
te | transaction element |
fi | file info set |
Definition at line 2416 of file psm.c.
References _free(), alloca(), _HE_s::c, headerGetDigest(), headerGetOrigin(), headerGetStatbuf(), headerPut(), hSaveBlinks(), _HE_s::p, rpmDataType_u::ptr, RPM_BIN_TYPE, RPM_STRING_TYPE, RPM_UINT32_TYPE, RPMTAG_INSTALLCOLOR, RPMTAG_INSTALLTIME, RPMTAG_ORIGINTID, RPMTAG_ORIGINTIME, RPMTAG_PACKAGECOLOR, RPMTAG_PACKAGEDIGEST, RPMTAG_PACKAGEORIGIN, RPMTAG_PACKAGESTAT, rpmteColor(), rpmteOriginTid(), rpmteOriginTime(), RPMTRANS_TYPE_ROLLBACK, rpmtsColor(), rpmtsType(), Stat(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, URL_IS_HTTP, URL_IS_HTTPS, urlPath(), and xstrdup().
Referenced by rpmpsmStage().
Add fi->states to an install header.
ts | transaction set |
te | transaction element |
fi | file info set |
Definition at line 2531 of file psm.c.
References alloca(), _HE_s::c, headerPut(), _HE_s::p, RPM_UINT32_TYPE, RPM_UINT8_TYPE, rpmfiFC(), rpmpsmStage(), RPMSCRIPT_MAX, RPMTAG_FILESTATES, RPMTAG_SCRIPTMETRICS, RPMTAG_SCRIPTSTATES, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, and rpmDataType_u::ui8p.
Referenced by rpmpsmStage().
|
static |
Wait for child process to be reaped.
psm | package state machine data |
Definition at line 456 of file psm.c.
References alloca(), rpmDataType_u::argv, argvCount(), argvData(), argvFree(), _HE_s::c, Chdir(), Chroot(), D_, _HE_s::p, RPMCALLBACK_SCRIPT_ERROR, rpmExpand(), rpmjsFree(), rpmjsNew(), rpmjsRun(), rpmlog(), RPMLOG_DEBUG, rpmluaDelVar(), rpmluaPushTable(), rpmluaRunScript(), rpmluaSetVar(), RPMLUAV_STRING, rpmluavFree(), rpmluavNew(), rpmluavSetListMode(), rpmluavSetValue(), rpmluavSetValueNum(), rpmperlFree(), rpmperlNew(), rpmperlRun(), rpmpythonFree(), rpmpythonNew(), rpmpythonRun(), RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, rpmrubyFree(), rpmrubyNew(), rpmrubyRun(), RPMSCRIPT_STATE_EMBEDDED, RPMSCRIPT_STATE_EXEC, RPMSCRIPT_STATE_REAPED, rpmsqlFree(), rpmsqlNew(), rpmsqlRun(), rpmsquirrelFree(), rpmsquirrelNew(), rpmsquirrelRun(), rpmsqWait(), rpmswAdd(), rpmtclFree(), rpmtclNew(), rpmtclRun(), RPMTS_OP_SCRIPTLETS, rpmtsChrootDone(), rpmtsNotify(), rpmtsOp(), rpmtsRootDir(), rpmtsSetChrootDone(), snprintf(), tag2slx(), and xmalloc.
Referenced by runScript().
|
static |
Definition at line 1415 of file psm.c.
References argvAdd(), argvCount(), argvFree(), Glob_pattern_p(), mireAppend(), rpmdbMireApply(), RPMMIRE_GLOB, RPMMIRE_PCRE, RPMMIRE_STRCMP, RPMTAG_TRIGGERNAME, and rpmtsGetRdb().
Referenced by runScriptTriggers(), and runTriggers().
rpmRC rpmInstallSourcePackage | ( | rpmts | ts, |
void * | _fd, | ||
const char ** | specFilePtr, | ||
const char ** | cookie | ||
) |
Install source package.
ts | transaction set |
_fd | file handle |
specFilePtr | address of spec file name (or NULL) |
cookie | address of cookie pointer (or NULL) |
Definition at line 210 of file psm.c.
References _, _free(), alloca(), rpmDataType_u::argv, createDir(), FA_CREATE, Fclose(), fdLink(), headerFree(), headerGet(), headerIsEntry(), headerLink(), headerMacrosLoad(), IOSM_MAP_GID, IOSM_MAP_MODE, IOSM_MAP_PATH, IOSM_MAP_UID, _HE_s::p, PSM_FINI, PSM_PKGINSTALL, PSM_PROCESS, rpmExpand(), rpmfiFFlags(), rpmfiFN(), rpmfiInit(), RPMFILE_SPECFILE, rpmfiNext(), rpmlog(), RPMLOG_ERR, rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), RPMTAG_ARCH, RPMTAG_BASENAMES, RPMTAG_COOKIE, RPMTAG_FILEPATHS, RPMTAG_SOURCERPM, rpmteFI(), rpmteSetHeader(), rpmtsAddInstallElement(), rpmtsClean(), rpmtsElement(), rpmDataType_u::str, _HE_s::tag, and xstrdup().
Referenced by rpmInstallSource().
|
static |
Definition at line 2175 of file psm.c.
References _free(), rpmdsFree(), rpmfiFree(), rpmteFree(), and rpmtsFree().
Referenced by rpmpsmGetPool().
Definition at line 2204 of file psm.c.
References _psm_debug, _psmPool, rpmioGetPool(), rpmioNewPool(), and rpmpsmFini().
Referenced by rpmpsmNew().
Create and load a package state machine.
ts | transaction set |
te | transaction set element |
fi | file info set |
Definition at line 2220 of file psm.c.
References rpmfiLink(), rpmpsmGetPool(), rpmpsmLink(), rpmtsLink(), and xcalloc().
Referenced by _processFailedPackage(), rpmInstallSourcePackage(), rpmtsProcess(), rpmtsRepackage(), rpmtsRunScript(), rpmtsRunScriptTriggers(), and rpmVerifyScript().
Definition at line 2575 of file psm.c.
References _psm_threads, rpmpsmStage(), rpmsqJoin(), and rpmsqThread().
Referenced by rpmpsmStage().
Run rpmpsmStage(PSM_SCRIPT) for scriptTag and progTag.
psm | package state machine data |
scriptTag | scriptlet tag to execute |
progTag | scriptlet prog tag to execute |
Definition at line 2146 of file psm.c.
References PSM_POSTTRANS, PSM_PRETRANS, PSM_SCRIPT, rpmpsmStage(), RPMTAG_POSTTRANS, RPMTAG_PRETRANS, RPMTAG_SANITYCHECK, RPMTAG_TRIGGERPOSTTRANSIN, RPMTAG_TRIGGERPOSTTRANSUN, RPMTAG_TRIGGERPRETRANSIN, RPMTAG_TRIGGERPRETRANSUN, and RPMTAG_VERIFYSCRIPT.
Referenced by rpmtsRunScript(), rpmtsRunScriptTriggers(), and rpmVerifyScript().
void rpmpsmSetAsync | ( | rpmpsm | psm, |
int | async | ||
) |
Package state machine driver.
Definition at line 2592 of file psm.c.
References _, _free(), alloca(), rpmDataType_u::argv, _HE_s::c, Chdir(), Chroot(), D_, dbiOpen(), errno, F_CLR, F_ISSET, F_SET, FA_COPYOUT, Fclose(), fdDup(), Fdopen(), FDSTAT_DIGEST, fdstat_op(), FDSTAT_READ, FDSTAT_WRITE, Ferror(), Fflush(), Fileno(), Fopen(), fsmSetup(), fsmTeardown(), Fstrerror(), hCopyTag(), headerCopyLoad(), headerFini(), headerFree(), headerGet(), headerGetInstance(), headerInit(), headerIsEntry(), headerLink(), headerNew(), headerNext(), headerPut(), headerRegenSigHeader(), headerReload(), headerSetInstance(), headerSprintf(), hLoadTID(), hSaveFlinks(), IOSM_MAP_GID, IOSM_MAP_MODE, IOSM_MAP_PATH, IOSM_MAP_UID, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_SBIT_CHECK, iosmStrerror(), _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_POSTTRANS, PSM_PRE, PSM_PRETRANS, 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, 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_POSTTRANS, RPMTAG_POSTTRANSPROG, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, RPMTAG_PREIN, RPMTAG_PREINPROG, RPMTAG_PRETRANS, RPMTAG_PRETRANSPROG, 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(), runScriptTriggers(), runTriggers(), snprintf(), stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, tag2sln(), rpmDataType_u::ui32p, urlPath(), xmalloc, and xstrdup().
Referenced by _processFailedPackage(), postPopulateInstallHeader(), rpmInstallSourcePackage(), rpmpsmNext(), rpmpsmScriptStage(), rpmtsProcess(), and rpmtsRepackage().
Return transaction element's file info.
tsi | transaction element iterator |
Definition at line 1737 of file psm.c.
References rpmtsElement().
Referenced by runScriptTriggersLoop().
Run triggers from this header that are fired by headers in the database.
psm | package state machine data |
Definition at line 1610 of file psm.c.
References _free(), _trigger_tag, alloca(), argiAdd(), argiCount(), argiData(), argiFree(), argiSort(), argvAdd(), argvFree(), _HE_s::c, Glob_pattern_p(), handleOneTrigger(), headerGet(), _HE_s::p, PATT_ISDIR, rpmDataType_u::ptr, rpmdbMireApply(), rpmdsEVR(), rpmdsFlags(), rpmdsFree(), rpmdsInit(), rpmdsLink(), rpmdsN(), rpmdsNext(), rpmExpand(), rpmmiCount(), rpmmiFree(), rpmmiInstance(), rpmmiNext(), rpmmiPrune(), RPMMIRE_GLOB, RPMMIRE_PCRE, RPMRC_FAIL, RPMRC_OK, RPMTAG_DIRNAMES, RPMTAG_FILEPATHS, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_TRIGGERINDEX, rpmtsGetRdb(), rpmtsInitIterator(), _HE_s::tag, and rpmDataType_u::ui32p.
Referenced by rpmpsmStage().
Retrieve and run scriptlet from header.
psm | package state machine data |
Definition at line 1193 of file psm.c.
References _free(), alloca(), rpmDataType_u::argv, headerGet(), _HE_s::p, rpmDataType_u::ptr, RPM_STRING_TYPE, rpmExpand(), RPMRC_OK, runScript(), stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, tag2sln(), and xmalloc.
Referenced by rpmpsmStage().
|
static |
Run scriptlet with args.
Run a script with an interpreter. If the interpreter is not specified, /bin/sh will be used.
psm | package state machine data |
h | header |
sln | name of scriptlet section |
Phe | scriptlet args, Phe->p.argv[0] is interpreter to use |
script | scriptlet body |
arg1 | no. instances of package installed after scriptlet exec (-1 is no arg) |
arg2 | ditto, but for the target package |
Definition at line 796 of file psm.c.
References _, _free(), alloca(), rpmDataType_u::argv, argvCount(), argvData(), _HE_s::c, Chdir(), Chroot(), D_, doputenv(), errno, F_ISSET, Fclose(), fdDup(), Ferror(), Fileno(), Fopen(), Fwrite(), headerGet(), IP, _HE_s::p, psmWait(), rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, RPMCALLBACK_SCRIPT_ERROR, RPMCALLBACK_SCRIPT_START, RPMCALLBACK_SCRIPT_STOP, rpmExpand(), rpmIsDebug, rpmIsVerbose, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, RPMSCRIPT_MAX, RPMSCRIPT_STATE_EXEC, RPMSCRIPT_STATE_SELINUX, RPMSCRIPT_STATE_UNKNOWN, rpmsqFork(), rpmswEnter(), rpmswExit(), rpmsxExec(), RPMTAG_INSTALLPREFIX, RPMTAG_INSTPREFIXES, RPMTAG_NVRA, RPMTAG_POSTIN, RPMTAG_POSTUN, RPMTAG_PREIN, RPMTAG_PREUN, rpmTempFile(), rpmtsChrootDone(), rpmtsGetRdb(), rpmtsNotify(), rpmtsRootDir(), rpmtsScriptFd(), rpmtsSELinuxEnabled(), SCRIPT_PATH, stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, tag2sln(), tag2slx(), Unlink(), unsetenv(), rpmop_s::usecs, and xmalloc.
Referenced by handleOneScriptTrigger(), handleOneTrigger(), and runInstScript().
Run trigger scripts in the database that are fired by this header.
psm | package state machine data |
Definition at line 2043 of file psm.c.
References _free(), _trigger_tag, argvFree(), mireFreeAll(), rpmdbTriggerGlobs(), rpmExpand(), RPMRC_OK, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_NAME, RPMTAG_PROVIDENAME, and runScriptTriggersLoop().
Referenced by rpmpsmStage().
Run a dependency set loop against rpmdb triggers.
psm | package state machine data |
tagno | dependency set to run against rpmdb |
arg2 | scriptlet arg2 |
Definition at line 1896 of file psm.c.
References _psm_debug, alloca(), argiAdd(), argiCount(), argiData(), argiFree(), argiSort(), handleOneScriptTrigger(), mireRegexec(), PATT_ISDIR, PSM_PKGINSTALL, rpmfiDN(), rpmfiFN(), rpmfiInit(), rpmfiNext(), rpmlog(), RPMLOG_DEBUG, rpmmiFree(), rpmmiInstance(), rpmmiNext(), rpmmiPrune(), RPMRC_FAIL, RPMRC_OK, RPMSENSE_EQUAL, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_TRIGGERNAME, rpmteClose(), rpmteD(), rpmteE(), rpmteN(), rpmteR(), rpmteV(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsInitIterator(), stpcpy(), tagName(), TR_ADDED, and TR_REMOVED.
Referenced by runScriptTriggers().
Run trigger scripts in the database that are fired by this header.
psm | package state machine data |
Definition at line 1541 of file psm.c.
References _free(), _trigger_tag, argvFree(), mireFreeAll(), rpmdbCountPackages(), rpmdbTriggerGlobs(), rpmExpand(), RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_NAME, RPMTAG_PROVIDENAME, rpmteN(), rpmtsGetRdb(), and runTriggersLoop().
Referenced by rpmpsmStage().
Run a dependency set loop against rpmdb triggers.
psm | package state machine data |
tagno | dependency set to run against rpmdb |
arg2 | scriptlet arg2 |
Definition at line 1446 of file psm.c.
References _free(), argiAdd(), argiCount(), argiData(), argiFree(), argiSort(), handleOneTrigger(), mireRegexec(), PATT_ISDIR, rpmdsFree(), rpmdsInit(), rpmdsN(), rpmdsNew(), rpmdsNext(), rpmmiFree(), rpmmiInstance(), rpmmiNext(), rpmmiPrune(), RPMRC_FAIL, RPMRC_OK, RPMTAG_DIRNAMES, RPMTAG_TRIGGERNAME, rpmtsInitIterator(), stpcpy(), xmalloc, and xstrdup().
Referenced by runTriggers().
|
static |
Return scriptlet name from tag.
tag | scriptlet tag |
Definition at line 388 of file psm.c.
References RPMTAG_BUILDBUILD, RPMTAG_BUILDCHECK, RPMTAG_BUILDINSTALL, RPMTAG_BUILDPREP, RPMTAG_POSTIN, RPMTAG_POSTTRANS, RPMTAG_POSTUN, RPMTAG_PREIN, RPMTAG_PRETRANS, RPMTAG_PREUN, RPMTAG_SANITYCHECK, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTTRANSIN, RPMTAG_TRIGGERPOSTTRANSUN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERPREIN, RPMTAG_TRIGGERPRETRANSIN, RPMTAG_TRIGGERPRETRANSUN, RPMTAG_TRIGGERUN, and RPMTAG_VERIFYSCRIPT.
Referenced by rpmpsmStage(), runInstScript(), and runScript().
|
static |
Return scriptlet id from tag.
tag | scriptlet tag |
Definition at line 422 of file psm.c.
References RPMSCRIPT_BUILD, RPMSCRIPT_CHECK, RPMSCRIPT_INSTALL, RPMSCRIPT_MAX, RPMSCRIPT_POSTIN, RPMSCRIPT_POSTTRANS, RPMSCRIPT_POSTUN, RPMSCRIPT_PREIN, RPMSCRIPT_PREP, RPMSCRIPT_PRETRANS, RPMSCRIPT_PREUN, RPMSCRIPT_SANITYCHECK, RPMSCRIPT_TRIGGERIN, RPMSCRIPT_TRIGGERPOSTTRANSIN, RPMSCRIPT_TRIGGERPOSTTRANSUN, RPMSCRIPT_TRIGGERPOSTUN, RPMSCRIPT_TRIGGERPREIN, RPMSCRIPT_TRIGGERPRETRANSIN, RPMSCRIPT_TRIGGERPRETRANSUN, RPMSCRIPT_TRIGGERUN, RPMSCRIPT_VERIFY, RPMTAG_BUILDBUILD, RPMTAG_BUILDCHECK, RPMTAG_BUILDINSTALL, RPMTAG_BUILDPREP, RPMTAG_POSTIN, RPMTAG_POSTTRANS, RPMTAG_POSTUN, RPMTAG_PREIN, RPMTAG_PRETRANS, RPMTAG_PREUN, RPMTAG_SANITYCHECK, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTTRANSIN, RPMTAG_TRIGGERPOSTTRANSUN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERPREIN, RPMTAG_TRIGGERPRETRANSIN, RPMTAG_TRIGGERPRETRANSUN, RPMTAG_TRIGGERUN, and RPMTAG_VERIFYSCRIPT.
Referenced by psmWait(), and runScript().
int _psm_debug = 0 |
Definition at line 76 of file psm.c.
Referenced by handleOneScriptTrigger(), rpmpsmGetPool(), and runScriptTriggersLoop().
int _psm_threads = 0 |
Definition at line 78 of file psm.c.
Referenced by rpmpsmNext().
rpmioPool _psmPool |
Definition at line 2202 of file psm.c.
Referenced by rpmpsmGetPool().
|
static |
Definition at line 1239 of file psm.c.
Referenced by runImmedTriggers(), runScriptTriggers(), and runTriggers().
|
static |
Definition at line 380 of file psm.c.
Referenced by runScript().