# lib/psm.c File Reference

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

`#include "system.h"`
`#include "psm.h"`
`#include <rpmmacro.h>`
`#include <rpmurl.h>`
`#include "depends.h"`
`#include "rpmlead.h"`
`#include "signature.h"`
`#include "ugid.h"`
`#include "misc.h"`
`#include "rpmdb.h"`
`#include "debug.h"`

Go to the source code of this file.

## Data Structures

struct | tagMacro
| Macros to be defined from per-header tag values. More...

## Functions

int | rpmVersionCompare (Header first, Header second)
| Compare headers to determine which header is "newer".
void | loadFi (Header h, TFI_t fi)
| Load data from header into transaction file element info.
void | freeFi (TFI_t fi)
| Destroy transaction element file info.
const char *const | fiTypeString (TFI_t fi)
| Return formatted string representation of package disposition.
int | rpmInstallLoadMacros (TFI_t fi, Header h)
| Define per-header macros.
int | mergeFiles (TFI_t fi, Header h, Header newH)
| Copy file data from h to newH.
int | markReplacedFiles (PSM_t psm)
| Mark files in database shared with this package as "replaced".
rpmRC | chkdir (const char *dpath, const char *dname)
| Create directory if it does not exist, make sure path is writable.
rpmRC | rpmInstallSourcePackage (const char *rootDir, FD_t fd, const char **specFilePtr, rpmCallbackFunction notify, rpmCallbackData notifyData, char **cookie)
| Install source package.
const char *const | tag2sln (int tag)
| Return scriptlet name from tag.
int | runScript (PSM_t psm, Header h, const char *sln, int progArgc, const char **progArgv, const char *script, int arg1, int arg2)
| Run scriptlet with args.
rpmRC | runInstScript (PSM_t psm)
| Retrieve and run scriptlet from header.
int | handleOneTrigger (PSM_t psm, Header sourceH, Header triggeredH, int arg2, unsigned char *triggersAlreadyRun)
int | runTriggers (PSM_t psm)
| Run trigger scripts in the database that are fired by this header.
int | runImmedTriggers (PSM_t psm)
| Run triggers from this header that are fired by headers in the database.
const char *const | pkgStageString (pkgStage a)
int | psmStage (PSM_t psm, pkgStage stage)
| Package state machine driver.

## Variables

tagMacro | tagMacros []
| Macros to be defined from per-header tag values.
char * | SCRIPT_PATH

## Detailed Description

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

Definition in file psm.c.

## Function Documentation

rpmRC chkdir | ( | const char * | dpath,
|  | const char * | dname
| ) | `[static]`

Create directory if it does not exist, make sure path is writable.

Note:
  This will only create last component of directory path.

Parameters:

  dpath | directory path
  dname | directory use

Returns:
  rpmRC return code

Definition at line 577 of file psm.c.

References _, Access(), errno, Mkdir(), RPMERR_CREATE, rpmError, rpmRC, RPMRC_FAIL, RPMRC_OK, Stat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and W_OK.

Referenced by rpmInstallSourcePackage().

const char* const fiTypeString | ( | TFI_t | fi | ) |

Return formatted string representation of package disposition.

Parameters:

  a | package dispostion

Returns:
  formatted string

Definition at line 235 of file psm.c.

References TFI_t, and transactionFileInfo_s::type.

Referenced by fsmStage().

void freeFi | ( | TFI_t | fi | ) |

Destroy transaction element file info.

Parameters:

  fi | transaction element file info

Definition at line 188 of file psm.c.

References _free(), transactionFileInfo_s::actions, transactionFileInfo_s::apath, transactionFileInfo_s::bnl, transactionFileInfo_s::dil, transactionFileInfo_s::dnl, transactionFileInfo_s::fflags, transactionFileInfo_s::fgids, transactionFileInfo_s::fgroup, transactionFileInfo_s::flangs, transactionFileInfo_s::flinks, transactionFileInfo_s::fmapflags, transactionFileInfo_s::fmd5s, transactionFileInfo_s::fmodes, freeFSM(), transactionFileInfo_s::fsizes, transactionFileInfo_s::fsm, transactionFileInfo_s::fstates, transactionFileInfo_s::fuids, transactionFileInfo_s::fuser, transactionFileInfo_s::h, headerFree(), transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::name, transactionFileInfo_s::obnl, transactionFileInfo_s::odnl, transactionFileInfo_s::release, transactionFileInfo_s::replaced, transactionFileInfo_s::replacedSizes, TFI_t, transactionFileInfo_s::type, and transactionFileInfo_s::version.

Referenced by freeFl(), freePackage(), freeSpec(), rpmInstallSourcePackage(), and rpmVerifyScript().

int handleOneTrigger | ( | PSM_t | psm,
|  | Header | sourceH,
|  | Header | triggeredH,
|  | int | arg2,
|  | unsigned char * | triggersAlreadyRun
| ) | `[static]`

Parameters:

  psm | package state machine data
  sourceH |
  triggeredH |
  arg2 |
  triggersAlreadyRun |

Returns:

Definition at line 1093 of file psm.c.

References psm_s::countCorrection, psm_s::fi, Header, headerMatchesDepFlags(), headerNVR(), transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::hge, HGE_t, int_32, PSM_t, rpmTransactionSet_s::rpmdb, rpmdbCountPackages(), rpmRC, RPMRC_FAIL, RPMRC_OK, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, RPMTAG_TRIGGERVERSION, rpmTagType, rpmTransactionSet, runScript(), psm_s::sense, TFI_t, and psm_s::ts.

Referenced by runImmedTriggers(), and runTriggers().

void loadFi | ( | Header | h,
|  | TFI_t | fi
| ) |

Load data from header into transaction file element info.

Parameters:

  h | header
  fi | transaction element file info

Definition at line 72 of file psm.c.

References transactionFileInfo_s::action, transactionFileInfo_s::actions, transactionFileInfo_s::archiveSize, transactionFileInfo_s::bnl, transactionFileInfo_s::bnlmax, CPIO_ALL_HARDLINKS, CPIO_MAP_ABSOLUTE, CPIO_MAP_ADDDOT, CPIO_MAP_GID, CPIO_MAP_MODE, CPIO_MAP_PATH, CPIO_MAP_UID, transactionFileInfo_s::dc, transactionFileInfo_s::dil, transactionFileInfo_s::dnl, transactionFileInfo_s::dnlmax, transactionFileInfo_s::dperms, transactionFileInfo_s::epoch, FA_UNKNOWN, transactionFileInfo_s::fc, transactionFileInfo_s::fflags, transactionFileInfo_s::flags, transactionFileInfo_s::flangs, transactionFileInfo_s::flinks, transactionFileInfo_s::fmd5s, transactionFileInfo_s::fmodes, transactionFileInfo_s::fmtimes, transactionFileInfo_s::fperms, transactionFileInfo_s::frdevs, transactionFileInfo_s::fsizes, transactionFileInfo_s::fsm, transactionFileInfo_s::fstates, transactionFileInfo_s::h, transactionFileInfo_s::hae, HAE_t, Header, headerFree(), headerLink(), transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::hge, HGE_t, transactionFileInfo_s::hme, HME_t, transactionFileInfo_s::hre, HRE_t, transactionFileInfo_s::mapflags, transactionFileInfo_s::name, newFSM(), transactionFileInfo_s::release, transactionFileInfo_s::replacedSizes, RPMTAG_ARCHIVESIZE, RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_EPOCH, RPMTAG_FILEFLAGS, RPMTAG_FILELANGS, RPMTAG_FILELINKTOS, RPMTAG_FILEMD5S, RPMTAG_FILEMODES, RPMTAG_FILEMTIMES, RPMTAG_FILERDEVS, RPMTAG_FILESIZES, RPMTAG_FILESTATES, RPMTAG_NAME, RPMTAG_RELEASE, RPMTAG_VERSION, TFI_t, transactionFileInfo_s::type, uint_32, transactionFileInfo_s::version, xcalloc(), xmalloc(), and xstrdup().

Referenced by genCpioListAndHeader(), rpmInstallSourcePackage(), rpmRunTransactions(), and rpmVerifyScript().

int markReplacedFiles | ( | PSM_t | psm | ) | `[static]`

Mark files in database shared with this package as "replaced".

Parameters:

  psm | package state machine data

Returns:
  0 always

Definition at line 497 of file psm.c.

References alloca(), transactionFileInfo_s::fc, psm_s::fi, Header, transactionFileInfo_s::hge, HGE_t, sharedFileInfo::otherPkg, PSM_t, transactionFileInfo_s::replaced, rpmTransactionSet_s::rpmdb, rpmdbAppendIterator(), rpmdbFreeIterator(), rpmdbGetIteratorOffset(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), rpmdbSetIteratorModified(), rpmdbSetIteratorRewrite(), RPMFILE_STATE_REPLACED, RPMTAG_FILESTATES, rpmTransactionSet, TFI_t, and psm_s::ts.

Referenced by psmStage().

int mergeFiles | ( | TFI_t | fi,
|  | Header | h,
|  | Header | newH
| ) | `[static]`

Copy file data from h to newH.

Parameters:

  h | header from
  newH | header to
  actions | array of file dispositions

Returns:
  0 on success, 1 on failure

Definition at line 314 of file psm.c.

References _, transactionFileInfo_s::actions, FA_SKIPMULTILIB, fileAction, Header, headerAddOrAppendEntry(), transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::hge, HGE_t, transactionFileInfo_s::hme, HME_t, int_16, int_32, int_8, isDependsMULTILIB, RPM_CHAR_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_INT8_TYPE, RPM_STRING_ARRAY_TYPE, RPMERR_DATATYPE, rpmError, RPMSENSE_SENSEMASK, rpmTag, RPMTAG_BASENAMES, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_FILEDEVICES, RPMTAG_FILEFLAGS, RPMTAG_FILEGROUPNAME, RPMTAG_FILEINODES, RPMTAG_FILELANGS, RPMTAG_FILELINKTOS, RPMTAG_FILEMD5S, RPMTAG_FILEMODES, RPMTAG_FILEMTIMES, RPMTAG_FILERDEVS, RPMTAG_FILESIZES, RPMTAG_FILESTATES, RPMTAG_FILEUSERNAME, RPMTAG_FILEVERIFYFLAGS, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_SIZE, rpmTagType, TFI_t, uint_32, and xcalloc().

Referenced by psmStage().

const char* const pkgStageString | ( | pkgStage | a | ) | `[static]`

Definition at line 1298 of file psm.c.

References pkgStage, 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, and PSM_UNKNOWN.

Referenced by psmStage().

int psmStage | ( | PSM_t | 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 1342 of file psm.c.

References _, _free(), transactionFileInfo_s::action, transactionFileInfo_s::actions, psm_s::amount, transactionFileInfo_s::ap, transactionFileInfo_s::apath, transactionFileInfo_s::archiveSize, buildOrigFileList(), psm_s::cfd, rpmTransactionSet_s::chrootDone, psm_s::chrootDone, psm_s::countCorrection, CPIO_MAP_GID, CPIO_MAP_MODE, CPIO_MAP_PATH, CPIO_MAP_UID, cpioStrerror(), rpmTransactionSet_s::currDir, errno, FA_COPYOUT, psm_s::failedFile, transactionFileInfo_s::fc, Fclose(), psm_s::fd, fdDup(), Fdopen(), Ferror(), Fflush(), transactionFileInfo_s::fgids, transactionFileInfo_s::fgroup, psm_s::fi, fileAction, Fileno(), transactionFileInfo_s::fmodes, Fopen(), transactionFileInfo_s::fsm, FSM_PKGBUILD, FSM_PKGCOMMIT, FSM_PKGERASE, FSM_PKGINSTALL, fsmSetup(), fsmTeardown(), transactionFileInfo_s::fstates, Fstrerror(), transactionFileInfo_s::fuids, transactionFileInfo_s::fuser, transactionFileInfo_s::gid, gnameToGid(), psm_s::goal, transactionFileInfo_s::h, Header, HEADER_MAGIC_YES, headerAddEntry(), headerCopy(), headerCopyLoad(), headerFree(), headerFreeData(), headerFreeIterator(), headerGetEntry(), headerInitIterator(), headerIsEntry(), HeaderIterator, headerLink(), headerNew(), headerNextIterator(), headerRegenSigHeader(), headerSprintf(), headerWrite(), transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::hge, HGE_t, transactionFileInfo_s::hme, HME_t, hPTR_t, rpmTransactionSet_s::id, int_32, availablePackage::key, transactionFileInfo_s::mapflags, markReplacedFiles(), mergeFiles(), psm_s::mi, transactionFileInfo_s::name, rpmTransactionSet_s::notify, rpmTransactionSet_s::notifyData, psm_s::npkgs_installed, psm_s::oh, psm_s::pkgfn, pkgStage, pkgStageString(), psm_s::pkgURL, psm_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_t, PSM_TRIGGERS, PSM_UNDO, PSM_UNKNOWN, psm_s::rc, transactionFileInfo_s::record, transactionFileInfo_s::release, rpmTransactionSet_s::rootDir, RPM_CHAR_TYPE, RPM_INT32_TYPE, rpmBuildFileList(), RPMCALLBACK_INST_PROGRESS, RPMCALLBACK_UNINST_START, RPMCALLBACK_UNINST_STOP, rpmTransactionSet_s::rpmdb, rpmdbAdd(), rpmdbCountPackages(), rpmdbFreeIterator(), rpmdbGetIteratorOffset(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), rpmdbRemove(), rpmdbSetIteratorRE(), RPMERR_CPIO, RPMERR_NOSPACE, RPMERR_SCRIPT, rpmError, RPMFILE_STATE_NORMAL, rpmFreeSignature(), rpmGenPath(), rpmGetArchInfo(), rpmGetOsInfo(), rpmGetPath(), rpmHeaderFormats, psm_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_DEFAULTPREFIX, RPMTAG_FILEGROUPNAME, RPMTAG_FILESTATES, RPMTAG_FILEUSERNAME, RPMTAG_HEADERIMAGE, RPMTAG_HEADERIMMUTABLE, RPMTAG_INSTALLTIME, RPMTAG_MULTILIBS, RPMTAG_NAME, RPMTAG_ORIGBASENAMES, RPMTAG_PAYLOADCOMPRESSOR, RPMTAG_POSTIN, RPMTAG_POSTINPROG, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, RPMTAG_PREIN, RPMTAG_PREINPROG, RPMTAG_PREUN, RPMTAG_PREUNPROG, RPMTAG_RELEASE, RPMTAG_REMOVETID, RPMTAG_VERSION, rpmTagTable, RPMTRANS_FLAG_APPLYONLY, RPMTRANS_FLAG_JUSTDB, RPMTRANS_FLAG_MULTILIB, 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, rpmTransactionSet, rpmWriteSignature(), runImmedTriggers(), runInstScript(), runTriggers(), psm_s::scriptArg, psm_s::scriptTag, psm_s::sense, psm_s::stepName, stpcpy(), transactionFileInfo_s::striplen, tag2sln(), TFI_t, psm_s::total, rpmTransactionSet_s::transFlags, psm_s::ts, transactionFileInfo_s::uid, uint_32, unameToUid(), urlPath(), transactionFileInfo_s::version, psm_s::what, writeLead(), xcalloc(), and xmalloc().

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

int rpmInstallLoadMacros | ( | TFI_t | fi,
|  | Header | h
| ) | `[static]`

Define per-header macros.

Parameters:

  fi | transaction element file info
  h | header

Returns:
  0 always

Definition at line 267 of file psm.c.

References addMacro(), Header, transactionFileInfo_s::hge, HGE_t, int_32, tagMacro::macroname, RPM_BIN_TYPE, RPM_CHAR_TYPE, RPM_I18NSTRING_TYPE, RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_INT8_TYPE, RPM_NULL_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, rpmTagType, tagMacros, and TFI_t.

Referenced by rpmInstallSourcePackage().

rpmRC rpmInstallSourcePackage | ( | const char * | rootDir,
|  | FD_t | fd,
|  | const char ** | specFilePtr,
|  | rpmCallbackFunction | notify,
|  | rpmCallbackData | notifyData,
|  | char ** | cookie
| ) |

Install source package.

Parameters:

  rootDir | path to top of install tree (or NULL)
  fd | file handle

Return values:

  specFilePtr | address of spec file name (or NULL)

Parameters:

  notify | progress callback
  notifyData | progress callback private data

Return values:

  cooke | address of cookie pointer (or NULL)

Returns:
  rpmRC return code

Definition at line 612 of file psm.c.

References _, _free(), rpmTransactionSet_s::addedPackages, chkdir(), CPIO_MAP_GID, CPIO_MAP_MODE, CPIO_MAP_PATH, CPIO_MAP_UID, FA_CREATE, FD_t, freeFi(), Header, headerFree(), headerIsEntry(), HFD_t, HGE_t, availableList_s::list, loadFi(), rpmTransactionSet_s::notify, rpmTransactionSet_s::notifyData, PSM_FINI, PSM_PKGINSTALL, PSM_PROCESS, PSM_t, psmStage(), rpmTransactionSet_s::rootDir, rpmBuildFileList(), rpmCallbackData, rpmCallbackFunction, rpmdb, RPMERR_NOSPEC, RPMERR_NOTSRPM, rpmError, RPMFILE_SPECFILE, rpmGenPath(), rpmInstallLoadMacros(), rpmRC, RPMRC_FAIL, RPMRC_OK, rpmReadPackageHeader(), RPMTAG_COOKIE, rpmTransactionSet, rpmtransAddPackage(), rpmtransCreateSet(), rpmtransFree(), stpcpy(), TFI_t, xcalloc(), xmalloc(), and xstrdup().

Referenced by rpmInstall(), and rpmInstallSource().

int rpmVersionCompare | ( | Header | first,
|  | Header | second
| ) |

Compare headers to determine which header is "newer".

Parameters:

  first | 1st header
  second | 2nd header

Returns:
  result of comparison

Definition at line 36 of file psm.c.

References Header, headerGetEntry(), int_32, RPMTAG_EPOCH, RPMTAG_RELEASE, RPMTAG_VERSION, and rpmvercmp().

Referenced by alAddPackage(), ensureOlder(), findUpgradePackages(), pkgCompareVer(), rpmInstall(), rpmtransAddPackage(), unmarkPackagesAlreadyInstalled(), and versionCompare().

int runImmedTriggers | ( | PSM_t | psm | ) | `[static]`

Run triggers from this header that are fired by headers in the database.

Parameters:

  psm | package state machine data

Returns:
  0 on success, 1 on error

Definition at line 1246 of file psm.c.

References alloca(), psm_s::fi, transactionFileInfo_s::h, handleOneTrigger(), Header, transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::hge, HGE_t, int_32, PSM_t, rpmTransactionSet_s::rpmdb, rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbInitIterator(), rpmdbNextIterator(), rpmRC, RPMRC_OK, RPMTAG_NAME, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERNAME, rpmTagType, rpmTransactionSet, TFI_t, and psm_s::ts.

Referenced by psmStage().

rpmRC runInstScript | ( | PSM_t | psm | ) | `[static]`

Retrieve and run scriptlet from header.

Parameters:

  psm | package state machine data

Returns:
  rpmRC return code

Definition at line 1046 of file psm.c.

References alloca(), psm_s::fi, transactionFileInfo_s::h, transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::hge, HGE_t, psm_s::progTag, PSM_t, RPM_STRING_TYPE, rpmRC, RPMRC_OK, rpmTagType, runScript(), psm_s::scriptArg, psm_s::scriptTag, tag2sln(), and TFI_t.

Referenced by psmStage().

int runScript | ( | PSM_t | psm,
|  | Header | h,
|  | const char * | sln,
|  | int | progArgc,
|  | const char ** | progArgv,
|  | const char * | script,
|  | int | arg1,
|  | int | arg2
| ) | `[static]`

Run scriptlet with args.

Run a script with an interpreter. If the interpreter is not specified, /bin/sh will be used. If the interpreter is /bin/sh, then the args from the header will be ignored, passing instead arg1 and arg2.

Parameters:

  psm | package state machine data
  h | header
  sln | name of scriptlet section
  progArgc | no. of args from header
  progArgv | args from header, progArgv[0] is the interpreter to use
  script | scriptlet from header
  arg1 | no. instances of package installed after scriptlet exec (-1 is no arg)
  arg2 | ditto, but for the target package

Returns:
  0 on success, 1 on error

Definition at line 825 of file psm.c.

References _, _free(), alloca(), rpmTransactionSet_s::chrootDone, doputenv(), errno, Fclose(), FD_t, fdDup(), fdLink, Ferror(), psm_s::fi, Fileno(), Fopen(), Fwrite(), Header, headerNVR(), transactionFileInfo_s::hfd, HFD_t, transactionFileInfo_s::hge, HGE_t, makeTempFile(), PSM_t, rpmTransactionSet_s::rootDir, RPMERR_SCRIPT, rpmError, rpmExpand(), rpmIsDebug, rpmIsVerbose, rpmRC, RPMRC_FAIL, RPMRC_OK, RPMTAG_INSTALLPREFIX, RPMTAG_INSTPREFIXES, rpmTagType, rpmTransactionSet, SCRIPT_PATH, rpmTransactionSet_s::scriptFd, TFI_t, psm_s::ts, URL_IS_PATH, URL_IS_UNKNOWN, and urlIsURL().

Referenced by handleOneTrigger(), and runInstScript().

int runTriggers | ( | PSM_t | psm | ) | `[static]`

Run trigger scripts in the database that are fired by this header.

Parameters:

  psm | package state machine data

Returns:
  0 on success, 1 on error

Definition at line 1209 of file psm.c.

References psm_s::countCorrection, psm_s::fi, transactionFileInfo_s::h, handleOneTrigger(), Header, transactionFileInfo_s::name, PSM_t, rpmTransactionSet_s::rpmdb, rpmdbCountPackages(), rpmdbFreeIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmRC, RPMRC_OK, RPMTAG_TRIGGERNAME, rpmTransactionSet, TFI_t, and psm_s::ts.

Referenced by psmStage().

const char* const tag2sln | ( | int | tag | ) | `[static]`

Return scriptlet name from tag.

Parameters:

  tag | scriptlet tag

Returns:
  name of scriptlet

Definition at line 794 of file psm.c.

References RPMTAG_POSTIN, RPMTAG_POSTUN, RPMTAG_PREIN, RPMTAG_PREUN, and RPMTAG_VERIFYSCRIPT.

Referenced by psmStage(), and runInstScript().

## Variable Documentation

char* SCRIPT_PATH`[static]`

Initial value:

            "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin"

Definition at line 786 of file psm.c.

Referenced by runScript().

struct tagMacro tagMacros[]`[static]`

Macros to be defined from per-header tag values.

Todo:
  Should other macros be added from header when installing a package?

Referenced by rpmInstallLoadMacros().