Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

lib/rpmts.h File Reference

Structures and prototypes used for an "rpmts" transaction set. More...

#include "rpmps.h"
#include "rpmsw.h"
#include "rpmsx.h"
#include "rpmhash.h"
#include "rpmal.h"

Include dependency graph for rpmts.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _RPMVSF_NODIGESTS
#define _RPMVSF_NOSIGNATURES
#define _RPMVSF_NOHEADER
#define _RPMVSF_NOPAYLOAD
#define rpmtsUnlink(_ts, _msg)   XrpmtsUnlink(_ts, _msg, __FILE__, __LINE__)
#define rpmtsLink(_ts, _msg)   XrpmtsLink(_ts, _msg, __FILE__, __LINE__)

Typedefs

typedef enum rpmVSFlags_e rpmVSFlags
 Bit(s) to control digest and signature verification.
typedef enum rpmTSType_e rpmTSType
 Transaction Types.
typedef enum rpmtsOpX_e rpmtsOpX
 Indices for timestamps.

Enumerations

enum  rpmVSFlags_e {
  RPMVSF_DEFAULT = 0, RPMVSF_NOHDRCHK = (1 << 0), RPMVSF_NEEDPAYLOAD = (1 << 1), RPMVSF_NOSHA1HEADER = (1 << 8),
  RPMVSF_NOMD5HEADER = (1 << 9), RPMVSF_NODSAHEADER = (1 << 10), RPMVSF_NORSAHEADER = (1 << 11), RPMVSF_NOSHA1 = (1 << 16),
  RPMVSF_NOMD5 = (1 << 17), RPMVSF_NODSA = (1 << 18), RPMVSF_NORSA = (1 << 19)
}
 Bit(s) to control digest and signature verification. More...
enum  rpmTSType_e { RPMTRANS_TYPE_NORMAL = 0, RPMTRANS_TYPE_ROLLBACK = (1 << 0), RPMTRANS_TYPE_AUTOROLLBACK = (1 << 1) }
 Transaction Types. More...
enum  rpmtsOpX_e {
  RPMTS_OP_TOTAL = 0, RPMTS_OP_CHECK = 1, RPMTS_OP_ORDER = 2, RPMTS_OP_FINGERPRINT = 3,
  RPMTS_OP_REPACKAGE = 4, RPMTS_OP_INSTALL = 5, RPMTS_OP_ERASE = 6, RPMTS_OP_SCRIPTLETS = 7,
  RPMTS_OP_COMPRESS = 8, RPMTS_OP_UNCOMPRESS = 9, RPMTS_OP_DIGEST = 10, RPMTS_OP_SIGNATURE = 11,
  RPMTS_OP_DBADD = 12, RPMTS_OP_DBREMOVE = 13, RPMTS_OP_DBGET = 14, RPMTS_OP_DBPUT = 15,
  RPMTS_OP_DBDEL = 16, RPMTS_OP_READHDR = 17, RPMTS_OP_MAX = 18
}
 Indices for timestamps. More...

Functions

int rpmtsCheck (rpmts ts)
 Check that all dependencies can be resolved.
int rpmrbCheck (rpmts ts)
int rpmtsOrder (rpmts ts)
 Determine package order in a transaction set according to dependencies.
int rpmrbOrder (rpmts ts)
int rpmtsRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
 Process all package elements in a transaction set.
int rpmrbRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
rpmRC rpmtsRollback (rpmts rbts, rpmprobFilterFlags ignoreSet, int running, rpmte rbte)
 Rollback a failed transaction.
rpmts rpmtsUnlink (rpmts ts, const char *msg)
 Unreference a transaction instance.
rpmts XrpmtsUnlink (rpmts ts, const char *msg, const char *fn, unsigned ln)
rpmts rpmtsLink (rpmts ts, const char *msg)
 Reference a transaction set instance.
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.
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.
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 ds, const void *data), const void *solveData)
 Set dependency solver callback.
rpmTSType rpmtsType (rpmts ts)
 Return the type of a transaction.
void rpmtsSetType (rpmts ts, rpmTSType type)
 Set transaction type.
uint_32 rpmtsARBGoal (rpmts ts)
 Return the autorollback goal.
void rpmtsSetARBGoal (rpmts ts, uint_32 goal)
 Set autorollback goal.
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.
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.
rpmPRCO rpmtsPRCO (rpmts ts)
 Get transaction set dependencies.
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 long amount, unsigned long 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.
rpmdepFlags rpmtsDFlags (rpmts ts)
 Get dependency flags, i.e.
rpmdepFlags rpmtsSetDFlags (rpmts ts, rpmdepFlags depFlags)
 Set dependency 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 rpmtsPrefColor (rpmts ts)
 Retrieve prefered file color.
uint_32 rpmtsSetColor (rpmts ts, uint_32 color)
 Set color bits of transaction set.
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.
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.

Variables

int _rpmts_debug
int _rpmts_stats
int _fps_debug


Detailed Description

Structures and prototypes used for an "rpmts" transaction set.

Definition in file rpmts.h.


Define Documentation

#define _RPMVSF_NODIGESTS
 

Value:

Definition at line 51 of file rpmts.h.

Referenced by build(), init_rpm(), rpmcliQuery(), rpmcliVerify(), rpmErase(), rpmInstall(), rpmRollback(), and rpmtsRollback().

#define _RPMVSF_NOHEADER
 

Value:

Definition at line 63 of file rpmts.h.

Referenced by init_rpm().

#define _RPMVSF_NOPAYLOAD
 

Value:

Definition at line 69 of file rpmts.h.

Referenced by init_rpm().

#define _RPMVSF_NOSIGNATURES
 

Value:

Definition at line 57 of file rpmts.h.

Referenced by build(), init_rpm(), rpmcliQuery(), rpmcliVerify(), rpmErase(), rpmInstall(), rpmRollback(), and rpmtsRollback().

#define rpmtsLink _ts,
_msg   )     XrpmtsLink(_ts, _msg, __FILE__, __LINE__)
 

Definition at line 393 of file rpmts.h.

Referenced by mapInitIterator(), rpmgiNew(), rpmInstallSourcePackage(), rpmpsmNew(), rpmtsCreate(), and XrpmtsiInit().

#define rpmtsUnlink _ts,
_msg   )     XrpmtsUnlink(_ts, _msg, __FILE__, __LINE__)
 

Definition at line 377 of file rpmts.h.

Referenced by rpmtsFree().


Typedef Documentation

typedef enum rpmtsOpX_e rpmtsOpX
 

Indices for timestamps.

typedef enum rpmTSType_e rpmTSType
 

Transaction Types.

typedef enum rpmVSFlags_e rpmVSFlags
 

Bit(s) to control digest and signature verification.


Enumeration Type Documentation

enum rpmtsOpX_e
 

Indices for timestamps.

Enumerator:
RPMTS_OP_TOTAL 
RPMTS_OP_CHECK 
RPMTS_OP_ORDER 
RPMTS_OP_FINGERPRINT 
RPMTS_OP_REPACKAGE 
RPMTS_OP_INSTALL 
RPMTS_OP_ERASE 
RPMTS_OP_SCRIPTLETS 
RPMTS_OP_COMPRESS 
RPMTS_OP_UNCOMPRESS 
RPMTS_OP_DIGEST 
RPMTS_OP_SIGNATURE 
RPMTS_OP_DBADD 
RPMTS_OP_DBREMOVE 
RPMTS_OP_DBGET 
RPMTS_OP_DBPUT 
RPMTS_OP_DBDEL 
RPMTS_OP_READHDR 
RPMTS_OP_MAX 

Definition at line 78 of file rpmts.h.

enum rpmTSType_e
 

Transaction Types.

Enumerator:
RPMTRANS_TYPE_NORMAL 
RPMTRANS_TYPE_ROLLBACK 
RPMTRANS_TYPE_AUTOROLLBACK 

Definition at line 45 of file rpmts.h.

enum rpmVSFlags_e
 

Bit(s) to control digest and signature verification.

Enumerator:
RPMVSF_DEFAULT 
RPMVSF_NOHDRCHK 
RPMVSF_NEEDPAYLOAD 
RPMVSF_NOSHA1HEADER 
RPMVSF_NOMD5HEADER 
RPMVSF_NODSAHEADER 
RPMVSF_NORSAHEADER 
RPMVSF_NOSHA1 
RPMVSF_NOMD5 
RPMVSF_NODSA 
RPMVSF_NORSA 

Definition at line 25 of file rpmts.h.


Function Documentation

int rpmrbCheck rpmts  ts  ) 
 

Definition at line 387 of file rpmrollback.c.

References N_, rpmrbProblems(), and rpmtsCheck().

Referenced by main().

int rpmrbOrder rpmts  ts  ) 
 

Definition at line 392 of file rpmrollback.c.

References N_, rpmrbProblems(), and rpmtsOrder().

Referenced by main().

int rpmrbRun rpmts  ts,
rpmps  okProbs,
rpmprobFilterFlags  ignoreSet
 

Definition at line 397 of file rpmrollback.c.

References N_, rpmrbProblems(), and rpmtsRun().

Referenced by main().

uint_32 rpmtsARBGoal rpmts  ts  ) 
 

Return the autorollback goal.

Parameters:
ts transaction set
Returns:
autorollback goal

Definition at line 865 of file rpmts.c.

Referenced by rpmtsRollback().

int rpmtsAvailable rpmts  ts,
const rpmds  ds
 

Attempt to solve a needed dependency using memory resident tables.

Deprecated:
This function will move from rpmlib to the python bindings.
Parameters:
ts transaction set
ds dependency set
Returns:
0 if resolved (and added to ts), 1 not found

Definition at line 612 of file rpmts.c.

References _free(), rpmalAllSatisfiesDepend(), and xrealloc().

uint_32 rpmtsColor rpmts  ts  ) 
 

Retrieve color bits of transaction set.

Parameters:
ts transaction set
Returns:
color bits

Definition at line 1438 of file rpmts.c.

Referenced by checkPackageSet(), handleInstInstalledFiles(), handleOverlappedFiles(), populateInstallHeader(), rpmpsmStage(), rpmtsAddAvailableElement(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsOrder(), rpmtsRun(), and skipFiles().

rpmte rpmtsElement rpmts  ts,
int  ix
 

Return (ordered) transaction set element.

Parameters:
ts transaction set
ix transaction element index
Returns:
transaction element (or NULL)

Definition at line 1359 of file rpmts.c.

Referenced by rpmInstallSourcePackage(), rpmtsiFi(), and rpmtsiNextElement().

rpmRC rpmtsFindPubkey rpmts  ts  ) 
 

Retrieve pubkey from rpm database.

Parameters:
ts rpm transaction
Returns:
RPMRC_OK on success, RPMRC_NOKEY if not found

Definition at line 240 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().

int rpmtsNElements rpmts  ts  ) 
 

Return number of (ordered) transaction set elements.

Parameters:
ts transaction set
Returns:
no. of transaction set elements

Definition at line 1350 of file rpmts.c.

Referenced by rpmtsiNextElement(), rpmtsRun(), and XrpmtsiInit().

void* rpmtsNotify rpmts  ts,
rpmte  te,
rpmCallbackType  what,
unsigned long long  amount,
unsigned long long  total
 

Perform transaction progress notify callback.

Warning:
This function's args have changed, so the function cannot be used portably
Parameters:
ts transaction set
te current transaction element
what type of call back
amount current value
total final value
Returns:
callback dependent pointer

Definition at line 1334 of file rpmts.c.

References rpmteKey(), and TR_ADDED.

Referenced by fsmSetup(), fsmStage(), and rpmpsmStage().

rpmop rpmtsOp rpmts  ts,
rpmtsOpX  opx
 

Retrieve operation timestamp from a transaction set.

Parameters:
ts transaction set
opx operation timestamp index
Returns:
pointer to operation timestamp.

Definition at line 1458 of file rpmts.c.

References RPMTS_OP_MAX.

Referenced by fsmStage(), headerCheck(), psmWait(), rpmpsmStage(), rpmReadPackageFile(), rpmtsCheck(), rpmtsCloseDB(), rpmtsCloseSDB(), rpmtsCreate(), rpmtsOrder(), rpmtsPrintStats(), rpmtsRun(), verifyDSASignature(), verifyMD5Signature(), verifyRSASignature(), and verifySHA1Signature().

uint_32 rpmtsPrefColor rpmts  ts  ) 
 

Retrieve prefered file color.

Parameters:
ts transaction set
Returns:
color bits

Definition at line 1453 of file rpmts.c.

Referenced by handleInstInstalledFiles(), handleOverlappedFiles(), and rpmtsOrder().

rpmps rpmtsProblems rpmts  ts  ) 
 

Return current transaction set problems.

Parameters:
ts transaction set
Returns:
current problem set (or NULL)

Definition at line 655 of file rpmts.c.

References rpmpsLink.

Referenced by checkPackageDeps(), checkSpec(), cmpArgvStr(), ensureOlder(), handleInstInstalledFiles(), handleOverlappedFiles(), relocateFileList(), rpmErase(), rpmgiNext(), rpmInstall(), rpmrbProblems(), rpmts_Check(), rpmts_Problems(), rpmts_Run(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsCheckDSIProblems(), rpmtsRun(), and verifyDependencies().

void rpmtsSetARBGoal rpmts  ts,
uint_32  goal
 

Set autorollback goal.

Parameters:
ts transaction set
goal autorollback goal

Definition at line 870 of file rpmts.c.

Referenced by rpmErase(), and rpmInstall().

uint_32 rpmtsSetColor rpmts  ts,
uint_32  color
 

Set color bits of transaction set.

Parameters:
ts transaction set
color new color bits
Returns:
previous color bits

Definition at line 1443 of file rpmts.c.

Referenced by rpmts_SetColor().

int rpmtsSetSolveCallback rpmts  ts,
int(*)(rpmts ts, rpmds ds, const void *data)  solve,
const void *  solveData
 

Set dependency solver callback.

Parameters:
ts transaction set
(*solve) dependency solver callback
solveData dependency solver callback data (opaque)
Returns:
0 on success

void rpmtsSetType rpmts  ts,
rpmTSType  type
 

Set transaction type.

Allowed types are: RPMTRANS_TYPE_NORMAL RPMTRANS_TYPE_ROLLBACK RPMTRANS_TYPE_AUTOROLLBACK

Parameters:
ts transaction set
type transaction type

Definition at line 859 of file rpmts.c.

Referenced by rpmRollback().

int rpmtsSolve rpmts  ts,
rpmds  ds,
const void *  data
 

Attempt to solve a needed dependency using the solve database.

Parameters:
ts transaction set
ds dependency set
data opaque data associated with callback
Returns:
-1 retry, 0 ignore, 1 not found

Definition at line 451 of file rpmts.c.

References _, _free(), Fclose(), Ferror(), Fopen(), Fstrerror(), headerFree(), headerGetEntry(), headerLink(), headerSprintf(), rpmdbFreeIterator(), rpmdbInitIterator(), rpmdbNextIterator(), RPMDEPS_FLAG_ADDINDEPS, 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_CONFLICTNAME, RPMTAG_DIRNAMES, RPMTAG_FILELINKTOS, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmTagTable, rpmtsAddInstallElement(), rpmtsOpenSDB(), sugcmp(), and xrealloc().

Referenced by rpmInstall(), rpmts_Check(), and rpmtsCreate().

rpmTSType rpmtsType rpmts  ts  ) 
 

Return the type of a transaction.

Parameters:
ts transaction set
Returns:
transaction type, 0 on unknown

Definition at line 854 of file rpmts.c.

Referenced by populateInstallHeader(), rpmpsmStage(), rpmtsRollback(), and rpmtsRun().

rpmts XrpmtsLink rpmts  ts,
const char *  msg,
const char *  fn,
unsigned  ln
 

Todo:
Remove debugging entry from the ABI.

Definition at line 85 of file rpmts.c.

References _rpmts_debug.

rpmts XrpmtsUnlink rpmts  ts,
const char *  msg,
const char *  fn,
unsigned  ln
 

Todo:
Remove debugging entry from the ABI.

Definition at line 75 of file rpmts.c.

References _rpmts_debug.


Variable Documentation

int _fps_debug
 

Definition at line 302 of file transaction.c.

int _rpmts_debug
 

Definition at line 70 of file rpmts.c.

int _rpmts_stats
 

Definition at line 73 of file rpmts.c.


Generated on Mon Aug 3 15:15:48 2009 for rpm by  doxygen 1.4.4