rpm  5.4.15
Macros | Functions | Variables
rpmts.c File Reference

Routine(s) to handle a "rpmts" transaction sets. More...

#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmlog.h>
#include <iosm.h>
#include <rpmurl.h>
#include <rpmpgp.h>
#include <rpmmacro.h>
#include <rpmkeyring.h>
#include <rpmhkp.h>
#include <rpmsx.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <pkgio.h>
#include "rpmdb.h"
#include "rpmal.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmlock.h"
#include "rpmns.h"
#include "rpmte.h"
#include "rpmts.h"
#include <rpmcli.h>
#include "fs.h"
#include "debug.h"
Include dependency graph for rpmts.c:

Go to the source code of this file.

Macros

#define _RPMTAG_INTERNAL   /* XXX tagStore_s */
 
#define _RPMDB_INTERNAL   /* XXX almost opaque sigh */
 
#define _RPMTE_INTERNAL   /* XXX te->h */
 
#define _RPMTS_INTERNAL
 
#define _RPMBAG_INTERNAL
 
#define ST_RDONLY   1
 

Functions

int rpmtsCloseDB (rpmts ts)
 Close the database used by the transaction. More...
 
int rpmtsOpenDB (rpmts ts, int dbmode)
 Open the database used by the transaction. More...
 
int rpmtsRebuildDB (rpmts ts)
 Rebuild the database used by the transaction. More...
 
rpmmi rpmtsInitIterator (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
 Return transaction database iterator. More...
 
int rpmtsCloseSDB (rpmts ts)
 Close the database used by the transaction to solve dependencies. More...
 
int rpmtsOpenSDB (rpmts ts, int dbmode)
 Open the database used by the transaction to solve dependencies. More...
 
static int sugcmp (const void *a, const void *b)
 Compare suggested package resolutions (qsort/bsearch). More...
 
int rpmtsSolve (rpmts ts, rpmds ds, const void *data)
 Attempt to solve a needed dependency using the solve database. More...
 
int rpmtsAvailable (rpmts ts, const rpmds ds)
 Attempt to solve a needed dependency using memory resident tables. More...
 
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. More...
 
void rpmtsClean (rpmts ts)
 Free memory needed only for dependency checks and ordering. More...
 
void rpmtsEmpty (rpmts ts)
 Re-create an empty transaction set. More...
 
static void rpmtsPrintStat (const char *name, struct rpmop_s *op)
 
static void rpmtsPrintStats (rpmts ts)
 
static void rpmtsFini (void *_ts)
 
static rpmts rpmtsGetPool (rpmioPool pool)
 
void * rpmtsGetKeyring (rpmts ts, int autoload)
 Get transaction keyring. More...
 
int rpmtsSetKeyring (rpmts ts, void *_keyring)
 Set transaction keyring. More...
 
rpmVSFlags rpmtsVSFlags (rpmts ts)
 Get verify signatures flag(s). More...
 
rpmVSFlags rpmtsSetVSFlags (rpmts ts, rpmVSFlags vsflags)
 Set verify signatures flag(s). More...
 
rpmTSType rpmtsType (rpmts ts)
 Return the type of a transaction. More...
 
void rpmtsSetType (rpmts ts, rpmTSType type)
 Set transaction type. More...
 
rpmuint32_t rpmtsARBGoal (rpmts ts)
 Return the autorollback goal. More...
 
void rpmtsSetARBGoal (rpmts ts, rpmuint32_t goal)
 Set autorollback goal. More...
 
int rpmtsUnorderedSuccessors (rpmts ts, int first)
 Set index of 1st element of successors. More...
 
const char * rpmtsRootDir (rpmts ts)
 Get transaction rootDir, i.e. More...
 
void rpmtsSetRootDir (rpmts ts, const char *rootDir)
 Set transaction rootDir, i.e. More...
 
const char * rpmtsCurrDir (rpmts ts)
 Get transaction currDir, i.e. More...
 
void rpmtsSetCurrDir (rpmts ts, const char *currDir)
 Set transaction currDir, i.e. More...
 
FD_t rpmtsScriptFd (rpmts ts)
 
void rpmtsSetScriptFd (rpmts ts, FD_t scriptFd)
 
int rpmtsSELinuxEnabled (rpmts ts)
 Get selinuxEnabled flag, i.e. More...
 
int rpmtsChrootDone (rpmts ts)
 Get chrootDone flag, i.e. More...
 
int rpmtsSetChrootDone (rpmts ts, int chrootDone)
 Set chrootDone flag, i.e. More...
 
rpmuint32_t rpmtsGetTid (rpmts ts)
 Get transaction id, i.e. More...
 
rpmuint32_t rpmtsSetTid (rpmts ts, rpmuint32_t tid)
 Set transaction id, i.e. More...
 
rpmPRCO rpmtsPRCO (rpmts ts)
 Get transaction set dependencies. More...
 
int rpmtsInitDSI (const rpmts ts)
 Initialize disk space info for each and every mounted file systems. More...
 
void rpmtsUpdateDSI (const rpmts ts, dev_t dev, rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixupSize, int _action)
 Update disk space info for a file. More...
 
void rpmtsCheckDSIProblems (const rpmts ts, const rpmte te)
 Check a transaction element for disk space problems. More...
 
void * rpmtsNotify (rpmts ts, rpmte te, rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total)
 Perform transaction progress notify callback. More...
 
int rpmtsNElements (rpmts ts)
 Return number of (ordered) transaction set elements. More...
 
rpmte rpmtsElement (rpmts ts, int ix)
 Return (ordered) transaction set element. More...
 
rpmprobFilterFlags rpmtsFilterFlags (rpmts ts)
 Get problem ignore bit mask, i.e. More...
 
rpmtransFlags rpmtsFlags (rpmts ts)
 Get transaction flags, i.e. More...
 
rpmtransFlags rpmtsSetFlags (rpmts ts, rpmtransFlags transFlags)
 Set transaction flags, i.e. More...
 
rpmdepFlags rpmtsDFlags (rpmts ts)
 Get dependency flags, i.e. More...
 
rpmdepFlags rpmtsSetDFlags (rpmts ts, rpmdepFlags depFlags)
 Set dependency flags, i.e. More...
 
Spec rpmtsSpec (rpmts ts)
 Get spec control structure from transaction set. More...
 
Spec rpmtsSetSpec (rpmts ts, Spec spec)
 Set a spec control structure in transaction set. More...
 
rpmte rpmtsRelocateElement (rpmts ts)
 Get current relocate transaction element. More...
 
rpmte rpmtsSetRelocateElement (rpmts ts, rpmte relocateElement)
 Set current relocate transaction element. More...
 
tsmStage rpmtsGoal (rpmts ts)
 Retrieve goal of transaction set. More...
 
tsmStage rpmtsSetGoal (rpmts ts, tsmStage goal)
 Set goal of transaction set. More...
 
int rpmtsDBMode (rpmts ts)
 Retrieve dbmode of transaction set. More...
 
int rpmtsSetDBMode (rpmts ts, int dbmode)
 Set dbmode of transaction set. More...
 
rpmuint32_t rpmtsColor (rpmts ts)
 Retrieve color bits of transaction set. More...
 
rpmuint32_t rpmtsSetColor (rpmts ts, rpmuint32_t color)
 Set color bits of transaction set. More...
 
rpmuint32_t rpmtsPrefColor (rpmts ts)
 Retrieve preferred file color. More...
 
int rpmtsSetNotifyCallback (rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
 Set transaction notify callback function and argument. More...
 
rpmts rpmtsCreate (void)
 Create an empty transaction set. More...
 

Variables

int _rpmts_debug = 0
 
int _rpmts_stats = 0
 
int _rpmts_macros = 0
 
rpmop _hdr_loadops
 
rpmop _hdr_getops
 
rpmioPool _rpmtsPool
 

Detailed Description

Routine(s) to handle a "rpmts" transaction sets.

Definition in file rpmts.c.

Macro Definition Documentation

#define _RPMBAG_INTERNAL

Definition at line 36 of file rpmts.c.

#define _RPMDB_INTERNAL   /* XXX almost opaque sigh */

Definition at line 23 of file rpmts.c.

#define _RPMTAG_INTERNAL   /* XXX tagStore_s */

Definition at line 19 of file rpmts.c.

#define _RPMTE_INTERNAL   /* XXX te->h */

Definition at line 32 of file rpmts.c.

#define _RPMTS_INTERNAL

Definition at line 35 of file rpmts.c.

#define ST_RDONLY   1

Function Documentation

rpmuint32_t rpmtsARBGoal ( rpmts  ts)

Return the autorollback goal.

Parameters
tstransaction set
Returns
autorollback goal

Definition at line 881 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
tstransaction set
dsdependency set
Returns
0 if resolved (and added to ts), 1 not found

Definition at line 545 of file rpmts.c.

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

void rpmtsCheckDSIProblems ( const rpmts  ts,
const rpmte  te 
)

Check a transaction element for disk space problems.

Parameters
tstransaction set
tecurrent transaction element

Definition at line 1232 of file rpmts.c.

References i, rpmfiFC(), RPMPROB_DISKNODES, RPMPROB_DISKSPACE, RPMPROB_RDONLY, rpmpsAppend(), rpmpsFree(), RPMTAG_BASENAMES, rpmteFI(), rpmteKey(), rpmteNEVR(), rpmtsProblems(), and ST_RDONLY.

Referenced by rpmtsPrepare().

int rpmtsChrootDone ( rpmts  ts)

Get chrootDone flag, i.e.

has chroot(2) been performed?

Parameters
tstransaction set
Returns
chrootDone flag

Definition at line 1007 of file rpmts.c.

Referenced by rpmpsmStage(), rpmtsAcquireLock(), rpmtsPrepare(), and runScript().

void rpmtsClean ( rpmts  ts)

Free memory needed only for dependency checks and ordering.

Parameters
tstransaction set

Definition at line 598 of file rpmts.c.

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

Referenced by _rpmtsOrder(), rpmcliImportPubkeys(), rpmcliInstall(), rpmErase(), rpmInstallSourcePackage(), rpmRollback(), rpmts_Clean(), and rpmtsEmpty().

int rpmtsCloseDB ( rpmts  ts)

Close the database used by the transaction.

Parameters
tstransaction set
Returns
0 on success

Definition at line 101 of file rpmts.c.

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

Referenced by _rpmtsCheck(), ftsCacheUpdate(), rpmts_CloseDB(), rpmts_InitDB(), rpmtsFini(), rpmtsOpenDB(), and rpmtsRebuildDB().

int rpmtsCloseSDB ( rpmts  ts)

Close the database used by the transaction to solve dependencies.

Parameters
tstransaction set
Returns
0 on success

Definition at line 222 of file rpmts.c.

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

Referenced by rpmtsFini().

rpmuint32_t rpmtsColor ( rpmts  ts)

Retrieve color bits of transaction set.

Parameters
tstransaction set
Returns
color bits

Definition at line 1440 of file rpmts.c.

Referenced by _orgrpmtsOrder(), _rpmtsCheck(), _rpmtsOrder(), checkPackageSet(), handleInstInstalledFile(), handleOverlappedFiles(), populateInstallHeader(), rpmpsmStage(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), and rpmtsSkipFiles().

rpmts rpmtsCreate ( void  )

Create an empty transaction set.

Returns
new transaction set

Definition at line 1470 of file rpmts.c.

References rpmExpandNumeric(), rpmswEnter(), rpmsxEnabled(), RPMTRANS_TYPE_NORMAL, RPMTS_OP_TOTAL, rpmtsGetPool(), rpmtsLink(), rpmtsOp(), rpmtsSolve(), TSM_UNKNOWN, and xcalloc().

Referenced by cpio_doio(), hdrCreate(), main(), and rpmts_new().

const char* rpmtsCurrDir ( rpmts  ts)

Get transaction currDir, i.e.

current directory before chroot(2).

Parameters
tstransaction set
Returns
transaction currDir

Definition at line 953 of file rpmts.c.

Referenced by rpmpsmStage(), and rpmtsPrepare().

int rpmtsDBMode ( rpmts  ts)

Retrieve dbmode of transaction set.

Parameters
tstransaction set
Returns
dbmode

Definition at line 1425 of file rpmts.c.

Referenced by _rpmtsCheck(), rpmts_OpenDB(), and rpmtsAddInstallElement().

rpmdepFlags rpmtsDFlags ( rpmts  ts)

Get dependency flags, i.e.

bits that control rpmtsCheck() and rpmtsOrder().

Parameters
tstransaction set
Returns
dependency flags

Definition at line 1363 of file rpmts.c.

Referenced by _rpmtsCheck(), _rpmtsOrder(), checkPackageSet(), detectSCCs(), ignoreDep(), rpmgiNext(), rpmtsAddInstallElement(), rpmtsRollback(), and unsatisfiedDepend().

rpmte rpmtsElement ( rpmts  ts,
int  ix 
)

Return (ordered) transaction set element.

Parameters
tstransaction set
ixtransaction element index
Returns
transaction element (or NULL)

Definition at line 1317 of file rpmts.c.

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

void rpmtsEmpty ( rpmts  ts)

Re-create an empty transaction set.

Parameters
tstransaction set

Definition at line 625 of file rpmts.c.

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

Referenced by rpmcliArgIter(), rpmcliInstall(), rpmcliVerify(), rpmErase(), rpmRollback(), rpmtsFini(), rpmtsRollback(), and verifyDependencies().

rpmprobFilterFlags rpmtsFilterFlags ( rpmts  ts)

Get problem ignore bit mask, i.e.

bits to filter encountered problems.

Parameters
tstransaction set
Returns
ignore bit mask

Definition at line 1329 of file rpmts.c.

Referenced by handleInstInstalledFile(), handleOverlappedFiles(), relocateFileList(), rpmtsInitDSI(), and rpmtsSanityCheck().

static void rpmtsFini ( void *  _ts)
static
rpmtransFlags rpmtsFlags ( rpmts  ts)

Get transaction flags, i.e.

bits that control rpmtsRun().

Parameters
tstransaction set
Returns
transaction flags

Definition at line 1334 of file rpmts.c.

References RPMTRANS_FLAG_NOCONTEXTS, and rpmtsSELinuxEnabled().

Referenced by _rpmtsCheck(), _rpmtsOrder(), _rpmtsRun(), fsmSetup(), handleInstInstalledFile(), iosmSetup(), rpmpsmStage(), rpmtsFinish(), rpmtsProcess(), rpmtsRepackage(), rpmtsRollback(), rpmtsSetup(), and rpmtsSkipFiles().

void* rpmtsGetKeyring ( rpmts  ts,
int  autoload 
)

Get transaction keyring.

Parameters
tstransaction set
autoloadShould keyring be loaded? (unimplmented)
Returns
transaction keyring

Definition at line 792 of file rpmts.c.

static rpmts rpmtsGetPool ( rpmioPool  pool)
static

Definition at line 776 of file rpmts.c.

References _rpmtsPool, rpmioGetPool(), rpmioNewPool(), rpmtsFini(), and ts.

Referenced by rpmtsCreate().

rpmuint32_t rpmtsGetTid ( rpmts  ts)

Get transaction id, i.e.

transaction time stamp.

Parameters
tstransaction set
Returns
transaction id

Definition at line 1024 of file rpmts.c.

Referenced by fsmSetup(), ftsCacheUpdate(), iosmSetup(), rpmcliImportPubkey(), rpmpsmStage(), and rpmtsRollback().

tsmStage rpmtsGoal ( rpmts  ts)

Retrieve goal of transaction set.

Parameters
tstransaction set
Returns
goal

Definition at line 1410 of file rpmts.c.

References TSM_UNKNOWN.

int rpmtsInitDSI ( const rpmts  ts)

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

Parameters
tstransaction set
Returns
0 on success

Definition at line 1067 of file rpmts.c.

References _free(), D_, i, rpmGetFilesystemList(), rpmlog(), RPMLOG_DEBUG, RPMPROB_FILTER_DISKSPACE, rpmtsFilterFlags(), ST_RDONLY, and xcalloc().

Referenced by rpmtsSetup(), and unsatisfiedDepend().

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

Return transaction database iterator.

Parameters
tstransaction set
rpmtagrpm tag
keypkey data (NULL for sequential access)
keylenkey data length (0 will use strlen(keyp))
Returns
NULL on failure

Definition at line 212 of file rpmts.c.

References rpmmiInit(), and rpmtsOpenDB().

Referenced by checkDependentConflicts(), checkDependentPackages(), ftsCacheUpdate(), IDTXload(), rpmcliEraseElement(), rpmcliInstall(), rpmErase(), rpmgiInitFilter(), rpmmi_new(), rpmpsmStage(), rpmQueryVerify(), rpmrb_NewMi(), rpmteDBHeader(), rpmts_AddErase(), rpmts_Match(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsEraseDebuginfo(), rpmtsSanityCheck(), runImmedTriggers(), runTriggersLoop(), and unsatisfiedDepend().

int rpmtsNElements ( rpmts  ts)

Return number of (ordered) transaction set elements.

Parameters
tstransaction set
Returns
no. of transaction set elements

Definition at line 1308 of file rpmts.c.

Referenced by _rpmtsRun(), rpmcliInstall(), rpmtsiNextElement(), rpmtsSanityCheck(), and XrpmtsiInit().

void* rpmtsNotify ( rpmts  ts,
rpmte  te,
rpmCallbackType  what,
rpmuint64_t  amount,
rpmuint64_t  total 
)

Perform transaction progress notify callback.

Warning
This function's args have changed, so the function cannot be used portably
Parameters
tstransaction set
tecurrent transaction element
whattype of call back
amountcurrent value
totalfinal value
Returns
callback dependent pointer

Definition at line 1281 of file rpmts.c.

References headerFree(), headerLink(), and rpmteKey().

Referenced by fsmSetup(), fsmStage(), iosmSetup(), iosmStage(), rpmpsmStage(), rpmteClose(), rpmteFDHeader(), rpmtsFindBaseNamesInDB(), rpmtsPrepare(), rpmtsRepackage(), and runScript().

int rpmtsOpenDB ( rpmts  ts,
int  dbmode 
)

Open the database used by the transaction.

Parameters
tstransaction set
dbmodeO_RDONLY or O_RDWR
Returns
0 on success

Definition at line 115 of file rpmts.c.

References _, _free(), rpmdbOpen(), rpmGetPath(), rpmlog(), RPMLOG_ERR, and rpmtsCloseDB().

Referenced by _rpmtsCheck(), ftsCacheUpdate(), rpmcliImportPubkey(), rpmts_Match(), rpmts_OpenDB(), rpmtsAddInstallElement(), rpmtsInitIterator(), rpmtsLoadNVRA(), rpmtsRebuildDB(), rpmtsRollback(), and rpmtsSetup().

int rpmtsOpenSDB ( rpmts  ts,
int  dbmode 
)

Open the database used by the transaction to solve dependencies.

Parameters
tstransaction set
dbmodeO_RDONLY or O_RDWR
Returns
0 on success

Definition at line 252 of file rpmts.c.

References _, _free(), addMacro(), argvCount(), argvFree(), argvSplit(), delMacro(), i, RMIL_DEFAULT, rpmbagAdd(), rpmbagNew(), rpmdbOpen(), rpmExpand(), rpmExpandNumeric(), rpmGetPath(), rpmlog(), RPMLOG_WARNING, and urlPath().

Referenced by rpmtsSolve().

rpmPRCO rpmtsPRCO ( rpmts  ts)

Get transaction set dependencies.

Parameters
tstransaction set
Returns
transaction set dependencies.

Definition at line 1044 of file rpmts.c.

References _free(), R_OK, rpmdsNewPRCO(), rpmdsSysinfo(), rpmGetPath(), and rpmioAccess().

Referenced by _rpmtsCheck(), and unsatisfiedDepend().

rpmuint32_t rpmtsPrefColor ( rpmts  ts)

Retrieve preferred file color.

Parameters
tstransaction set
Returns
color bits

Definition at line 1455 of file rpmts.c.

Referenced by _orgrpmtsOrder(), _rpmtsOrder(), handleInstInstalledFile(), and handleOverlappedFiles().

static void rpmtsPrintStat ( const char *  name,
struct rpmop_s op 
)
static

Definition at line 656 of file rpmts.c.

References rpmop_s::bytes, rpmop_s::count, and rpmop_s::usecs.

Referenced by rpmtsPrintStats().

static void rpmtsPrintStats ( rpmts  ts)
static
rpmps rpmtsProblems ( rpmts  ts)

Return current transaction set problems.

Parameters
tstransaction set
Returns
current problem set (or NULL)

Definition at line 584 of file rpmts.c.

References rpmpsCreate(), and rpmpsLink().

Referenced by _rpmtsCheck(), checkPackageDeps(), cmpArgvStr(), ensureOlder(), handleInstInstalledFile(), handleOverlappedFiles(), relocateFileList(), rpmcliInstallProblems(), rpmts_Check(), rpmts_Problems(), rpmts_Run(), rpmtsAddInstallElement(), rpmtsCheckDSIProblems(), rpmtsSanityCheck(), and verifyDependencies().

int rpmtsRebuildDB ( rpmts  ts)
rpmte rpmtsRelocateElement ( rpmts  ts)

Get current relocate transaction element.

Parameters
tstransaction set
Returns
current relocate transaction element

Definition at line 1394 of file rpmts.c.

Referenced by relocateFileList(), and rpmfiNew().

const char* rpmtsRootDir ( rpmts  ts)

Get transaction rootDir, i.e.

path to chroot(2).

Parameters
tstransaction set
Returns
transaction rootDir

Definition at line 903 of file rpmts.c.

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

Referenced by _rpmtsRun(), createDir(), rpmfiNew(), rpmpsmStage(), rpmts_rootdir_get(), rpmts_rootdir_set(), rpmtsAcquireLock(), rpmtsPrepare(), rpmtsProcess(), rpmvfNew(), and runScript().

FD_t rpmtsScriptFd ( rpmts  ts)

Definition at line 971 of file rpmts.c.

Referenced by runScript().

int rpmtsSELinuxEnabled ( rpmts  ts)

Get selinuxEnabled flag, i.e.

is SE linux enabled?

Parameters
tstransaction set
Returns
selinuxEnabled flag

Definition at line 999 of file rpmts.c.

Referenced by rpmtsFlags(), rpmtsSetFlags(), rpmtsSetup(), and runScript().

void rpmtsSetARBGoal ( rpmts  ts,
rpmuint32_t  goal 
)

Set autorollback goal.

Parameters
tstransaction set
goalautorollback goal

Definition at line 886 of file rpmts.c.

Referenced by rpmcliInstall(), and rpmErase().

int rpmtsSetChrootDone ( rpmts  ts,
int  chrootDone 
)

Set chrootDone flag, i.e.

has chroot(2) been performed?

Parameters
tstransaction set
chrootDonenew chrootDone flag
Returns
previous chrootDone flag

Definition at line 1012 of file rpmts.c.

Referenced by rpmpsmStage(), rpmtsPrepare(), and rpmtsSetup().

rpmuint32_t rpmtsSetColor ( rpmts  ts,
rpmuint32_t  color 
)

Set color bits of transaction set.

Parameters
tstransaction set
colornew color bits
Returns
previous color bits

Definition at line 1445 of file rpmts.c.

Referenced by rpmts_SetColor().

void rpmtsSetCurrDir ( rpmts  ts,
const char *  currDir 
)

Set transaction currDir, i.e.

current directory before chroot(2).

Parameters
tstransaction set
currDirnew transaction currDir (or NULL)

Definition at line 962 of file rpmts.c.

References _free(), and xstrdup().

Referenced by rpmtsSetup().

int rpmtsSetDBMode ( rpmts  ts,
int  dbmode 
)

Set dbmode of transaction set.

Parameters
tstransaction set
dbmodenew dbmode
Returns
previous dbmode

Definition at line 1430 of file rpmts.c.

Referenced by rpmts_CloseDB(), and rpmts_OpenDB().

rpmdepFlags rpmtsSetDFlags ( rpmts  ts,
rpmdepFlags  depFlags 
)

Set dependency flags, i.e.

bits that control rpmtsCheck() and rpmtsOrder().

Parameters
tstransaction set
depFlagsnew dependency flags
Returns
previous dependency flags

Definition at line 1368 of file rpmts.c.

Referenced by rpmcliInstall(), rpmcliQuery(), rpmcliVerify(), rpmErase(), rpmgiNext(), rpmRollback(), and rpmts_SetDFlags().

rpmtransFlags rpmtsSetFlags ( rpmts  ts,
rpmtransFlags  transFlags 
)

Set transaction flags, i.e.

bits that control rpmtsRun().

Parameters
tstransaction set
transFlagsnew transaction flags
Returns
previous transaction flags

Definition at line 1347 of file rpmts.c.

References RPMTRANS_FLAG_NOCONTEXTS, and rpmtsSELinuxEnabled().

Referenced by rpmcliInstall(), rpmcliQuery(), rpmcliVerify(), rpmErase(), rpmRollback(), rpmts_Rollback(), rpmts_SetFlags(), rpmtsRollback(), and rpmtsSetup().

tsmStage rpmtsSetGoal ( rpmts  ts,
tsmStage  goal 
)

Set goal of transaction set.

Parameters
tstransaction set
goalnew goal
Returns
previous goal

Definition at line 1415 of file rpmts.c.

References TSM_UNKNOWN.

Referenced by rpmcliInstall(), rpmErase(), and rpmgiNext().

int rpmtsSetKeyring ( rpmts  ts,
void *  _keyring 
)

Set transaction keyring.

Parameters
tstransaction set
_keyringnew transaction keyring
Returns
0 on success

Definition at line 809 of file rpmts.c.

References rpmtsGetRdb().

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
tstransaction set
notifyprogress callback
notifyDataprogress callback private data
Returns
0 on success

Definition at line 1460 of file rpmts.c.

Referenced by rpmcliInstall(), rpmErase(), rpmRollback(), and rpmts_Run().

rpmte rpmtsSetRelocateElement ( rpmts  ts,
rpmte  relocateElement 
)

Set current relocate transaction element.

Parameters
tstransaction set
relocateElementnew relocate transaction element
Returns
previous relocate transaction element

Definition at line 1401 of file rpmts.c.

Referenced by addTE(), and rpmtsProcess().

void rpmtsSetRootDir ( rpmts  ts,
const char *  rootDir 
)

Set transaction rootDir, i.e.

path to chroot(2).

Parameters
tstransaction set
rootDirnew transaction rootDir (or NULL)

Definition at line 927 of file rpmts.c.

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

Referenced by main(), rpmts_new(), and rpmts_rootdir_set().

void rpmtsSetScriptFd ( rpmts  ts,
FD_t  scriptFd 
)

Definition at line 982 of file rpmts.c.

References fdFree(), and fdLink().

Referenced by rpmts_setattro(), and rpmVerifyScript().

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

Definition at line 569 of file rpmts.c.

Referenced by rpmts_Check().

Spec rpmtsSetSpec ( rpmts  ts,
Spec  spec 
)

Set a spec control structure in transaction set.

Parameters
tstransaction set
specnew spec control structure
Returns
previous spec control structure

Definition at line 1385 of file rpmts.c.

Referenced by _specQuery(), and parseSpec().

rpmuint32_t rpmtsSetTid ( rpmts  ts,
rpmuint32_t  tid 
)

Set transaction id, i.e.

transaction time stamp.

Parameters
tstransaction set
tidnew transaction id
Returns
previous transaction id

Definition at line 1033 of file rpmts.c.

Referenced by main(), and rpmtsSetup().

void rpmtsSetType ( rpmts  ts,
rpmTSType  type 
)

Set transaction type.

Allowed types are: RPMTRANS_TYPE_NORMAL RPMTRANS_TYPE_ROLLBACK RPMTRANS_TYPE_AUTOROLLBACK

Parameters
tstransaction set
typetransaction type

Definition at line 875 of file rpmts.c.

References type.

Referenced by rpmRollback().

rpmVSFlags rpmtsSetVSFlags ( rpmts  ts,
rpmVSFlags  vsflags 
)

Set verify signatures flag(s).

Parameters
tstransaction set
vsflagsnew verify signatures flags
Returns
previous value

Definition at line 845 of file rpmts.c.

References pgpDigVSFlags, and vsflags.

Referenced by main(), rpmcliInstall(), rpmcliQuery(), rpmcliVerify(), rpmErase(), rpmInstallSource(), rpmRollback(), rpmteFDHeader(), rpmts_new(), rpmts_SetVSFlags(), rpmts_vsflags_set(), and rpmtsRollback().

int rpmtsSolve ( rpmts  ts,
rpmds  ds,
const void *  data 
)
Spec rpmtsSpec ( rpmts  ts)

Get spec control structure from transaction set.

Parameters
tstransaction set
Returns
spec control structure

Definition at line 1378 of file rpmts.c.

Referenced by rpmts_parse_spec(), and spec_Parse().

rpmTSType rpmtsType ( rpmts  ts)

Return the type of a transaction.

Parameters
tstransaction set
Returns
transaction type, 0 on unknown

Definition at line 870 of file rpmts.c.

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

int rpmtsUnorderedSuccessors ( rpmts  ts,
int  first 
)

Set index of 1st element of successors.

Parameters
tstransaction set
firstnew index of 1st element of successors
Returns
previous value

Definition at line 892 of file rpmts.c.

Referenced by _rpmtsOrder(), and rpmtsProcess().

void rpmtsUpdateDSI ( const rpmts  ts,
dev_t  dev,
rpmuint32_t  fileSize,
rpmuint32_t  prevSize,
rpmuint32_t  fixupSize,
int  _action 
)

Update disk space info for a file.

Parameters
tstransaction set
devmount point device
fileSizefile size
prevSizeprevious file size (if upgrading)
fixupSizesize difference (if
_actionfile disposition

Definition at line 1181 of file rpmts.c.

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

Referenced by handleOverlappedFiles().

rpmVSFlags rpmtsVSFlags ( rpmts  ts)

Get verify signatures flag(s).

Parameters
tstransaction set
Returns
verify signatures flags

Definition at line 840 of file rpmts.c.

References pgpDigVSFlags.

Referenced by ftsCacheUpdate(), rpmInstallSource(), rpmpsmStage(), rpmteFDHeader(), rpmts_GetVSFlags(), rpmts_HdrCheck(), rpmts_vsflags_get(), and rpmts_vsflags_set().

static int sugcmp ( const void *  a,
const void *  b 
)
static

Compare suggested package resolutions (qsort/bsearch).

Parameters
a1st instance address
b2nd instance address
Returns
result of comparison

Definition at line 343 of file rpmts.c.

Referenced by rpmtsSolve().

Variable Documentation

rpmop _hdr_getops

Definition at line 94 of file header.c.

Referenced by rpmtsPrintStats().

rpmop _hdr_loadops

Definition at line 90 of file header.c.

Referenced by rpmtsPrintStats().

int _rpmts_debug = 0
int _rpmts_macros = 0

Definition at line 99 of file rpmts.c.

int _rpmts_stats = 0

Definition at line 96 of file rpmts.c.

Referenced by main(), rpmcliInit(), and setStats().

rpmioPool _rpmtsPool

Definition at line 774 of file rpmts.c.

Referenced by rpmtsGetPool().