Transaction Set API.


Files

file  depends.c
file  psm.c
 Package state machine to handle a package from a transaction set.
file  rpmte.h
 Structures used for an "rpmte" transaction element.
file  rpmts.h
 Structures and prototypes used for an "rpmts" transaction set.
file  rpmvercmp.c
file  transaction.c

Functions

int rpmtsCheck (rpmts ts)
 Check that all dependencies can be resolved.
int rpmtsOrder (rpmts ts)
 Determine package order in a transaction set according to dependencies.
int rpmtsRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
 Process all package elements in a transaction set.
rpmts rpmtsUnlink (rpmts ts, const char *msg)
 Unreference a transaction instance.
rpmts rpmtsLink (rpmts ts, const char *msg)
 Reference a transaction set instance.
int rpmtsCloseDB (rpmts ts)
 Close the database used by the transaction.
int rpmtsOpenDB (rpmts ts, int dbmode)
 Open the database used by the transaction.
int rpmtsInitDB (rpmts ts, int dbmode)
 Initialize the database used by the transaction.
int rpmtsRebuildDB (rpmts ts)
 Rebuild the database used by the transaction.
int rpmtsVerifyDB (rpmts ts)
 Verify the database used by the transaction.
rpmdbMatchIterator rpmtsInitIterator (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
 Return transaction database iterator.
int rpmtsCloseSDB (rpmts ts)
 Close the database used by the transaction to solve dependencies.
int rpmtsOpenSDB (rpmts ts, int dbmode)
 Open the database used by the transaction to solve dependencies.
void rpmtsCleanDig (rpmts ts)
 Free signature verification data.
void rpmtsClean (rpmts ts)
 Free memory needed only for dependency checks and ordering.
void rpmtsEmpty (rpmts ts)
 Re-create an empty transaction set.
rpmts rpmtsFree (rpmts ts)
 Destroy transaction set, closing the database as well.
rpmVSFlags rpmtsVSFlags (rpmts ts)
 Get verify signatures flag(s).
rpmVSFlags rpmtsSetVSFlags (rpmts ts, rpmVSFlags vsflags)
 Set verify signatures flag(s).
int rpmtsUnorderedSuccessors (rpmts ts, int first)
 Set index of 1st element of successors.
const char * rpmtsRootDir (rpmts ts)
 Get transaction rootDir, i.e.
void rpmtsSetRootDir (rpmts ts, const char *rootDir)
 Set transaction rootDir, i.e.
const char * rpmtsCurrDir (rpmts ts)
 Get transaction currDir, i.e.
void rpmtsSetCurrDir (rpmts ts, const char *currDir)
 Set transaction currDir, i.e.
FD_t rpmtsScriptFd (rpmts ts)
 Get transaction script file handle, i.e.
void rpmtsSetScriptFd (rpmts ts, FD_t scriptFd)
 Set transaction script file handle, i.e.
int rpmtsSELinuxEnabled (rpmts ts)
 Get selinuxEnabled flag, i.e.
int rpmtsChrootDone (rpmts ts)
 Get chrootDone flag, i.e.
int rpmtsSetChrootDone (rpmts ts, int chrootDone)
 Set chrootDone flag, i.e.
rpmsx rpmtsREContext (const rpmts ts)
 Get file security context patterns.
int rpmtsSetREContext (rpmts ts, rpmsx sx)
 Get file security context patterns.
int_32 rpmtsGetTid (rpmts ts)
 Get transaction id, i.e.
int_32 rpmtsSetTid (rpmts ts, int_32 tid)
 Set transaction id, i.e.
int_32 rpmtsSigtag (const rpmts ts)
 Get signature tag.
int_32 rpmtsSigtype (const rpmts ts)
 Get signature tag type.
const void * rpmtsSig (const rpmts ts)
 Get signature tag data, i.e.
int_32 rpmtsSiglen (const rpmts ts)
 Get signature tag data length, i.e.
int rpmtsSetSig (rpmts ts, int_32 sigtag, int_32 sigtype, const void *sig, int_32 siglen)
 Set signature tag info, i.e.
pgpDig rpmtsDig (rpmts ts)
 Get OpenPGP packet parameters, i.e.
pgpDigParams rpmtsSignature (const rpmts ts)
 Get OpenPGP signature constants.
pgpDigParams rpmtsPubkey (const rpmts ts)
 Get OpenPGP pubkey constants.
rpmdb rpmtsGetRdb (rpmts ts)
 Get transaction set database handle.
int rpmtsInitDSI (const rpmts ts)
 Initialize disk space info for each and every mounted file systems.
void rpmtsUpdateDSI (const rpmts ts, dev_t dev, uint_32 fileSize, uint_32 prevSize, uint_32 fixupSize, fileAction action)
 Update disk space info for a file.
void rpmtsCheckDSIProblems (const rpmts ts, const rpmte te)
 Check a transaction element for disk space problems.
rpmprobFilterFlags rpmtsFilterFlags (rpmts ts)
 Get problem ignore bit mask, i.e.
rpmtransFlags rpmtsFlags (rpmts ts)
 Get transaction flags, i.e.
rpmtransFlags rpmtsSetFlags (rpmts ts, rpmtransFlags transFlags)
 Set transaction flags, i.e.
Spec rpmtsSpec (rpmts ts)
 Get spec control structure from transaction set.
Spec rpmtsSetSpec (rpmts ts, Spec spec)
 Set a spec control structure in transaction set.
rpmte rpmtsRelocateElement (rpmts ts)
 Get current relocate transaction element.
rpmte rpmtsSetRelocateElement (rpmts ts, rpmte relocateElement)
 Set current relocate transaction element.
int rpmtsSetNotifyCallback (rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
 Set transaction notify callback function and argument.
rpmts rpmtsCreate (void)
 Create an empty transaction set.
int rpmtsAddInstallElement (rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)
 Add package to be installed to transaction set.
int rpmtsAddEraseElement (rpmts ts, Header h, int dboffset)
 Add package to be erased to transaction set.
int rpmtsGetKeys (rpmts ts, fnpyKey **ep, int *nep)
 Retrieve keys from ordered transaction set.

Function Documentation

int rpmtsAddEraseElement ( rpmts  ts,
Header  h,
int  dboffset 
)

Add package to be erased to transaction set.

Parameters:
ts transaction set
h header
dboffset rpm database instance
Returns:
0 on success

Definition at line 393 of file depends.c.

References removePackage(), and RPMAL_NOMATCH.

Referenced by _rpmtsAddRollbackElement(), rpmErase(), rpmRollback(), and rpmts_AddErase().

int rpmtsAddInstallElement ( rpmts  ts,
Header  h,
const fnpyKey  key,
int  upgrade,
rpmRelocation relocs 
)

Add package to be installed to transaction set.

The transaction set is checked for duplicate package names. If found, the package with the "newest" EVR will be replaced.

Parameters:
ts transaction set
h header
key package retrieval key (e.g. file name)
upgrade is package being upgraded?
relocs package file relocations
Returns:
0 on success, 1 on I/O error, 2 needs capabilities

Definition at line 127 of file depends.c.

References _, _free(), _rpmds_nopromote, headerCheckPayloadFormat(), headerGetEntryMinMemory(), headerIsEntry(), hGetColor(), hGetNEVRA(), removePackage(), RPMAL_NOMATCH, rpmalAdd(), rpmcliPackagesTotal, rpmdbFreeIterator(), rpmdbGetIteratorOffset(), rpmdbNextIterator(), rpmdbPruneIterator(), rpmdsAnyMatchesDep(), rpmdsColor(), rpmdsCompare(), rpmdsDNEVR(), rpmdsEVR(), rpmdsFree(), rpmdsInit(), rpmdsLink, rpmdsN(), rpmdsNext(), rpmdsThis(), rpmIsVerbose, RPMMESS_DEBUG, RPMMESS_WARNING, rpmMessage, RPMRC_OK, RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMTAG_ARCH, RPMTAG_BASENAMES, RPMTAG_NAME, RPMTAG_OBSOLETENAME, RPMTAG_OS, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_SOURCEPACKAGE, rpmteA(), rpmteAddedKey(), rpmteDS(), rpmteFI(), rpmteFree(), rpmteIsSource(), rpmteKey(), rpmteN(), rpmteNew(), rpmteO(), rpmteSetAddedKey(), rpmteSetHeader(), rpmteType(), rpmtsColor(), rpmtsGetRdb(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsInitIterator(), rpmtsOpenDB(), rpmVersionCompare(), TR_ADDED, TR_REMOVED, and xrealloc().

Referenced by _rpmtsAddRollbackElement(), checkSpec(), rpmgiNext(), rpmGraph(), rpmInstall(), rpmInstallSourcePackage(), rpmRollback(), rpmts_AddInstall(), rpmtsSolve(), and verifyDependencies().

int rpmtsCheck ( rpmts  ts  ) 

Check that all dependencies can be resolved.

Parameters:
ts transaction set
Returns:
0 on success

Definition at line 1672 of file depends.c.

References _cacheDependsRC, checkDependentConflicts(), checkDependentPackages(), checkPackageDeps(), rpmalMakeIndex(), rpmdbCloseDBI(), rpmdbFreeIterator(), RPMDBI_DEPENDS, rpmdsInit(), rpmdsN(), rpmdsNext(), rpmfiFN(), rpmfiInit(), rpmfiNext(), RPMMESS_DEBUG, rpmMessage, rpmpsCreate(), rpmpsFree(), rpmswEnter(), rpmswExit(), RPMTAG_BASENAMES, RPMTAG_CONFLICTNAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmteA(), rpmteColor(), rpmteDS(), rpmteFI(), rpmteN(), rpmteNEVR(), rpmteNEVRA(), rpmteO(), RPMTS_OP_CHECK, rpmtsCloseDB(), rpmtsColor(), rpmtsGetRdb(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsOp(), rpmtsOpenDB(), TR_ADDED, and TR_REMOVED.

Referenced by _rpmtsRollback(), checkSpec(), rpmErase(), rpmgiNext(), rpmGraph(), rpmInstall(), rpmRollback(), rpmts_Check(), and verifyDependencies().

void rpmtsCheckDSIProblems ( const rpmts  ts,
const rpmte  te 
)

Check a transaction element for disk space problems.

Parameters:
ts transaction set
te current transaction element

Definition at line 1337 of file rpmts.c.

References rpmfiFC(), RPMPROB_DISKNODES, RPMPROB_DISKSPACE, rpmpsAppend(), RPMTAG_BASENAMES, rpmteFI(), rpmteKey(), rpmteNEVR(), and rpmtsProblems().

Referenced by rpmtsRun().

int rpmtsChrootDone ( rpmts  ts  ) 

Get chrootDone flag, i.e.

has chroot(2) been performed?

Parameters:
ts transaction set
Returns:
chrootDone flag

Definition at line 1070 of file rpmts.c.

Referenced by rpmpsmStage(), rpmtsRun(), and runScript().

void rpmtsClean ( rpmts  ts  ) 

Free memory needed only for dependency checks and ordering.

Parameters:
ts transaction set

Definition at line 760 of file rpmts.c.

References _free(), rpmalFree(), rpmpsFree(), rpmteCleanDS(), rpmtsCleanDig(), rpmtsiFree, rpmtsiInit, and rpmtsiNext().

Referenced by checkSpec(), rpmcliImportPubkeys(), rpmErase(), rpmInstall(), rpmRollback(), rpmts_Clean(), rpmtsEmpty(), and rpmtsOrder().

void rpmtsCleanDig ( rpmts  ts  ) 

Free signature verification data.

Parameters:
ts transaction set

Definition at line 754 of file rpmts.c.

References headerFreeData(), and pgpFreeDig().

Referenced by rpmReadPackageFile(), rpmtsClean(), and rpmVerifySignatures().

int rpmtsCloseDB ( rpmts  ts  ) 

Close the database used by the transaction.

Parameters:
ts transaction set
Returns:
0 on success

Definition at line 156 of file rpmts.c.

References rpmdbClose(), rpmswAdd(), RPMTS_OP_DBDEL, RPMTS_OP_DBGET, RPMTS_OP_DBPUT, and rpmtsOp().

Referenced by ftsCacheUpdate(), rpmgiNext(), rpmts_CloseDB(), rpmts_InitDB(), rpmtsCheck(), rpmtsFree(), and rpmtsOpenDB().

int rpmtsCloseSDB ( rpmts  ts  ) 

Close the database used by the transaction to solve dependencies.

Parameters:
ts transaction set
Returns:
0 on success

Definition at line 486 of file rpmts.c.

References rpmdbClose(), rpmswAdd(), RPMTS_OP_DBDEL, RPMTS_OP_DBGET, RPMTS_OP_DBPUT, and rpmtsOp().

Referenced by rpmtsFree().

rpmts rpmtsCreate ( void   ) 

Create an empty transaction set.

Returns:
new transaction set

Definition at line 1534 of file rpmts.c.

References is_selinux_enabled, rpmExpandNumeric(), rpmswEnter(), RPMTRANS_TYPE_NORMAL, RPMTS_OP_TOTAL, rpmtsLink, rpmtsOp(), rpmtsSolve(), and xcalloc().

Referenced by cpio_doio(), main(), readRPM(), rpmts_Create(), rpmts_init(), and rpmtsRun().

const char* rpmtsCurrDir ( rpmts  ts  ) 

Get transaction currDir, i.e.

current directory before chroot(2).

Parameters:
ts transaction set
Returns:
transaction currDir

Definition at line 1021 of file rpmts.c.

Referenced by rpmpsmStage(), and rpmtsRun().

pgpDig rpmtsDig ( rpmts  ts  ) 

Get OpenPGP packet parameters, i.e.

signature/pubkey constants.

Parameters:
ts transaction set
Returns:
signature/pubkey constants.

Definition at line 1171 of file rpmts.c.

References pgpNewDig().

Referenced by rpmReadPackageFile(), rpmtsFindPubkey(), rpmtsPubkey(), rpmtsSignature(), rpmtsStashKeyid(), rpmVerifySignature(), rpmVerifySignatures(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), verifySHA1Signature(), and verifySizeSignature().

void rpmtsEmpty ( rpmts  ts  ) 

Re-create an empty transaction set.

Parameters:
ts transaction set

Definition at line 784 of file rpmts.c.

References rpmteFree(), rpmtsClean(), rpmtsiFree, rpmtsiInit, and rpmtsiNext().

Referenced by rpmcliArgIter(), rpmcliVerify(), rpmErase(), rpmRollback(), rpmtsFree(), and verifyDependencies().

rpmprobFilterFlags rpmtsFilterFlags ( rpmts  ts  ) 

Get problem ignore bit mask, i.e.

bits to filter encountered problems.

Parameters:
ts transaction set
Returns:
ignore bit mask

Definition at line 1411 of file rpmts.c.

Referenced by handleOverlappedFiles(), relocateFileList(), rpmtsInitDSI(), and rpmtsRun().

rpmtransFlags rpmtsFlags ( rpmts  ts  ) 

Get transaction flags, i.e.

bits that control rpmtsRun().

Parameters:
ts transaction set
Returns:
transaction flags

Definition at line 1416 of file rpmts.c.

Referenced by fsmMapAttrs(), fsmMapFContext(), fsmMkdirs(), fsmStage(), handleInstInstalledFiles(), ignoreDep(), rpmErase(), rpmInstall(), rpmpsmStage(), rpmtsOrder(), rpmtsRun(), skipFiles(), unsatisfiedDepend(), and XrpmtsiInit().

rpmts rpmtsFree ( rpmts  ts  ) 

Destroy transaction set, closing the database as well.

Parameters:
ts transaction set
Returns:
NULL always

Definition at line 850 of file rpmts.c.

References _free(), _rpmts_stats, fdFree, rpmalFree(), rpmsxFree(), rpmtsCloseDB(), rpmtsCloseSDB(), rpmtsEmpty(), rpmtsPrintStats(), rpmtsScoreFree(), and rpmtsUnlink.

Referenced by _rpmtsRollback(), cpio_doio(), main(), mapFreeIterator(), readRPM(), rpmgiFree(), rpmpsmFree(), rpmts_dealloc(), rpmts_free(), rpmtsRun(), and XrpmtsiFree().

int rpmtsGetKeys ( rpmts  ts,
fnpyKey **  ep,
int *  nep 
)

Retrieve keys from ordered transaction set.

Todo:
Removed packages have no keys, returned as interleaved NULL pointers.
Parameters:
ts transaction set
Return values:
ep address of returned element array pointer (or NULL)
nep address of no. of returned elements (or NULL)
Returns:
0 always

Definition at line 1504 of file rpmts.c.

References rpmteKey(), rpmteType(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), TR_ADDED, TR_REMOVED, and xmalloc().

Referenced by rpmts_GetKeys().

rpmdb rpmtsGetRdb ( rpmts  ts  ) 

Get transaction set database handle.

Parameters:
ts transaction set
Returns:
transaction database handle

Definition at line 1200 of file rpmts.c.

Referenced by checkDependentConflicts(), ftsCacheUpdate(), handleOneTrigger(), rpmcliImportPubkey(), rpmpsmStage(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsRun(), runTriggers(), and unsatisfiedDepend().

int_32 rpmtsGetTid ( rpmts  ts  ) 

Get transaction id, i.e.

transaction time stamp.

Parameters:
ts transaction set
Returns:
transaction id

Definition at line 1104 of file rpmts.c.

Referenced by _rpmtsRollback(), fsmSetup(), ftsCacheUpdate(), getRepackageHeaderFromTE(), rpmcliImportPubkey(), and rpmpsmStage().

int rpmtsInitDB ( rpmts  ts,
int  dbmode 
)

Initialize the database used by the transaction.

Deprecated:
An explicit rpmdbInit() is almost never needed.
Parameters:
ts transaction set
dbmode O_RDONLY or O_RDWR
Returns:
0 on success

Definition at line 193 of file rpmts.c.

References rpmdbInit().

Referenced by main(), and rpmts_InitDB().

int rpmtsInitDSI ( const rpmts  ts  ) 

Initialize disk space info for each and every mounted file systems.

Parameters:
ts transaction set
Returns:
0 on success

Definition at line 1211 of file rpmts.c.

References _, _free(), rpmGetFilesystemList(), RPMMESS_DEBUG, rpmMessage, RPMPROB_FILTER_DISKSPACE, rpmtsFilterFlags(), STATFS_IN_SYS_STATVFS, and xcalloc().

Referenced by rpmtsRun().

rpmdbMatchIterator rpmtsInitIterator ( const rpmts  ts,
rpmTag  rpmtag,
const void *  keyp,
size_t  keylen 
)

Return transaction database iterator.

Parameters:
ts transaction set
rpmtag rpm tag
keyp key data (NULL for sequential access)
keylen key data length (0 will use strlen(keyp))
Returns:
NULL on failure

Definition at line 256 of file rpmts.c.

References _, alloca(), headerCheck(), isArch(), RPMDBI_LABEL, rpmdbInitIterator(), rpmdbSetHdrChk(), rpmdbSetIteratorRE(), RPMERR_QFMT, rpmError, RPMMIRE_DEFAULT, RPMTAG_ARCH, rpmtsOpenDB(), RPMVSF_NOHDRCHK, and xisdigit().

Referenced by _rpmtsAddRollbackElement(), checkDependentConflicts(), checkDependentPackages(), ftsCacheUpdate(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), markReplacedFiles(), rpmErase(), rpmgiInitFilter(), rpmInstall(), rpmpsmStage(), rpmQueryVerify(), rpmts_AddErase(), rpmts_Match(), rpmtsAddInstallElement(), rpmtsFindPubkey(), rpmtsRun(), runImmedTriggers(), runTriggers(), and unsatisfiedDepend().

rpmts rpmtsLink ( rpmts  ts,
const char *  msg 
)

Reference a transaction set instance.

Parameters:
ts transaction set
msg 
Returns:
new transaction set reference

int rpmtsOpenDB ( rpmts  ts,
int  dbmode 
)

Open the database used by the transaction.

Parameters:
ts transaction set
dbmode O_RDONLY or O_RDWR
Returns:
0 on success

Definition at line 170 of file rpmts.c.

References _, _free(), rpmdbOpen(), rpmGetPath(), RPMMESS_ERROR, rpmMessage, and rpmtsCloseDB().

Referenced by ftsCacheUpdate(), rpmcliImportPubkey(), rpmts_Match(), rpmts_OpenDB(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsInitIterator(), and rpmtsRun().

int rpmtsOpenSDB ( rpmts  ts,
int  dbmode 
)

Open the database used by the transaction to solve dependencies.

Parameters:
ts transaction set
dbmode O_RDONLY or O_RDWR
Returns:
0 on success

Definition at line 500 of file rpmts.c.

References _, _free(), addMacro(), delMacro(), RMIL_DEFAULT, rpmdbOpen(), rpmExpandNumeric(), rpmGetPath(), RPMMESS_WARNING, and rpmMessage.

Referenced by rpmtsSolve().

int rpmtsOrder ( rpmts  ts  ) 

Determine package order in a transaction set according to dependencies.

Order packages, returning error if circular dependencies cannot be eliminated by removing Requires's from the loop(s). Only dependencies from added or removed packages are used to determine ordering using a topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify that all dependencies can be resolved.

The final order ends up as installed packages followed by removed packages, with packages removed for upgrades immediately following the new package to be installed.

Parameters:
ts transaction set
Returns:
no. of (added) packages that could not be ordered

Definition at line 1211 of file depends.c.

References _, _free(), addQ(), addRelation(), alloca(), freeBadDeps(), isErasePreReq, isInstallPreReq, isLegacyPreReq, markLoop(), orderListIndexCmp(), orderListIndex_s::orIndex, orderListIndex_s::pkgKey, RPMAL_NOMATCH, rpmalMakeIndex(), rpmdsFlags(), rpmdsInit(), rpmdsNext(), RPMMESS_DEBUG, RPMMESS_ERROR, RPMMESS_WARNING, rpmMessage, rpmswEnter(), rpmswExit(), RPMTAG_REQUIRENAME, rpmteAddedKey(), rpmteDegree(), rpmteDependsOnKey(), rpmteDepth(), rpmteDS(), rpmteFreeTSI(), rpmteNEVRA(), rpmteNewTSI(), rpmteNpreds(), rpmtePkgFileSize(), rpmteSetBreadth(), rpmteSetDegree(), rpmteSetDepth(), rpmteSetNpreds(), rpmteSetParent(), rpmteSetTree(), rpmteTree(), rpmteTSI(), rpmteType(), RPMTRANS_FLAG_ANACONDA, RPMTRANS_FLAG_DEPLOOPS, RPMTS_OP_ORDER, rpmtsClean(), rpmtsFlags(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsiOc(), rpmtsOp(), rpmtsPrefColor(), rpmtsUnorderedSuccessors(), stpcpy(), TR_ADDED, TR_REMOVED, xcalloc(), and zapRelation().

Referenced by _rpmtsRollback(), rpmErase(), rpmgiNext(), rpmGraph(), rpmInstall(), rpmRollback(), and rpmts_Order().

pgpDigParams rpmtsPubkey ( const rpmts  ts  ) 

Get OpenPGP pubkey constants.

Parameters:
ts transaction set
Returns:
pubkey constants.

Definition at line 1191 of file rpmts.c.

References pgpDig_s::pubkey, and rpmtsDig().

Referenced by rpmtsFindPubkey().

int rpmtsRebuildDB ( rpmts  ts  ) 

Rebuild the database used by the transaction.

Parameters:
ts transaction set
Returns:
0 on success

Definition at line 203 of file rpmts.c.

References headerCheck(), rpmdbRebuild(), and RPMVSF_NOHDRCHK.

Referenced by main(), and rpmts_RebuildDB().

rpmsx rpmtsREContext ( const rpmts  ts  ) 

Get file security context patterns.

Parameters:
ts transaction set
Returns:
file security context patterns

Definition at line 1087 of file rpmts.c.

References rpmsxLink.

rpmte rpmtsRelocateElement ( rpmts  ts  ) 

Get current relocate transaction element.

Parameters:
ts transaction set
Returns:
current relocate transaction element

Definition at line 1447 of file rpmts.c.

Referenced by relocateFileList().

const char* rpmtsRootDir ( rpmts  ts  ) 

Get transaction rootDir, i.e.

path to chroot(2).

Parameters:
ts transaction set
Returns:
transaction rootDir

Definition at line 968 of file rpmts.c.

References URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by rpmInstall(), rpmpsmStage(), rpmtsRun(), rpmVerifyFile(), and runScript().

int rpmtsRun ( rpmts  ts,
rpmps  okProbs,
rpmprobFilterFlags  ignoreSet 
)

Process all package elements in a transaction set.

Before calling rpmtsRun be sure to have:

Additionally, though not required you may want to:

Parameters:
ts transaction set
okProbs previously known problems (or NULL)
ignoreSet bits to filter problem types
Returns:
0 on success, -1 on error, >0 with newProbs set

Definition at line 1406 of file transaction.c.

References _, _free(), _noTransScripts, _noTransTriggers, _rpmtsAddRollbackElement(), _rpmtsRollback(), _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, archOkay(), CPIO_ALL_HARDLINKS, CPIO_MAP_ABSOLUTE, CPIO_MAP_ADDDOT, CPIO_SBIT_CHECK, currentDirectory(), dbiFreeIndexSet(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiIndexSetCount(), ensureOlder(), rpmpsm_s::fi, fpCacheCreate(), fpCacheFree(), fpEqual(), fpHashFunction(), fpLookupList(), handleInstInstalledFiles(), handleOverlappedFiles(), handleRmvdInstalledFiles(), headerFree(), htAddEntry(), htCreate(), htFree(), NOTIFY, osOkay(), rpmpsm_s::progTag, PSM_PKGERASE, PSM_PKGINSTALL, PSM_PKGSAVE, PSM_SCRIPT, RPMCALLBACK_INST_CLOSE_FILE, RPMCALLBACK_INST_OPEN_FILE, RPMCALLBACK_REPACKAGE_PROGRESS, RPMCALLBACK_REPACKAGE_START, RPMCALLBACK_REPACKAGE_STOP, RPMCALLBACK_TRANS_PROGRESS, RPMCALLBACK_TRANS_START, RPMCALLBACK_TRANS_STOP, rpmdbCheckSignals(), rpmdbFindFpList(), rpmdbFreeIterator(), rpmdbNextIterator(), rpmdbOpenAll(), rpmdbSetIteratorRE(), rpmdbSync(), rpmExpandNumeric(), rpmfiFC(), rpmfiFMode(), rpmfiFree(), rpmfiInit(), rpmfiLink, rpmfiNew(), rpmfiNext(), rpmfiSetFX(), RPMMESS_DEBUG, RPMMESS_ERROR, rpmMessage, RPMMIRE_STRCMP, RPMPROB_BADARCH, RPMPROB_BADOS, RPMPROB_FILTER_IGNOREARCH, RPMPROB_FILTER_IGNOREOS, RPMPROB_FILTER_OLDPACKAGE, RPMPROB_FILTER_REPLACEOLDFILES, RPMPROB_FILTER_REPLACEPKG, RPMPROB_PKG_INSTALLED, rpmpsAppend(), rpmpsCreate(), rpmpsFree(), rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), rpmpsTrim(), RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), rpmswEnter(), rpmswExit(), RPMTAG_ARCH, RPMTAG_BASENAMES, RPMTAG_EPOCH, RPMTAG_NAME, RPMTAG_OS, RPMTAG_POSTTRANS, RPMTAG_POSTTRANSPROG, RPMTAG_PRETRANS, RPMTAG_PRETRANSPROG, RPMTAG_RELEASE, RPMTAG_VERSION, rpmteA(), rpmteAddedKey(), rpmteColor(), rpmteDBOffset(), rpmteDependsOnKey(), rpmteE(), rpmteFd(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteO(), rpmteR(), rpmteType(), rpmteV(), RPMTRANS_FLAG_BUILD_PROBS, RPMTRANS_FLAG_DIRSTASH, RPMTRANS_FLAG_JUSTDB, RPMTRANS_FLAG_NOSCRIPTS, RPMTRANS_FLAG_NOTRIGGERS, RPMTRANS_FLAG_REPACKAGE, RPMTRANS_FLAG_TEST, RPMTRANS_TYPE_AUTOROLLBACK, RPMTRANS_TYPE_ROLLBACK, RPMTS_OP_ERASE, RPMTS_OP_FINGERPRINT, RPMTS_OP_INSTALL, RPMTS_OP_REPACKAGE, rpmtsCheckDSIProblems(), rpmtsChrootDone(), rpmtsColor(), rpmtsCreate(), rpmtsCurrDir(), rpmtsFilterFlags(), rpmtsFlags(), rpmtsFree(), rpmtsGetRdb(), rpmtsGetType(), rpmtsiFi(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsInitDSI(), rpmtsInitIterator(), rpmtsiOc(), rpmtsNElements(), rpmtsOp(), rpmtsOpenDB(), rpmtsProblems(), rpmtsRootDir(), rpmtsScoreInit(), rpmtsSetChrootDone(), rpmtsSetCurrDir(), rpmtsSetFlags(), rpmtsSetNotifyCallback(), rpmtsSetRelocateElement(), rpmtsSetRootDir(), rpmtsSetTid(), rpmtsSetType(), rpmtsSetVSFlags(), rpmtsUnorderedSuccessors(), rpmtsVSFlags(), RPMVSF_NEEDPAYLOAD, RPMVSF_NOHDRCHK, rpmpsm_s::scriptTag, sharedCmp(), skipFiles(), TR_ADDED, TR_REMOVED, rpmpsm_s::unorderedSuccessor, vsflags, xcalloc(), XFA_SKIPPING, and xmalloc().

Referenced by _rpmtsRollback(), rpmErase(), rpmInstall(), rpmRollback(), and rpmts_Run().

FD_t rpmtsScriptFd ( rpmts  ts  ) 

Get transaction script file handle, i.e.

stdout/stderr on scriptlet execution

Parameters:
ts transaction set
Returns:
transaction script file handle

Definition at line 1039 of file rpmts.c.

Referenced by runScript().

int rpmtsSELinuxEnabled ( rpmts  ts  ) 

Get selinuxEnabled flag, i.e.

is SE linux enabled?

Parameters:
ts transaction set
Returns:
selinuxEnabled flag

Definition at line 1065 of file rpmts.c.

Referenced by fsmMapFContext(), fsmMkdirs(), rpmInstall(), rpmts_Run(), rpmVerifyFile(), runScript(), and verifyHeader().

int rpmtsSetChrootDone ( rpmts  ts,
int  chrootDone 
)

Set chrootDone flag, i.e.

has chroot(2) been performed?

Parameters:
ts transaction set
chrootDone new chrootDone flag
Returns:
previous chrootDone flag

Definition at line 1075 of file rpmts.c.

Referenced by rpmpsmStage(), and rpmtsRun().

void rpmtsSetCurrDir ( rpmts  ts,
const char *  currDir 
)

Set transaction currDir, i.e.

current directory before chroot(2).

Parameters:
ts transaction set
currDir new transaction currDir (or NULL)

Definition at line 1030 of file rpmts.c.

References _free(), and xstrdup().

Referenced by rpmtsRun().

rpmtransFlags rpmtsSetFlags ( rpmts  ts,
rpmtransFlags  transFlags 
)

Set transaction flags, i.e.

bits that control rpmtsRun().

Parameters:
ts transaction set
transFlags new transaction flags
Returns:
previous transaction flags

Definition at line 1421 of file rpmts.c.

Referenced by rpmErase(), rpmInstall(), rpmRollback(), rpmts_Rollback(), rpmts_SetFlags(), and rpmtsRun().

int rpmtsSetNotifyCallback ( rpmts  ts,
rpmCallbackFunction  notify,
rpmCallbackData  notifyData 
)

Set transaction notify callback function and argument.

Warning:
This call must be made before rpmtsRun() for install/upgrade/freshen to function correctly.
Parameters:
ts transaction set
notify progress callback
notifyData progress callback private data
Returns:
0 on success

Definition at line 1494 of file rpmts.c.

Referenced by rpmErase(), rpmInstall(), rpmRollback(), rpmts_Run(), and rpmtsRun().

int rpmtsSetREContext ( rpmts  ts,
rpmsx  sx 
)

Get file security context patterns.

Parameters:
ts transaction set
sx security context patterns
Returns:
0 on success

Definition at line 1092 of file rpmts.c.

References rpmsxFree(), and rpmsxLink.

rpmte rpmtsSetRelocateElement ( rpmts  ts,
rpmte  relocateElement 
)

Set current relocate transaction element.

Parameters:
ts transaction set
relocateElement new relocate transaction element
Returns:
previous relocate transaction element

Definition at line 1454 of file rpmts.c.

Referenced by addTE(), and rpmtsRun().

void rpmtsSetRootDir ( rpmts  ts,
const char *  rootDir 
)

Set transaction rootDir, i.e.

path to chroot(2).

Parameters:
ts transaction set
rootDir new transaction rootDir (or NULL)

Definition at line 993 of file rpmts.c.

References _free(), alloca(), stpcpy(), and xstrdup().

Referenced by main(), rpmts_Create(), rpmts_init(), and rpmtsRun().

void rpmtsSetScriptFd ( rpmts  ts,
FD_t  scriptFd 
)

Set transaction script file handle, i.e.

stdout/stderr on scriptlet execution

Parameters:
ts transaction set
scriptFd new script file handle (or NULL)

Definition at line 1050 of file rpmts.c.

References fdFree, and fdLink.

Referenced by rpmts_setattro(), and rpmVerifyScript().

int rpmtsSetSig ( rpmts  ts,
int_32  sigtag,
int_32  sigtype,
const void *  sig,
int_32  siglen 
)

Set signature tag info, i.e.

from header.

Parameters:
ts transaction set
sigtag signature tag
sigtype signature tag type
sig signature tag data
siglen signature tag data length
Returns:
0 always

Definition at line 1155 of file rpmts.c.

References headerFreeData().

Referenced by rpmReadPackageFile(), and rpmVerifySignatures().

Spec rpmtsSetSpec ( rpmts  ts,
Spec  spec 
)

Set a spec control structure in transaction set.

Parameters:
ts transaction set
spec new spec control structure
Returns:
previous spec control structure

Definition at line 1438 of file rpmts.c.

Referenced by buildForTarget(), parseSpec(), and rpmspecQuery().

int_32 rpmtsSetTid ( rpmts  ts,
int_32  tid 
)

Set transaction id, i.e.

transaction time stamp.

Parameters:
ts transaction set
tid new transaction id
Returns:
previous transaction id

Definition at line 1113 of file rpmts.c.

Referenced by main(), and rpmtsRun().

rpmVSFlags rpmtsSetVSFlags ( rpmts  ts,
rpmVSFlags  vsflags 
)

Set verify signatures flag(s).

Parameters:
ts transaction set
vsflags new verify signatures flags
Returns:
previous value

Definition at line 917 of file rpmts.c.

Referenced by build(), main(), rpmcliQuery(), rpmcliVerify(), rpmErase(), rpmGraph(), rpmInstall(), rpmInstallSource(), rpmRollback(), rpmts_Create(), rpmts_init(), rpmts_SetVSFlags(), and rpmtsRun().

const void* rpmtsSig ( const rpmts  ts  ) 

Get signature tag data, i.e.

from header.

Parameters:
ts transaction set
Returns:
signature tag data

Definition at line 1139 of file rpmts.c.

Referenced by rpmtsFindPubkey(), rpmtsStashKeyid(), rpmVerifySignature(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), verifySHA1Signature(), and verifySizeSignature().

int_32 rpmtsSiglen ( const rpmts  ts  ) 

Get signature tag data length, i.e.

no. of bytes of data.

Parameters:
ts transaction set
Returns:
signature tag data length

Definition at line 1147 of file rpmts.c.

Referenced by rpmVerifySignature(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), and verifySHA1Signature().

pgpDigParams rpmtsSignature ( const rpmts  ts  ) 

Get OpenPGP signature constants.

Parameters:
ts transaction set
Returns:
signature constants.

Definition at line 1182 of file rpmts.c.

References rpmtsDig(), and pgpDig_s::signature.

Referenced by rpmtsFindPubkey(), rpmtsStashKeyid(), rpmVerifySignatures(), verifyDSASignature(), and verifyRSASignature().

int_32 rpmtsSigtag ( const rpmts  ts  ) 

Get signature tag.

Parameters:
ts transaction set
Returns:
signature tag

Definition at line 1123 of file rpmts.c.

Referenced by rpmVerifySignature(), verifyDSASignature(), and verifyRSASignature().

int_32 rpmtsSigtype ( const rpmts  ts  ) 

Get signature tag type.

Parameters:
ts transaction set
Returns:
signature tag type

Definition at line 1131 of file rpmts.c.

Spec rpmtsSpec ( rpmts  ts  ) 

Get spec control structure from transaction set.

Parameters:
ts transaction set
Returns:
spec control structure

Definition at line 1431 of file rpmts.c.

Referenced by spec_Parse().

rpmts rpmtsUnlink ( rpmts  ts,
const char *  msg 
)

Unreference a transaction instance.

Parameters:
ts transaction set
msg 
Returns:
NULL always

int rpmtsUnorderedSuccessors ( rpmts  ts,
int  first 
)

Set index of 1st element of successors.

Parameters:
ts transaction set
first new index of 1st element of successors
Returns:
previous value

Definition at line 957 of file rpmts.c.

Referenced by rpmtsOrder(), and rpmtsRun().

void rpmtsUpdateDSI ( const rpmts  ts,
dev_t  dev,
uint_32  fileSize,
uint_32  prevSize,
uint_32  fixupSize,
fileAction  action 
)

Update disk space info for a file.

Parameters:
ts transaction set
dev mount point device
fileSize file size
prevSize previous file size (if upgrading)
fixupSize size difference (if
action file disposition

Definition at line 1287 of file rpmts.c.

References FA_ALTNAME, FA_BACKUP, FA_CREATE, FA_ERASE, and FA_SAVE.

Referenced by handleOverlappedFiles().

int rpmtsVerifyDB ( rpmts  ts  ) 

Verify the database used by the transaction.

Parameters:
ts transaction set
Returns:
0 on success

Definition at line 216 of file rpmts.c.

References rpmdbVerify().

Referenced by main(), and rpmts_VerifyDB().

rpmVSFlags rpmtsVSFlags ( rpmts  ts  ) 

Get verify signatures flag(s).

Parameters:
ts transaction set
Returns:
verify signatures flags

Definition at line 909 of file rpmts.c.

References vsflags.

Referenced by headerCheck(), rpmInstallSource(), rpmpsmStage(), rpmReadPackageFile(), and rpmtsRun().


Generated on Fri Oct 12 08:44:57 2007 for rpm by  doxygen 1.5.2