# lib/rpmts.c File Reference

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

`#include "system.h"`
`#include <rpmio_internal.h>`
`#include <rpmbc.h>`
`#include <rpmio.h>`
`#include <rpmurl.h>`
`#include <rpmpgp.h>`
`#include <rpmcb.h>`
`#include <rpmmacro.h>`
`#include <rpmlib.h>`
`#include "rpmdb.h"`
`#include "rpmevr.h"`
`#include "rpmal.h"`
`#include "rpmds.h"`
`#include "rpmfi.h"`
`#include "rpmlock.h"`
`#include "rpmns.h"`
`#include "rpmte.h"`
`#include "rpmts.h"`
`#include "fs.h"`
`#include "debug.h"`
Include dependency graph for rpmts.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines

#define | _RPMDB_INTERNAL
#define | _RPMEVR_INTERNAL
#define | _RPMTE_INTERNAL
#define | _RPMTS_INTERNAL
#define | ST_RDONLY 1

## Functions

rpmts | XrpmtsUnlink (rpmts ts, const char *msg, const char *fn, unsigned ln)
rpmts | XrpmtsLink (rpmts ts, const char *msg, const char *fn, unsigned ln)
int | rpmtsCloseDB (rpmts ts)
| Close the database used by the transaction.
int | rpmtsOpenDB (rpmts ts, int dbmode)
| Open the database used by the transaction.
int | rpmtsInitDB (rpmts ts, int dbmode)
| Initialize the database used by the transaction.
int | rpmtsRebuildDB (rpmts ts)
| Rebuild the database used by the transaction.
int | rpmtsVerifyDB (rpmts ts)
| Verify the database used by the transaction.
rpmdbMatchIterator | rpmtsInitIterator (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
| Return transaction database iterator.
rpmRC | rpmtsImportPubkey (const rpmts ts, const unsigned char *pkt, ssize_t pktlen)
| Import public key packet(s).
int | rpmtsCloseSDB (rpmts ts)
| Close the database used by the transaction to solve dependencies.
int | rpmtsOpenSDB (rpmts ts, int dbmode)
| Open the database used by the transaction to solve dependencies.
static int | sugcmp (const void *a, const void *b)
| Compare suggested package resolutions (qsort/bsearch).
int | rpmtsSolve (rpmts ts, rpmds ds, const void *data)
| Attempt to solve a needed dependency using the solve database.
int | rpmtsAvailable (rpmts ts, const rpmds ds)
| Attempt to solve a needed dependency using memory resident tables.
int | rpmtsSetSolveCallback (rpmts ts, int(*solve)(rpmts ts, rpmds key, const void *data), const void *solveData)
rpmps | rpmtsProblems (rpmts ts)
| Return current transaction set problems.
void | rpmtsClean (rpmts ts)
| Free memory needed only for dependency checks and ordering.
void | rpmtsEmpty (rpmts ts)
| Re-create an empty transaction set.
static void | rpmtsPrintStat (const char *name, struct rpmop_s *op)
static void | rpmtsPrintStats (rpmts ts)
rpmts | rpmtsFree (rpmts ts)
| Destroy transaction set, closing the database as well.
rpmVSFlags | rpmtsVSFlags (rpmts ts)
| Get verify signatures flag(s).
rpmVSFlags | rpmtsSetVSFlags (rpmts ts, rpmVSFlags vsflags)
| Set verify signatures flag(s).
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.
int | rpmtsUnorderedSuccessors (rpmts ts, int first)
| Set index of 1st element of successors.
const char * | rpmtsRootDir (rpmts ts)
| Get transaction rootDir, i.e.
void | rpmtsSetRootDir (rpmts ts, const char *rootDir)
| Set transaction rootDir, i.e.
const char * | rpmtsCurrDir (rpmts ts)
| Get transaction currDir, i.e.
void | rpmtsSetCurrDir (rpmts ts, const char *currDir)
| Set transaction currDir, i.e.
FD_t | rpmtsScriptFd (rpmts ts)
| Get transaction script file handle, i.e.
void | rpmtsSetScriptFd (rpmts ts, FD_t scriptFd)
| Set transaction script file handle, i.e.
int | rpmtsSELinuxEnabled (rpmts ts)
| Get selinuxEnabled flag, i.e.
int | rpmtsChrootDone (rpmts ts)
| Get chrootDone flag, i.e.
int | rpmtsSetChrootDone (rpmts ts, int chrootDone)
| Set chrootDone flag, i.e.
rpmsx | rpmtsREContext (rpmts ts)
| Get file security context patterns.
int | rpmtsSetREContext (rpmts ts, rpmsx sx)
| Get file security context patterns.
uint32_t | rpmtsGetTid (rpmts ts)
| Get transaction id, i.e.
uint32_t | rpmtsSetTid (rpmts ts, uint32_t tid)
| Set transaction id, i.e.
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 | rpmtsSetColor (rpmts ts, uint32_t color)
| Set color bits of transaction set.
uint32_t | rpmtsPrefColor (rpmts ts)
| Retrieve prefered file color.
int | rpmtsSetNotifyCallback (rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
| Set transaction notify callback function and argument.
rpmts | rpmtsCreate (void)
| Create an empty transaction set.

## Variables

int | _rpmts_debug = 0
int | _rpmts_stats = 0
int | _rpmts_macros = 0
rpmop | _hdr_loadops
rpmop | _hdr_getops

## Detailed Description

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

Definition in file rpmts.c.

## Define Documentation

#define _RPMDB_INTERNAL

Definition at line 16 of file rpmts.c.

#define _RPMEVR_INTERNAL

Definition at line 19 of file rpmts.c.

#define _RPMTE_INTERNAL

Definition at line 28 of file rpmts.c.

#define _RPMTS_INTERNAL

Definition at line 31 of file rpmts.c.

#define ST_RDONLY 1

Referenced by rpmtsCheckDSIProblems(), and rpmtsInitDSI().

## Function Documentation

static void rpmtsPrintStat | ( | const char * | name,
|  | struct rpmop_s * | op |
| ) |  |  | `[static]`

Definition at line 812 of file rpmts.c.

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

Referenced by rpmtsPrintStats().

static void rpmtsPrintStats | ( | rpmts | ts | ) | `[static]`

Definition at line 829 of file rpmts.c.

References rpmswAdd(), rpmswExit(), RPMTS_OP_CHECK, RPMTS_OP_COMPRESS, RPMTS_OP_DBADD, RPMTS_OP_DBDEL, RPMTS_OP_DBGET, RPMTS_OP_DBPUT, RPMTS_OP_DBREMOVE, RPMTS_OP_DIGEST, RPMTS_OP_ERASE, RPMTS_OP_FINGERPRINT, RPMTS_OP_HDRGET, RPMTS_OP_HDRLOAD, RPMTS_OP_INSTALL, RPMTS_OP_ORDER, RPMTS_OP_READHDR, RPMTS_OP_REPACKAGE, RPMTS_OP_SCRIPTLETS, RPMTS_OP_SIGNATURE, RPMTS_OP_TOTAL, RPMTS_OP_UNCOMPRESS, rpmtsOp(), and rpmtsPrintStat().

Referenced by rpmtsFree().

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

Definition at line 731 of file rpmts.c.

Referenced by rpmts_Check().

static int sugcmp | ( | const void * | a,
|  | const void * | b |
| ) |  |  | `[static]`

Compare suggested package resolutions (qsort/bsearch).

Parameters:

  | a | 1st instance address
  | b | 2nd instance address

Returns:
  result of comparison

Definition at line 540 of file rpmts.c.

Referenced by rpmtsSolve().

rpmts XrpmtsLink | ( | rpmts | ts,
|  | const char * | msg,
|  | const char * | fn,
|  | unsigned | ln |
| ) |  |  |

Todo:
  Remove debugging entry from the ABI.

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

References _rpmts_debug.

## Variable Documentation

rpmop _hdr_getops

Definition at line 82 of file header.c.

rpmop _hdr_loadops

Definition at line 78 of file header.c.

int _rpmts_debug = 0

Definition at line 79 of file rpmts.c.

Referenced by rpmts_AddErase(), rpmts_AddInstall(), rpmts_alloc(), rpmts_Check(), rpmts_Clean(), rpmts_CloseDB(), rpmts_Create(), rpmts_dealloc(), rpmts_Debug(), rpmts_free(), rpmts_HdrCheck(), rpmts_HdrFromFdno(), rpmts_IDTXglob(), rpmts_IDTXload(), rpmts_init(), rpmts_InitDB(), rpmts_iter(), rpmts_iternext(), rpmts_Match(), rpmts_new(), rpmts_Next(), rpmts_OpenDB(), rpmts_Order(), rpmts_PgpImportPubkey(), rpmts_PgpPrtPkts(), rpmts_Problems(), rpmts_RebuildDB(), rpmts_Rollback(), rpmts_Run(), rpmts_SetColor(), rpmts_SetDFlags(), rpmts_SetFlags(), rpmts_SetProbFilter(), rpmts_SetVSFlags(), rpmts_SolveCallback(), rpmts_VerifyDB(), rpmtsCallback(), XrpmtsLink(), and XrpmtsUnlink().

int _rpmts_macros = 0

Definition at line 85 of file rpmts.c.

Referenced by rpmtsFree().

int _rpmts_stats = 0

Definition at line 82 of file rpmts.c.

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