# RPMTS Transaction Set API.

## Files

file | depends.c
file | psm.c

| Package state machine to handle a package from a transaction set.
file | rpmlib.h

| In Memoriam: Steve Taylor <staylor@redhat.com> was here, now he's not.
file | rpmte.h

| Structures used for an "rpmte" transaction element.
file | rpmts.h

| Structures and prototypes used for an "rpmts" transaction set.
file | transaction.c

## Typedefs

typedef struct rpmts_s * | rpmts
| The RPM Transaction Set.
typedef void * | alKey
| An added/available package retrieval key.
typedef int | alNum
| An added/available package retrieval index.
typedef pgpVSFlags | rpmVSFlags
| Bit(s) to control digest and signature verification.
typedef enum rpmdepFlags_e | rpmdepFlags
| Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.
typedef enum rpmtransFlags_e | rpmtransFlags
| Bit(s) to control rpmtsRun() operation.
typedef enum rpmtsOpX_e | rpmtsOpX
| Indices for timestamps.
typedef enum rpmTSType_e | rpmTSType
| Transaction Types.
typedef enum tsStage_e | tsmStage

## Enumerations

enum

rpmdepFlags_e {
RPMDEPS_FLAG_NONE = 0, RPMDEPS_FLAG_NOUPGRADE = (1 << 0), RPMDEPS_FLAG_NOREQUIRES = (1 << 1), RPMDEPS_FLAG_NOCONFLICTS = (1 << 2),
RPMDEPS_FLAG_NOOBSOLETES = (1 << 3), RPMDEPS_FLAG_NOPARENTDIRS = (1 << 4), RPMDEPS_FLAG_NOLINKTOS = (1 << 5), RPMDEPS_FLAG_ANACONDA = (1 << 6),
RPMDEPS_FLAG_NOSUGGEST = (1 << 7), RPMDEPS_FLAG_ADDINDEPS = (1 << 8), RPMDEPS_FLAG_DEPLOOPS = (1 << 9)
}

| Bit(s) to control rpmtsCheck() and rpmtsOrder() operation. More...

enum

rpmtransFlags_e {
RPMTRANS_FLAG_NONE = 0, RPMTRANS_FLAG_TEST = (1 << 0), RPMTRANS_FLAG_BUILD_PROBS = (1 << 1), RPMTRANS_FLAG_NOSCRIPTS = (1 << 2),
RPMTRANS_FLAG_JUSTDB = (1 << 3), RPMTRANS_FLAG_NOTRIGGERS = (1 << 4), RPMTRANS_FLAG_NODOCS = (1 << 5), RPMTRANS_FLAG_ALLFILES = (1 << 6),
RPMTRANS_FLAG_KEEPOBSOLETE = (1 << 7), RPMTRANS_FLAG_NOCONTEXTS = (1 << 8), RPMTRANS_FLAG_DIRSTASH = (1 << 9), RPMTRANS_FLAG_REPACKAGE = (1 << 10),
RPMTRANS_FLAG_PKGCOMMIT = (1 << 11), RPMTRANS_FLAG_PKGUNDO = (1 << 12), RPMTRANS_FLAG_COMMIT = (1 << 13), RPMTRANS_FLAG_UNDO = (1 << 14),
RPMTRANS_FLAG_NOTRIGGERPREIN = (1 << 16), RPMTRANS_FLAG_NOPRE = (1 << 17), RPMTRANS_FLAG_NOPOST = (1 << 18), RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19),
RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20), RPMTRANS_FLAG_NOPREUN = (1 << 21), RPMTRANS_FLAG_NOPOSTUN = (1 << 22), RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
RPMTRANS_FLAG_NOPAYLOAD = (1 << 24), RPMTRANS_FLAG_APPLYONLY = (1 << 25), RPMTRANS_FLAG_NOFDIGESTS = (1 << 27), RPMTRANS_FLAG_NOCONFIGS = (1 << 30)
}

| Bit(s) to control rpmtsRun() operation. 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_HDRLOAD = 18, RPMTS_OP_HDRGET = 19,
RPMTS_OP_DEBUG = 20, RPMTS_OP_MAX = 20
}

| Indices for timestamps. More...
enum | rpmTSType_e { RPMTRANS_TYPE_NORMAL = 0, RPMTRANS_TYPE_ROLLBACK = (1 << 0), RPMTRANS_TYPE_AUTOROLLBACK = (1 << 1) }
| Transaction Types. More...
enum | tsStage_e { TSM_UNKNOWN = 0, TSM_INSTALL = 7, TSM_ERASE = 8 }

## Functions

int | rpmtsCheck (rpmts ts)
| Perform dependency resolution on the transaction set.
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.
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 | 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.
rpmRC | rpmtsFindPubkey (rpmts ts, void *_dig)
| 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.
uint32_t | rpmtsARBGoal (rpmts ts)
| Return the autorollback goal.
void | rpmtsSetARBGoal (rpmts ts, uint32_t 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.
uint32_t | rpmtsGetTid (rpmts ts)
| Get transaction id, i.e.
uint32_t | rpmtsSetTid (rpmts ts, uint32_t tid)
| Set transaction id, i.e.
pgpDig | rpmtsDig (rpmts ts)
| Get OpenPGP packet parameters, i.e.
pgpDigParams | rpmtsPubkey (const rpmts ts)
| Return 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, uint32_t fileSize, uint32_t prevSize, uint32_t 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, uint64_t amount, uint64_t 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.
tsmStage | rpmtsGoal (rpmts ts)
| Retrieve goal of transaction set.
tsmStage | rpmtsSetGoal (rpmts ts, tsmStage goal)
| Set goal of transaction set.
int | rpmtsDBMode (rpmts ts)
| Retrieve dbmode of transaction set.
int | rpmtsSetDBMode (rpmts ts, int dbmode)
| Set dbmode of transaction set.
uint32_t | rpmtsColor (rpmts ts)
| Retrieve color bits of transaction set.
uint32_t | rpmtsPrefColor (rpmts ts)
| Retrieve prefered file color.
uint32_t | rpmtsSetColor (rpmts ts, uint32_t 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.

## RPMTS

typedef struct rpmpsm_s * | rpmpsm
| Package state machine data.

## Typedef Documentation

typedef void* alKey

An added/available package retrieval key.

Definition at line 71 of file rpmlib.h.

typedef int alNum

An added/available package retrieval index.

Definition at line 78 of file rpmlib.h.

typedef enum rpmdepFlags_e rpmdepFlags

Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.

Todo:
  Move to rpmts.h.

typedef struct rpmpsm_s* rpmpsm

Package state machine data.

Definition at line 280 of file rpmlib.h.

typedef enum rpmtransFlags_e rpmtransFlags

Bit(s) to control rpmtsRun() operation.

Todo:
  Move to rpmts.h.

typedef struct rpmts_s* rpmts

The RPM Transaction Set.

Transaction sets are inherently unordered! RPM may reorder transaction sets to reduce errors. In general, installs/upgrades are done before strict removals, and prerequisite ordering is done on installs/upgrades.

Definition at line 62 of file rpmlib.h.

typedef enum rpmtsOpX_e rpmtsOpX

Indices for timestamps.

typedef enum rpmTSType_e rpmTSType

Transaction Types.

typedef pgpVSFlags rpmVSFlags

Bit(s) to control digest and signature verification.

Definition at line 29 of file rpmts.h.

typedef enum tsStage_e tsmStage

## Enumeration Type Documentation

enum rpmdepFlags_e

Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.

Todo:
  Move to rpmts.h.

Enumerator:

  RPMDEPS_FLAG_NONE |
  RPMDEPS_FLAG_NOUPGRADE | from --noupgrade
  RPMDEPS_FLAG_NOREQUIRES | from --norequires
  RPMDEPS_FLAG_NOCONFLICTS | from --noconflicts
  RPMDEPS_FLAG_NOOBSOLETES | from --noobsoletes
  RPMDEPS_FLAG_NOPARENTDIRS | from --noparentdirs
  RPMDEPS_FLAG_NOLINKTOS | from --nolinktos
  RPMDEPS_FLAG_ANACONDA | from --anaconda
  RPMDEPS_FLAG_NOSUGGEST | from --nosuggest
  RPMDEPS_FLAG_ADDINDEPS | from --aid
  RPMDEPS_FLAG_DEPLOOPS | from --deploops

Definition at line 35 of file rpmts.h.

enum rpmtransFlags_e

Bit(s) to control rpmtsRun() operation.

Todo:
  Move to rpmts.h.

Enumerator:

  RPMTRANS_FLAG_NONE |
  RPMTRANS_FLAG_TEST | from --test
  RPMTRANS_FLAG_BUILD_PROBS | don't process payload
  RPMTRANS_FLAG_NOSCRIPTS | from --noscripts
  RPMTRANS_FLAG_JUSTDB | from --justdb
  RPMTRANS_FLAG_NOTRIGGERS | from --notriggers
  RPMTRANS_FLAG_NODOCS | from --excludedocs
  RPMTRANS_FLAG_ALLFILES | from --allfiles

  RPMTRANS_FLAG_KEEPOBSOLETE

  Todo:
    Document.

  RPMTRANS_FLAG_NOCONTEXTS | from --nocontexts
  RPMTRANS_FLAG_DIRSTASH | from --dirstash
  RPMTRANS_FLAG_REPACKAGE | from --repackage
  RPMTRANS_FLAG_PKGCOMMIT |
  RPMTRANS_FLAG_PKGUNDO |
  RPMTRANS_FLAG_COMMIT |
  RPMTRANS_FLAG_UNDO |
  RPMTRANS_FLAG_NOTRIGGERPREIN | from --notriggerprein
  RPMTRANS_FLAG_NOPRE | from --nopre
  RPMTRANS_FLAG_NOPOST | from --nopost
  RPMTRANS_FLAG_NOTRIGGERIN | from --notriggerin
  RPMTRANS_FLAG_NOTRIGGERUN | from --notriggerun
  RPMTRANS_FLAG_NOPREUN | from --nopreun
  RPMTRANS_FLAG_NOPOSTUN | from --nopostun
  RPMTRANS_FLAG_NOTRIGGERPOSTUN | from --notriggerpostun
  RPMTRANS_FLAG_NOPAYLOAD |
  RPMTRANS_FLAG_APPLYONLY |
  RPMTRANS_FLAG_NOFDIGESTS | from --nofdigests
  RPMTRANS_FLAG_NOCONFIGS | from --noconfigs

Definition at line 53 of file rpmts.h.

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_HDRLOAD |
  RPMTS_OP_HDRGET |
  RPMTS_OP_DEBUG |
  RPMTS_OP_MAX |

Definition at line 116 of file rpmts.h.

enum rpmTSType_e

Transaction Types.

Enumerator:

  RPMTRANS_TYPE_NORMAL |
  RPMTRANS_TYPE_ROLLBACK |
  RPMTRANS_TYPE_AUTOROLLBACK |

Definition at line 144 of file rpmts.h.

enum tsStage_e

Enumerator:

  TSM_UNKNOWN |
  TSM_INSTALL |
  TSM_ERASE |

Definition at line 152 of file rpmts.h.

## 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 530 of file depends.c.

References removePackage(), and RPMAL_NOMATCH.

Referenced by findErases(), rpmErase(), rpmgiNext(), rpmts_AddErase(), and verifyDependencies().

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 185 of file depends.c.

References _, _free(), _obsolete_tag, _rpmds_nopromote, _upgrade_tag, alloca(), D_, headerGet(), headerIsEntry(), hGetColor(), nplatpat, _HE_s::p, platform, platpat, rpmDataType_u::ptr, removePackage(), RPMAL_NOMATCH, rpmalAdd(), rpmcliPackagesTotal, rpmdbFreeIterator(), rpmdbGetIteratorOffset(), rpmdbNextIterator(), rpmdbPruneIterator(), RPMDEPS_FLAG_NOOBSOLETES, RPMDEPS_FLAG_NOUPGRADE, rpmdsAnyMatchesDep(), rpmdsColor(), rpmdsCompare(), rpmdsDNEVR(), rpmdsEVR(), rpmdsFree(), rpmdsInit(), rpmdsLink, rpmdsN(), rpmdsNext(), rpmdsThis(), rpmExpand(), rpmHeadersIdentical(), rpmIsVerbose, rpmlog(), RPMLOG_DEBUG, RPMLOG_WARNING, rpmPlatformScore(), RPMPROB_BADPLATFORM, rpmpsAppend(), rpmpsFree(), RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, rpmteA(), rpmteAddedKey(), rpmteChain(), rpmteDS(), rpmteFI(), rpmteFree(), rpmteIsSource(), rpmteKey(), rpmteN(), rpmteNEVRA(), rpmteNew(), rpmteO(), rpmteSetAddedKey(), rpmteSetHeader(), rpmteType(), rpmtsColor(), rpmtsDBMode(), rpmtsDFlags(), rpmtsGetRdb(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsInitIterator(), rpmtsOpenDB(), rpmtsProblems(), rpmDataType_u::str, _HE_s::tag, TR_ADDED, TR_REMOVED, and xrealloc().

Referenced by rpmcliInstall(), rpmgiNext(), rpmInstallSourcePackage(), rpmRollback(), rpmts_AddInstall(), rpmtsSolve(), and verifyDependencies().

uint32_t rpmtsARBGoal | ( | rpmts | ts | ) |

Return the autorollback goal.

Parameters:

  | ts | transaction set

Returns:
  autorollback goal

Definition at line 966 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 705 of file rpmts.c.

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

int rpmtsCheck | ( | rpmts | ts | ) |

Perform dependency resolution on the transaction set.

Any problems found by rpmtsCheck() can be examined by retrieving the problem set with rpmtsProblems(), success here only means that the resolution was successfully attempted for all packages in the set.

Parameters:

  | ts | transaction set

Returns:
  0 = deps ok, 1 = dep problems, 2 = error

Definition at line 2408 of file depends.c.

References _free(), checkDependentConflicts(), checkDependentPackages(), checkPackageDeps(), rpmalMakeIndex(), rpmdbCloseDBI(), rpmdbFreeIterator(), RPMDBI_DEPENDS, RPMDEPS_FLAG_NOCONFLICTS, RPMDEPS_FLAG_NOLINKTOS, RPMDEPS_FLAG_NOPARENTDIRS, RPMDEPS_FLAG_NOREQUIRES, rpmdsEVR(), rpmdsFromPRCO(), rpmdsInit(), rpmdsN(), rpmdsNegateRC(), rpmdsNext(), rpmdsNSType(), rpmfiFN(), rpmfiInit(), rpmfiNext(), rpmlog(), RPMLOG_DEBUG, RPMNS_TYPE_ENVVAR, RPMPROB_FILTER_NONE, rpmpsCreate(), rpmpsFree(), rpmpsNumProblems(), rpmswEnter(), rpmswExit(), rpmteA(), rpmteColor(), rpmteDS(), rpmteFI(), rpmteNEVR(), rpmteNEVRA(), rpmteO(), RPMTS_OP_CHECK, rpmtsCloseDB(), rpmtsColor(), rpmtsDBMode(), rpmtsDFlags(), rpmtsGetRdb(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsOp(), rpmtsOpenDB(), rpmtsProblems(), rpmtsRollback(), TR_ADDED, TR_REMOVED, and xstrdup().

Referenced by rpmcliInstallCheck(), rpmgiNext(), 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 1307 of file rpmts.c.

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

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 1086 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 756 of file rpmts.c.

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

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

void rpmtsCleanDig | ( | rpmts | ts | ) |

Free signature verification data.

Parameters:

  | ts | transaction set

Definition at line 366 of file pkgio.c.

References pgpDigFree(), pgpStatsAccumulator(), rpmswAdd(), RPMTS_OP_DIGEST, RPMTS_OP_SIGNATURE, and rpmtsOp().

Referenced by miFreeHeader(), rpmdbAdd(), rpmdbNextIterator(), rpmnsProbeSignature(), 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 107 of file rpmts.c.

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

Referenced by 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 488 of file rpmts.c.

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

Referenced by rpmtsFree().

uint32_t rpmtsColor | ( | rpmts | ts | ) |

Retrieve color bits of transaction set.

Parameters:

  | ts | transaction set

Returns:
  color bits

Definition at line 1484 of file rpmts.c.

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

rpmts rpmtsCreate | ( | void |  | ) |

Create an empty transaction set.

Returns:
  new transaction set

Definition at line 1514 of file rpmts.c.

References _free(), is_selinux_enabled, R_OK, rpmdsNewPRCO(), rpmdsSysinfo(), rpmExpandNumeric(), rpmGetPath(), rpmioAccess(), rpmswEnter(), RPMTRANS_TYPE_NORMAL, RPMTS_OP_TOTAL, rpmtsLink, rpmtsOp(), rpmtsSolve(), TSM_UNKNOWN, and xcalloc().

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

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 1037 of file rpmts.c.

Referenced by rpmpsmStage(), and rpmtsRun().

int rpmtsDBMode | ( | rpmts | ts | ) |

Retrieve dbmode of transaction set.

Parameters:

  | ts | transaction set

Returns:
  dbmode

Definition at line 1469 of file rpmts.c.

Referenced by rpmts_OpenDB(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmVerifySignatures().

rpmdepFlags rpmtsDFlags | ( | rpmts | ts | ) |

Get dependency flags, i.e.

bits that control rpmtsCheck() and rpmtsOrder().

Parameters:

  | ts | transaction set

Returns:
  dependency flags

Definition at line 1407 of file rpmts.c.

Referenced by checkPackageSet(), ignoreDep(), rpmgiNext(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsOrder(), rpmtsRollback(), and unsatisfiedDepend().

pgpDig rpmtsDig | ( | rpmts | ts | ) |

Get OpenPGP packet parameters, i.e.

signature/pubkey constants.

Parameters:

  | ts | transaction set

Returns:
  signature/pubkey constants.

Definition at line 351 of file pkgio.c.

References pgpDigNew(), pgpSetFindPubkey(), and rpmtsFindPubkey().

Referenced by miFreeHeader(), rpmdbAdd(), rpmdbNextIterator(), rpmnsProbeSignature(), rpmReadPackageFile(), rpmtsFindPubkey(), rpmtsPubkey(), and rpmVerifySignatures().

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 1375 of file rpmts.c.

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

void rpmtsEmpty | ( | rpmts | ts | ) |

Re-create an empty transaction set.

Parameters:

  | ts | transaction set

Definition at line 783 of file rpmts.c.

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

Referenced by rpmcliArgIter(), rpmcliInstall(), rpmcliVerify(), rpmErase(), rpmRollback(), rpmtsFree(), rpmtsRollback(), 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 1387 of file rpmts.c.

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

rpmRC rpmtsFindPubkey | ( | rpmts | ts,
|  | void * | _dig |
| ) |  |  |

Retrieve pubkey from rpm database.

Parameters:

  | ts | rpm transaction
  | _dig | container (NULL uses rpmtsDig(ts) instead).

Returns:
  RPMRC_OK on success, RPMRC_NOKEY if not found

Definition at line 155 of file pkgio.c.

References _free(), alloca(), rpmDataType_u::argv, _HE_s::c, headerGet(), _HE_s::p, pgpGetPubkey(), pgpGetSignature(), pgpGrab(), pgpHexStr(), pgpPrtPkts(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_RSA, pgpReadPkts(), rpmDataType_u::ptr, rpmdbFreeIterator(), rpmdbGetIteratorFileNum(), rpmdbGetIteratorOffset(), rpmdbInitIterator(), rpmdbNextIterator(), rpmExpand(), rpmlog(), RPMLOG_DEBUG, RPMRC_NOKEY, RPMRC_OK, rpmtsDig(), rpmtsGetRdb(), snprintf(), stpcpy(), _HE_s::tag, and xstrdup().

Referenced by rpmtsDig().

rpmtransFlags rpmtsFlags | ( | rpmts | ts | ) |

Get transaction flags, i.e.

bits that control rpmtsRun().

Parameters:

  | ts | transaction set

Returns:
  transaction flags

Definition at line 1392 of file rpmts.c.

Referenced by fsmMapAttrs(), fsmMapFContext(), fsmMkdirs(), fsmStage(), handleInstInstalledFiles(), rpmpsmStage(), rpmts_Run(), rpmtsRollback(), rpmtsRun(), and skipFiles().

rpmts rpmtsFree | ( | rpmts | ts | ) |

Destroy transaction set, closing the database as well.

Parameters:

  | ts | transaction set

Returns:
  NULL always

Definition at line 865 of file rpmts.c.

References _free(), _rpmts_macros, _rpmts_stats, argvFree(), argvPrint(), fdFree, rpmalFree(), rpmdsFreePRCO(), rpmGetMacroEntries(), rpmsxFree(), rpmtsCloseDB(), rpmtsCloseSDB(), rpmtsEmpty(), rpmtsPrintStats(), and rpmtsUnlink.

Referenced by cpio_doio(), main(), mapFreeIterator(), rpmgiFree(), rpmInstallSourcePackage(), rpmpsmFree(), rpmts_dealloc(), rpmts_free(), and XrpmtsiFree().

rpmdb rpmtsGetRdb | ( | rpmts | ts | ) |

Get transaction set database handle.

Parameters:

  | ts | transaction set

Returns:
  transaction database handle

Definition at line 144 of file pkgio.c.

Referenced by checkDependentConflicts(), checkDependentPackages(), handleOneTrigger(), rpmcliImportPubkey(), rpmgiNext(), rpmpsmStage(), rpmts_Create(), rpmts_dealloc(), rpmts_free(), rpmts_Match(), rpmts_new(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsFindPubkey(), rpmtsImportPubkey(), rpmtsRollback(), rpmtsRun(), runTriggers(), and unsatisfiedDepend().

uint32_t rpmtsGetTid | ( | rpmts | ts | ) |

Get transaction id, i.e.

transaction time stamp.

Parameters:

  | ts | transaction set

Returns:
  transaction id

Definition at line 1120 of file rpmts.c.

Referenced by fsmSetup(), rpmcliImportPubkey(), rpmpsmStage(), rpmtsImportPubkey(), and rpmtsRollback().

tsmStage rpmtsGoal | ( | rpmts | ts | ) |

Retrieve goal of transaction set.

Parameters:

  | ts | transaction set

Returns:
  goal

Definition at line 1454 of file rpmts.c.

References TSM_UNKNOWN.

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 144 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 1146 of file rpmts.c.

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

Referenced by rpmtsRun(), and unsatisfiedDepend().

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 178 of file rpmts.c.

References _, alloca(), RPMDBI_LABEL, rpmdbInitIterator(), rpmdbSetHdrChk(), rpmdbSetIteratorRE(), rpmlog(), RPMLOG_ERR, rpmnsArch(), rpmtsOpenDB(), rpmtsVSFlags(), RPMVSF_NOHDRCHK, and xisdigit().

Referenced by checkDependentConflicts(), checkDependentPackages(), handleInstInstalledFiles(), handleRmvdInstalledFiles(), IDTXload(), markReplacedFiles(), rpmcliInstall(), rpmErase(), rpmgiInitFilter(), rpmpsmStage(), rpmQueryVerify(), rpmts_AddErase(), rpmts_Match(), rpmtsAddInstallElement(), 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 rpmtsNElements | ( | rpmts | ts | ) |

Return number of (ordered) transaction set elements.

Parameters:

  | ts | transaction set

Returns:
  no. of transaction set elements

Definition at line 1366 of file rpmts.c.

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

void* rpmtsNotify | ( | rpmts | ts,
|  | rpmte | te,
|  | rpmCallbackType | what,
|  | uint64_t | amount,
|  | uint64_t | 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 1350 of file rpmts.c.

References rpmteKey(), and TR_ADDED.

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

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 126 of file pkgio.c.

References RPMTS_OP_MAX.

Referenced by fsmStage(), psmWait(), rpmpsmStage(), rpmReadPackageFile(), rpmtsCheck(), rpmtsCleanDig(), rpmtsCloseDB(), rpmtsCloseSDB(), rpmtsCreate(), rpmtsOrder(), rpmtsPrintStats(), and rpmtsRun().

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 121 of file rpmts.c.

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

Referenced by rpmcliImportPubkey(), rpmts_Match(), rpmts_OpenDB(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsImportPubkey(), rpmtsInitIterator(), rpmtsRebuildDB(), rpmtsRollback(), rpmtsRun(), and rpmVerifySignatures().

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 502 of file rpmts.c.

References _, _free(), addMacro(), delMacro(), RMIL_DEFAULT, rpmdbOpen(), rpmExpandNumeric(), rpmGetPath(), rpmlog(), and RPMLOG_WARNING.

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 1935 of file depends.c.

References _, _autobits, _free(), addQ(), addRelation(), alloca(), D_, freeBadDeps(), isAuto, markLoop(), orderListIndexCmp(), orderListIndex_s::orIndex, orderListIndex_s::pkgKey, RPMAL_NOMATCH, rpmalAdd(), rpmalMakeIndex(), RPMDEPS_FLAG_ANACONDA, RPMDEPS_FLAG_DEPLOOPS, rpmdsFlags(), rpmdsInit(), rpmdsNext(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, RPMPROB_FILTER_NONE, rpmswEnter(), rpmswExit(), rpmteAddedKey(), rpmteDegree(), rpmteDepth(), rpmteDS(), rpmteFI(), rpmteFreeTSI(), rpmteNEVRA(), rpmteNewTSI(), rpmteNpreds(), rpmtePkgFileSize(), rpmteSetAddedKey(), rpmteSetBreadth(), rpmteSetDegree(), rpmteSetDepth(), rpmteSetNpreds(), rpmteSetParent(), rpmteSetTree(), rpmteTree(), rpmteTSI(), rpmteType(), RPMTS_OP_ORDER, rpmtsClean(), rpmtsColor(), rpmtsDFlags(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsiOc(), rpmtsOp(), rpmtsPrefColor(), rpmtsRollback(), rpmtsUnorderedSuccessors(), stpcpy(), TR_ADDED, TR_REMOVED, xcalloc(), and zapRelation().

Referenced by rpmcliInstallOrder(), rpmgiNew(), and rpmts_Order().

rpmPRCO rpmtsPRCO | ( | rpmts | ts | ) |

Get transaction set dependencies.

Parameters:

  | ts | transaction set

Returns:
  transaction set dependencies.

Definition at line 1139 of file rpmts.c.

uint32_t rpmtsPrefColor | ( | rpmts | ts | ) |

Retrieve prefered file color.

Parameters:

  | ts | transaction set

Returns:
  color bits

Definition at line 1499 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 746 of file rpmts.c.

References rpmpsLink.

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

pgpDigParams rpmtsPubkey | ( | const rpmts | ts | ) |

Return OpenPGP pubkey constants.

Parameters:

  | ts | transaction set

Returns:
  pubkey constants.

Definition at line 137 of file pkgio.c.

References pgpGetPubkey(), and rpmtsDig().

int rpmtsRebuildDB | ( | rpmts | ts | ) |

Rebuild the database used by the transaction.

Parameters:

  | ts | transaction set

Returns:
  0 on success

Definition at line 156 of file rpmts.c.

References rpmdbRebuild(), rpmtsOpenDB(), rpmtsVSFlags(), 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 1103 of file rpmts.c.

References rpmsxLink.

Referenced by fsmMkdirs().

rpmte rpmtsRelocateElement | ( | rpmts | ts | ) |

Get current relocate transaction element.

Parameters:

  | ts | transaction set

Returns:
  current relocate transaction element

Definition at line 1438 of file rpmts.c.

Referenced by relocateFileList(), and rpmfiNew().

rpmRC rpmtsRollback | ( | rpmts | rbts,
|  | rpmprobFilterFlags | ignoreSet,
|  | int | running,
|  | rpmte | rbte |
| ) |  |  |

Rollback a failed transaction.

Parameters:

  | rbts | failed transaction set
  | ignoreSet | problems to ignore
  | running | partial transaction?
  | rbte | failed transaction element

Returns:
  RPMRC_OK, or RPMRC_FAIL

Definition at line 933 of file transaction.c.

References _, _free(), _processFailedPackage(), _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, alloca(), rpmQVKArguments_s::depFlags, Fclose(), Fopen(), INSTALL_HASH, INSTALL_UPGRADE, rpmQVKArguments_s::installInterfaceFlags, rpmQVKArguments_s::no_rollback_links, rpmQVKArguments_s::probFilter, rpmQVKArguments_s::rbtid, rpmdbRemove(), rpmExpand(), rpmExpandNumeric(), rpmlog(), RPMLOG_ERR, RPMLOG_NOTICE, RPMRC_OK, rpmRollback(), rpmteNEVRA(), RPMTRANS_FLAG_DIRSTASH, RPMTRANS_FLAG_NOFDIGESTS, RPMTRANS_FLAG_REPACKAGE, RPMTRANS_TYPE_AUTOROLLBACK, RPMTRANS_TYPE_ROLLBACK, rpmtsARBGoal(), rpmtsDFlags(), rpmtsEmpty(), rpmtsFlags(), rpmtsGetRdb(), rpmtsGetTid(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsOpenDB(), rpmtsSetFlags(), rpmtsSetVSFlags(), rpmtsType(), RPMVSF_NEEDPAYLOAD, RPMVSF_NOHDRCHK, TR_REMOVED, rpmQVKArguments_s::transFlags, and Unlink().

Referenced by rpmtsCheck(), rpmtsOrder(), and rpmtsRun().

const char* rpmtsRootDir | ( | rpmts | ts | ) |

Get transaction rootDir, i.e.

path to chroot(2).

Parameters:

  | ts | transaction set

Returns:
  transaction rootDir

Definition at line 988 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 rpmfiNew(), rpmInstallSourcePackage(), 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:

- setup the rpm root dir via rpmtsSetRootDir().
- setup the rpm notify callback via rpmtsSetNotifyCallback().
- setup the rpm transaction flags via rpmtsSetFlags().

Additionally, though not required you may want to:

- setup the rpm verify signature flags via rpmtsSetVSFlags().

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 1117 of file transaction.c.

References _, _free(), _noTransScripts, _noTransTriggers, Chdir(), Chroot(), CPIO_ALL_HARDLINKS, CPIO_MAP_ABSOLUTE, CPIO_MAP_ADDDOT, CPIO_SBIT_CHECK, currentDirectory(), D_, dbiFreeIndexSet(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiIndexSetCount(), ensureOlder(), FA_CREATE, rpmpsm_s::fi, fpCacheCreate(), fpCacheFree(), fpEqual(), fpHashFunction(), fpLookupList(), handleInstInstalledFiles(), handleOverlappedFiles(), handleRmvdInstalledFiles(), headerFree(), htAddEntry(), htCreate(), htFree(), Lstat(), markLinkedFailed(), NOTIFY, 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(), rpmfiFFlags(), rpmfiFN(), rpmfiFree(), rpmfiInit(), RPMFILE_CONFIG, RPMFILE_EXISTS, RPMFILE_SPARSE, rpmfiLink, rpmfiNew(), rpmfiNext(), rpmfiSetFFlags(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMPROB_FILTER_OLDPACKAGE, RPMPROB_FILTER_REPLACEOLDFILES, RPMPROB_FILTER_REPLACEPKG, RPMPROB_PKG_INSTALLED, rpmpsAppend(), rpmpsCreate(), rpmpsFree(), rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), rpmpsNumProblems(), rpmpsTrim(), RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), rpmswEnter(), rpmswExit(), rpmteA(), rpmteAddedKey(), rpmteColor(), rpmteDBOffset(), 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(), rpmtsCurrDir(), rpmtsFilterFlags(), rpmtsFlags(), rpmtsGetRdb(), rpmtsiFi(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsInitDSI(), rpmtsInitIterator(), rpmtsiOc(), rpmtsNElements(), rpmtsOp(), rpmtsOpenDB(), rpmtsProblems(), rpmtsRollback(), rpmtsRootDir(), rpmtsSetChrootDone(), rpmtsSetCurrDir(), rpmtsSetFlags(), rpmtsSetRelocateElement(), rpmtsSetTid(), rpmtsSetVSFlags(), rpmtsType(), rpmtsUnorderedSuccessors(), rpmtsVSFlags(), RPMVSF_NEEDPAYLOAD, rpmpsm_s::scriptTag, sharedCmp(), skipFiles(), rpmpsm_s::stepName, TR_ADDED, TR_REMOVED, rpmpsm_s::unorderedSuccessor, xcalloc(), and xmalloc().

Referenced by rpmcliInstallRun(), 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 1055 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 1081 of file rpmts.c.

Referenced by fsmMapFContext(), fsmMkdirs(), rpmcliInstall(), rpmts_Run(), and runScript().

void rpmtsSetARBGoal | ( | rpmts | ts,
|  | uint32_t | goal |
| ) |  |  |

Set autorollback goal.

Parameters:

  | ts | transaction set
  | goal | autorollback goal

Definition at line 971 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:

  | ts | transaction set
  | chrootDone | new chrootDone flag

Returns:
  previous chrootDone flag

Definition at line 1091 of file rpmts.c.

Referenced by rpmpsmStage(), and rpmtsRun().

uint32_t rpmtsSetColor | ( | rpmts | ts,
|  | uint32_t | color |
| ) |  |  |

Set color bits of transaction set.

Parameters:

  | ts | transaction set
  | color | new color bits

Returns:
  previous color bits

Definition at line 1489 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:

  | ts | transaction set
  | currDir | new transaction currDir (or NULL)

Definition at line 1046 of file rpmts.c.

References _free(), and xstrdup().

Referenced by rpmtsRun().

int rpmtsSetDBMode | ( | rpmts | ts,
|  | int | dbmode |
| ) |  |  |

Set dbmode of transaction set.

Parameters:

  | ts | transaction set
  | dbmode | new dbmode

Returns:
  previous dbmode

Definition at line 1474 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:

  | ts | transaction set
  | depFlags | new dependency flags

Returns:
  previous dependency flags

Definition at line 1412 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:

  | ts | transaction set
  | transFlags | new transaction flags

Returns:
  previous transaction flags

Definition at line 1397 of file rpmts.c.

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

tsmStage rpmtsSetGoal | ( | rpmts | ts,
|  | tsmStage | goal |
| ) |  |  |

Set goal of transaction set.

Parameters:

  | ts | transaction set
  | goal | new goal

Returns:
  previous goal

Definition at line 1459 of file rpmts.c.

References TSM_UNKNOWN.

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

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 1504 of file rpmts.c.

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

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 1108 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 1445 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 1011 of file rpmts.c.

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

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

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 1066 of file rpmts.c.

References fdFree, and fdLink.

Referenced by rpmts_setattro(), and rpmVerifyScript().

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

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 1429 of file rpmts.c.

Referenced by _specQuery(), and parseSpec().

uint32_t rpmtsSetTid | ( | rpmts | ts,
|  | uint32_t | tid |
| ) |  |  |

Set transaction id, i.e.

transaction time stamp.

Parameters:

  | ts | transaction set
  | tid | new transaction id

Returns:
  previous transaction id

Definition at line 1129 of file rpmts.c.

Referenced by rpmtsRun().

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 960 of file rpmts.c.

Referenced by rpmRollback().

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 932 of file rpmts.c.

References pgpDigVSFlags.

Referenced by main(), rpmcliInstall(), rpmcliQuery(), rpmcliVerify(), rpmErase(), rpmInstallSource(), rpmRollback(), rpmts_Create(), rpmts_init(), rpmts_SetVSFlags(), rpmtsRollback(), and rpmtsRun().

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 548 of file rpmts.c.

References _, _free(), alloca(), D_, Fclose(), Ferror(), Fopen(), Fstrerror(), headerFree(), headerGet(), headerLink(), headerSprintf(), _HE_s::p, rpmDataType_u::ptr, rpmdbFreeIterator(), rpmdbInitIterator(), rpmdbNextIterator(), RPMDEPS_FLAG_ADDINDEPS, rpmdsAnyMatchesDep(), rpmdsN(), rpmdsTagN(), rpmExpand(), rpmHeaderFormats, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), rpmtsAddInstallElement(), rpmtsOpenSDB(), rpmDataType_u::str, sugcmp(), _HE_s::tag, TSM_INSTALL, rpmDataType_u::ui32p, and xrealloc().

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

Spec rpmtsSpec | ( | rpmts | ts | ) |

Get spec control structure from transaction set.

Parameters:

  | ts | transaction set

Returns:
  spec control structure

Definition at line 1422 of file rpmts.c.

Referenced by spec_Parse().

rpmTSType rpmtsType | ( | rpmts | ts | ) |

Return the type of a transaction.

Parameters:

  | ts | transaction set

Returns:
  transaction type, 0 on unknown

Definition at line 955 of file rpmts.c.

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

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 977 of file rpmts.c.

Referenced by rpmtsOrder(), and rpmtsRun().

void rpmtsUpdateDSI | ( | const rpmts | ts,
|  | dev_t | dev,
|  | uint32_t | fileSize,
|  | uint32_t | prevSize,
|  | uint32_t | 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 1257 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 168 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 927 of file rpmts.c.

References pgpDigVSFlags.

Referenced by rpmInstallSource(), rpmpsmStage(), rpmts_GetVSFlags(), rpmts_HdrCheck(), rpmtsInitIterator(), rpmtsRebuildDB(), and rpmtsRun().