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 <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 | _RPMDB_INTERNAL /* XXX almost opaque sigh */
#define | _RPMTE_INTERNAL /* XXX te->h */
#define | _RPMTS_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 | rpmtsInitDB (rpmts ts, int dbmode)
| Initialize the database used by the transaction. More...
int | rpmtsRebuildDB (rpmts ts)
| Rebuild the database used by the transaction. More...
int | rpmtsVerifyDB (rpmts ts)
| Verify 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 prefered 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 _RPMDB_INTERNAL /* XXX almost opaque sigh */

Definition at line 20 of file rpmts.c.

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

Definition at line 29 of file rpmts.c.

#define _RPMTS_INTERNAL

Definition at line 32 of file rpmts.c.

#define ST_RDONLY 1

Referenced by rpmtsCheckDSIProblems(), and rpmtsInitDSI().

## Function Documentation

static void rpmtsFini | ( | void * | _ts | ) |

static

Definition at line 626 of file rpmts.c.

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

Referenced by rpmtsGetPool().

static rpmts rpmtsGetPool | ( | rpmioPool | pool | ) |

static

Definition at line 692 of file rpmts.c.

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

Referenced by rpmtsCreate().

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

static

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

References _hdr_getops, _hdr_loadops, 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 rpmtsFini().

FD_t rpmtsScriptFd | ( | rpmts | ts | ) |

Definition at line 884 of file rpmts.c.

Referenced by runScript().

void rpmtsSetScriptFd | ( | rpmts | ts,
|  | FD_t | scriptFd
| ) |  |

Definition at line 895 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 488 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 294 of file rpmts.c.

Referenced by rpmtsSolve().

## Variable Documentation

rpmop _hdr_getops

Definition at line 83 of file header.c.

Referenced by rpmtsPrintStats().

rpmop _hdr_loadops

Definition at line 79 of file header.c.

Referenced by rpmtsPrintStats().

int _rpmts_debug = 0

Definition at line 83 of file rpmts.c.

Referenced by rpmts_AddErase(), rpmts_AddInstall(), rpmts_alloc(), rpmts_Check(), rpmts_Clean(), rpmts_CloseDB(), rpmts_dealloc(), rpmts_Debug(), rpmts_free(), rpmts_HdrCheck(), rpmts_HdrFromFdno(), rpmts_IDTXglob(), rpmts_IDTXload(), 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(), and rpmtsGetPool().

int _rpmts_macros = 0

Definition at line 89 of file rpmts.c.

Referenced by rpmtsFini().

int _rpmts_stats = 0

Definition at line 86 of file rpmts.c.

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

rpmioPool _rpmtsPool

Definition at line 690 of file rpmts.c.

Referenced by rpmtsGetPool().