#include "system.h"
#include "rpmio_internal.h"
#include <rpmlib.h>
#include <rpmmacro.h>
#include "rpmdb.h"
#include "rpmal.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmlock.h"
#include "rpmte.h"
#include "rpmts.h"
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_INTERNAL |
Functions | |
char * | hGetNEVR (Header h, const char **np) |
Return (malloc'd) header name-version-release string. | |
char * | hGetNEVRA (Header h, const char **np) |
Return (malloc'd) header name-version-release.arch string. | |
uint_32 | hGetColor (Header h) |
Return header color. | |
rpmts | XrpmtsUnlink (rpmts ts, const char *msg, const char *fn, unsigned ln) |
rpmts | XrpmtsLink (rpmts ts, const char *msg, const char *fn, unsigned ln) |
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. | |
static int | isArch (const char *arch) |
rpmdbMatchIterator | rpmtsInitIterator (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen) |
Return transaction database iterator. | |
rpmRC | rpmtsFindPubkey (rpmts ts) |
Retrieve pubkey from rpm database. | |
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. | |
static int | sugcmp (const void *a, const void *b) |
Compare suggested package resolutions (qsort/bsearch). | |
int | rpmtsSolve (rpmts ts, rpmds ds, const void *data) |
Attempt to solve a needed dependency using the solve database. | |
int | rpmtsAvailable (rpmts ts, const rpmds ds) |
Attempt to solve a needed dependency using memory resident tables. | |
int | rpmtsSetSolveCallback (rpmts ts, int(*solve)(rpmts ts, rpmds key, const void *data), const void *solveData) |
rpmps | rpmtsProblems (rpmts ts) |
Return current transaction set problems. | |
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. | |
static void | rpmtsPrintStat (const char *name, struct rpmop_s *op) |
static void | rpmtsPrintStats (rpmts ts) |
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). | |
void | rpmtsSetType (rpmts ts, rpmtsType type) |
Set transaction type. | |
rpmtsType | rpmtsGetType (rpmts ts) |
Return the type of a transaction. | |
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 (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. | |
void * | rpmtsNotify (rpmts ts, rpmte te, rpmCallbackType what, unsigned long amount, unsigned long total) |
Perform transaction progress notify callback. | |
int | rpmtsNElements (rpmts ts) |
Return number of (ordered) transaction set elements. | |
rpmte | rpmtsElement (rpmts ts, int ix) |
Return (ordered) transaction set element. | |
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. | |
uint_32 | rpmtsColor (rpmts ts) |
Retrieve color bits of transaction set. | |
uint_32 | rpmtsSetColor (rpmts ts, uint_32 color) |
Set color bits of transaction set. | |
uint_32 | rpmtsPrefColor (rpmts ts) |
Retrieve prefered file color. | |
rpmop | rpmtsOp (rpmts ts, rpmtsOpX opx) |
Retrieve operation timestamp from a transaction set. | |
int | rpmtsSetNotifyCallback (rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData) |
Set transaction notify callback function and argument. | |
int | rpmtsGetKeys (const rpmts ts, fnpyKey **ep, int *nep) |
Retrieve keys from ordered transaction set. | |
rpmts | rpmtsCreate (void) |
Create an empty transaction set. | |
rpmRC | rpmtsScoreInit (rpmts runningTS, rpmts rollbackTS) |
rpmtsScore | rpmtsScoreFree (rpmtsScore score) |
rpmtsScore | rpmtsGetScore (rpmts ts) |
rpmtsScoreEntry | rpmtsScoreGetEntry (rpmtsScore score, const char *N) |
Variables | |
int | _rpmts_debug = 0 |
int | _rpmts_stats = 0 |
Definition in file rpmts.c.
Return header color.
h | header |
Definition at line 113 of file rpmts.c.
References headerGetEntryMinMemory(), and RPMTAG_FILECOLORS.
Referenced by rpmtsAddInstallElement().
char* hGetNEVR | ( | Header | h, | |
const char ** | np | |||
) |
Return (malloc'd) header name-version-release string.
h | header |
np | name tag value |
Definition at line 71 of file rpmts.c.
References headerNVR(), stpcpy(), and xcalloc().
Referenced by addTE(), ensureOlder(), and handleInstInstalledFiles().
char* hGetNEVRA | ( | Header | h, | |
const char ** | np | |||
) |
Return (malloc'd) header name-version-release.arch string.
h | header |
np | name tag value |
Definition at line 90 of file rpmts.c.
References headerGetEntry(), headerNVR(), RPMTAG_ARCH, stpcpy(), and xcalloc().
Referenced by checkPackageSet(), headerCheckPayloadFormat(), and rpmtsAddInstallElement().
static int isArch | ( | const char * | arch | ) | [static] |
Attempt to solve a needed dependency using memory resident tables.
ts | transaction set | |
ds | dependency set |
Definition at line 701 of file rpmts.c.
References _free(), rpmalAllSatisfiesDepend(), and xrealloc().
Retrieve color bits of transaction set.
ts | transaction set |
Definition at line 1463 of file rpmts.c.
Referenced by handleInstInstalledFiles(), handleOverlappedFiles(), rpmpsmStage(), rpmtsAddAvailableElement(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsRun(), and skipFiles().
Return (ordered) transaction set element.
ts | transaction set | |
ix | transaction element index |
Definition at line 1399 of file rpmts.c.
Referenced by rpmInstallSourcePackage(), rpmtsiFi(), and rpmtsiNextElement().
Retrieve pubkey from rpm database.
ts | rpm transaction |
Definition at line 338 of file rpmts.c.
References _free(), pgpDigParams_s::hash_algo, headerFreeData(), headerGetEntry(), PGPARMOR_PUBKEY, pgpGrab(), pgpHexStr(), pgpPrtPkts(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_RSA, pgpReadPkts(), pgpDigParams_s::pubkey_algo, rpmdbFreeIterator(), rpmdbGetIteratorFileNum(), rpmdbGetIteratorOffset(), rpmdbNextIterator(), rpmExpand(), RPMMESS_DEBUG, rpmMessage, RPMRC_NOKEY, RPMRC_OK, RPMTAG_PUBKEYS, rpmtsDig(), rpmtsInitIterator(), rpmtsPubkey(), rpmtsSig(), rpmtsSignature(), pgpDigParams_s::signid, and xstrdup().
Referenced by verifyDSASignature(), and verifyRSASignature().
rpmtsScore rpmtsGetScore | ( | rpmts | ts | ) |
Return the type of a transaction.
ts | transaction set |
Definition at line 949 of file rpmts.c.
Referenced by rpmpsmStage(), and rpmtsRun().
int rpmtsNElements | ( | rpmts | ts | ) |
Return number of (ordered) transaction set elements.
ts | transaction set |
Definition at line 1390 of file rpmts.c.
Referenced by rpmGraph(), rpmtsiNextElement(), rpmtsRun(), rpmtsScoreInit(), and XrpmtsiInit().
void* rpmtsNotify | ( | rpmts | ts, | |
rpmte | te, | |||
rpmCallbackType | what, | |||
unsigned long | amount, | |||
unsigned long | total | |||
) |
Perform transaction progress notify callback.
ts | transaction set | |
te | current transaction element | |
what | type of call back | |
amount | current value | |
total | final value |
Definition at line 1374 of file rpmts.c.
References rpmteKey(), and TR_ADDED.
Referenced by fsmSetup(), fsmStage(), and rpmpsmStage().
Retrieve operation timestamp from a transaction set.
ts | transaction set | |
opx | operation timestamp index |
Definition at line 1483 of file rpmts.c.
References RPMTS_OP_MAX.
Referenced by psmWait(), rpmpsmStage(), rpmReadPackageFile(), rpmtsCheck(), rpmtsCloseDB(), rpmtsCloseSDB(), rpmtsCreate(), rpmtsOrder(), rpmtsPrintStats(), rpmtsRun(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), and verifySHA1Signature().
Retrieve prefered file color.
ts | transaction set |
Definition at line 1478 of file rpmts.c.
Referenced by handleInstInstalledFiles(), handleOverlappedFiles(), and rpmtsOrder().
static void rpmtsPrintStat | ( | const char * | name, | |
struct rpmop_s * | op | |||
) | [static] |
Definition at line 813 of file rpmts.c.
References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.
Referenced by rpmtsPrintStats().
static void rpmtsPrintStats | ( | rpmts | ts | ) | [static] |
Definition at line 825 of file rpmts.c.
References rpmswExit(), RPMTS_OP_CHECK, RPMTS_OP_COMPRESS, RPMTS_OP_DBADD, RPMTS_OP_DBDEL, RPMTS_OP_DBGET, RPMTS_OP_DBPUT, RPMTS_OP_DBREMOVE, RPMTS_OP_DIGEST, RPMTS_OP_ERASE, RPMTS_OP_FINGERPRINT, RPMTS_OP_INSTALL, RPMTS_OP_ORDER, RPMTS_OP_REPACKAGE, RPMTS_OP_SCRIPTLETS, RPMTS_OP_SIGNATURE, RPMTS_OP_TOTAL, RPMTS_OP_UNCOMPRESS, rpmtsOp(), and rpmtsPrintStat().
Referenced by rpmtsFree().
Return current transaction set problems.
ts | transaction set |
Definition at line 744 of file rpmts.c.
References rpmpsLink.
Referenced by _rpmtsRollback(), checkSpec(), ensureOlder(), handleInstInstalledFiles(), handleOverlappedFiles(), relocateFileList(), rpmErase(), rpmgiNext(), rpmGraph(), rpmInstall(), rpmRollback(), rpmts_Check(), rpmts_Problems(), rpmts_Run(), rpmtsCheckDSIProblems(), rpmtsRun(), and verifyDependencies().
rpmtsScore rpmtsScoreFree | ( | rpmtsScore | score | ) |
Definition at line 1699 of file rpmts.c.
References _, _free(), RPMMESS_DEBUG, and rpmMessage.
Referenced by rpmtsFree().
rpmtsScoreEntry rpmtsScoreGetEntry | ( | rpmtsScore | score, | |
const char * | N | |||
) |
Definition at line 1763 of file rpmts.c.
References _, RPMMESS_DEBUG, and rpmMessage.
Referenced by rpmpsmStage().
Definition at line 1611 of file rpmts.c.
References _, RPMMESS_DEBUG, rpmMessage, RPMRC_OK, rpmteN(), rpmteType(), rpmtsiInit, rpmtsiNext(), rpmtsNElements(), TR_ADDED, TR_REMOVED, xcalloc(), and xstrdup().
Referenced by rpmtsRun().
Set color bits of transaction set.
ts | transaction set | |
color | new color bits |
Definition at line 1468 of file rpmts.c.
Referenced by rpmts_SetColor().
Set transaction type.
Allowed types are:
RPMTRANS_TYPE_NORMAL RPMTRANS_TYPE_ROLLBACK RPMTRANS_TYPE_AUTOROLLBACK
ts | transaction set | |
type | transaction type |
Definition at line 941 of file rpmts.c.
Referenced by rpmRollback(), and rpmtsRun().
Attempt to solve a needed dependency using the solve database.
ts | transaction set | |
ds | dependency set | |
data | opaque data associated with callback |
Definition at line 547 of file rpmts.c.
References _, _free(), Fclose(), Ferror(), Fopen(), Fstrerror(), headerFree(), headerGetEntry(), headerLink(), headerSprintf(), rpmdbFreeIterator(), rpmdbInitIterator(), rpmdbNextIterator(), rpmdsAnyMatchesDep(), rpmdsN(), rpmdsTagN(), RPMERR_OPEN, RPMERR_QFMT, rpmError, rpmExpand(), rpmHeaderFormats, RPMMESS_DEBUG, rpmMessage, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), RPMTAG_BASENAMES, RPMTAG_BUILDTIME, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmTagTable, RPMTRANS_FLAG_ADDINDEPS, rpmtsAddInstallElement(), rpmtsOpenSDB(), sugcmp(), and xrealloc().
Referenced by rpmInstall(), rpmts_Check(), and rpmtsCreate().
static int sugcmp | ( | const void * | a, | |
const void * | b | |||
) | [static] |
Compare suggested package resolutions (qsort/bsearch).
a | 1st instance address | |
b | 2nd instance address |
Definition at line 536 of file rpmts.c.
Referenced by rpmtsSolve().
Definition at line 146 of file rpmts.c.
References _rpmts_debug.
Definition at line 136 of file rpmts.c.
References _rpmts_debug.
int _rpmts_debug = 0 |
int _rpmts_stats = 0 |