rpm 5.3.12
Defines | Functions | Variables
lib/rpmte.c File Reference

Routine(s) to handle an "rpmte" transaction element. More...

#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <rpmdb.h>
#include <pkgio.h>
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmte.h"
#include "rpmts.h"
#include "debug.h"
Include dependency graph for rpmte.c:

Go to the source code of this file.

Defines

#define _RPMFI_INTERNAL
#define _RPMTE_INTERNAL

Functions

void rpmteCleanDS (rpmte te)
 Destroy dependency set info of transaction element.
static void delTE (rpmte p)
 Destroy transaction element data.
static void addTE (rpmts ts, rpmte p, Header h, fnpyKey key, rpmRelocation relocs)
 Initialize transaction element data from header.
static void rpmteFini (void *_te)
static rpmte rpmteGetPool (rpmioPool pool)
rpmte rpmteNew (const rpmts ts, Header h, rpmElementType type, fnpyKey key, rpmRelocation relocs, uint32_t dboffset, alKey pkgKey)
 Create a transaction element.
uint32_t rpmteDBInstance (rpmte te)
 Retrieve last instance installed to the database.
void rpmteSetDBInstance (rpmte te, unsigned int instance)
 Set last instance installed to the database.
Header rpmteHeader (rpmte te)
 Retrieve header from transaction element.
Header rpmteSetHeader (rpmte te, Header h)
 Save header into transaction element.
rpmElementType rpmteType (rpmte te)
 Retrieve type of transaction element.
const char * rpmteN (rpmte te)
 Retrieve name string of transaction element.
const char * rpmteE (rpmte te)
 Retrieve epoch string of transaction element.
const char * rpmteV (rpmte te)
 Retrieve version string of transaction element.
const char * rpmteR (rpmte te)
 Retrieve release string of transaction element.
const char * rpmteD (rpmte te)
 Retrieve distepoch string of transaction element.
const char * rpmteA (rpmte te)
 Retrieve arch string of transaction element.
const char * rpmteO (rpmte te)
 Retrieve os string of transaction element.
int rpmteIsSource (rpmte te)
 Retrieve isSource attribute of transaction element.
rpmuint32_t rpmteColor (rpmte te)
 Retrieve color bits of transaction element.
rpmuint32_t rpmteSetColor (rpmte te, rpmuint32_t color)
 Set color bits of transaction element.
rpmuint32_t rpmtePkgFileSize (rpmte te)
 Retrieve size in bytes of package file.
rpmuint32_trpmteOriginTid (rpmte te)
 Retrieve transaction start time that package was first installed.
rpmuint32_trpmteOriginTime (rpmte te)
 Retrieve time that package was first installed.
int rpmteDepth (rpmte te)
 Retrieve dependency tree depth of transaction element.
int rpmteSetDepth (rpmte te, int ndepth)
 Set dependency tree depth of transaction element.
int rpmteBreadth (rpmte te)
 Retrieve dependency tree breadth of transaction element.
int rpmteSetBreadth (rpmte te, int nbreadth)
 Set dependency tree breadth of transaction element.
int rpmteNpreds (rpmte te)
 Retrieve tsort no.
int rpmteSetNpreds (rpmte te, int npreds)
 Set tsort no.
int rpmteTree (rpmte te)
 Retrieve tree index of transaction element.
int rpmteSetTree (rpmte te, int ntree)
 Set tree index of transaction element.
rpmte rpmteParent (rpmte te)
 Retrieve parent transaction element.
rpmte rpmteSetParent (rpmte te, rpmte pte)
 Set parent transaction element.
int rpmteDegree (rpmte te)
 Retrieve number of children of transaction element.
int rpmteSetDegree (rpmte te, int ndegree)
 Set number of children of transaction element.
tsortInfo rpmteTSI (rpmte te)
 Retrieve tsort info for transaction element.
void rpmteFreeTSI (rpmte te)
 Destroy tsort info of transaction element.
void rpmteNewTSI (rpmte te)
 Initialize tsort info of transaction element.
alKey rpmteAddedKey (rpmte te)
alKey rpmteSetAddedKey (rpmte te, alKey npkgKey)
int rpmteDBOffset (rpmte te)
 Retrieve rpmdb instance of TR_REMOVED transaction element.
const char * rpmteNEVR (rpmte te)
 Retrieve name-version-release string from transaction element.
const char * rpmteNEVRA (rpmte te)
 Retrieve name-version-release.arch string from transaction element.
const char * rpmtePkgid (rpmte te)
 Retrieve pkgid string from transaction element.
const char * rpmteHdrid (rpmte te)
 Retrieve hdrid string from transaction element.
const char * rpmteSourcerpm (rpmte te)
 Retrieve sourcerpm string from transaction element.
FD_t rpmteFd (rpmte te)
 Retrieve file handle from transaction element.
fnpyKey rpmteKey (rpmte te)
 Retrieve key from transaction element.
rpmds rpmteDS (rpmte te, rpmTag tag)
 Retrieve dependency tag set from transaction element.
rpmfi rpmteFI (rpmte te, rpmTag tag)
 Retrieve file info tag set from transaction element.
rpmfi rpmteSetFI (rpmte te, rpmfi fi)
void rpmteColorDS (rpmte te, rpmTag tag)
 Calculate transaction element dependency colors/refs from file info.
int rpmteChain (rpmte p, rpmte q, Header oh, const char *msg)
 Chain p <-> q forward/backward transaction element links.
int rpmtsiOc (rpmtsi tsi)
 Return transaction element index.
static void rpmtsiFini (void *_tsi)
static rpmtsi rpmtsiGetPool (rpmioPool pool)
rpmtsi XrpmtsiInit (rpmts ts, const char *fn, unsigned int ln)
 Create transaction element iterator.
static rpmte rpmtsiNextElement (rpmtsi tsi)
 Return next transaction element.
rpmte rpmtsiNext (rpmtsi tsi, rpmElementType type)
 Return next transaction element of type.
Header rpmteDBHeader (rpmts ts, uint32_t rec)
Header rpmteFDHeader (rpmts ts, rpmte te)
int rpmteOpen (rpmte te, rpmts ts, int reload_fi)
int rpmteClose (rpmte te, rpmts ts, int reset_fi)
int rpmteFailed (rpmte te)
int rpmteHaveTransScript (rpmte te, rpmTag tag)

Variables

int _rpmte_debug = 0
rpmioPool _rpmtePool
static int __mydebug = 0
rpmioPool _rpmtsiPool

Detailed Description

Routine(s) to handle an "rpmte" transaction element.

Definition in file rpmte.c.


Define Documentation

#define _RPMFI_INTERNAL

Definition at line 16 of file rpmte.c.

#define _RPMTE_INTERNAL

Definition at line 19 of file rpmte.c.


Function Documentation

static void addTE ( rpmts  ts,
rpmte  p,
Header  h,
fnpyKey  key,
rpmRelocation  relocs 
) [static]

Initialize transaction element data from header.

Parameters:
tstransaction set
ptransaction element
hheader
key(TR_ADDED) package retrieval key (e.g. file name)
relocs(TR_ADDED) package file relocations

Definition at line 98 of file rpmte.c.

References _free(), alloca(), _HE_s::c, headerGet(), headerIsEntry(), _HE_s::p, rpmDataType_u::ptr, rpmdsNewPRCO(), rpmfiDupeRelocations(), rpmfiNew(), RPMTAG_HDRID, RPMTAG_PKGID, rpmteColorDS(), rpmtsSetRelocateElement(), rpmDataType_u::str, _HE_s::tag, rpmDataType_u::ui32p, rpmDataType_u::ui8p, xmalloc(), and xstrdup().

Referenced by rpmteNew().

static void delTE ( rpmte  p) [static]

Destroy transaction element data.

Parameters:
ptransaction element

Definition at line 41 of file rpmte.c.

References _free(), argvFree(), fdFree(), headerFree(), rpmfiFree(), rpmfiFreeRelocations(), and rpmteCleanDS().

Referenced by rpmteFini().

alKey rpmteAddedKey ( rpmte  te)

Definition at line 509 of file rpmte.c.

References RPMAL_NOMATCH.

Referenced by rpmte_AddedKey(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), and rpmtsAddUpgrades().

int rpmteClose ( rpmte  te,
rpmts  ts,
int  reset_fi 
)
Header rpmteDBHeader ( rpmts  ts,
uint32_t  rec 
)

Definition at line 835 of file rpmte.c.

References headerLink(), RPMDBI_PACKAGES, rpmmiFree(), rpmmiNext(), and rpmtsInitIterator().

Referenced by rpmteOpen().

int rpmteFailed ( rpmte  te)

Definition at line 938 of file rpmte.c.

Referenced by rpmtsProcess().

Header rpmteFDHeader ( rpmts  ts,
rpmte  te 
)
static void rpmteFini ( void *  _te) [static]

Definition at line 212 of file rpmte.c.

References delTE().

Referenced by rpmteGetPool().

static rpmte rpmteGetPool ( rpmioPool  pool) [static]

Definition at line 223 of file rpmte.c.

References _rpmte_debug, _rpmtePool, rpmioGetPool(), rpmioNewPool(), and rpmteFini().

Referenced by rpmteNew().

int rpmteHaveTransScript ( rpmte  te,
rpmTag  tag 
)

Definition at line 943 of file rpmte.c.

Referenced by rpmtsRunScript().

int rpmteOpen ( rpmte  te,
rpmts  ts,
int  reload_fi 
)
alKey rpmteSetAddedKey ( rpmte  te,
alKey  npkgKey 
)

Definition at line 514 of file rpmte.c.

References RPMAL_NOMATCH.

Referenced by rpmtsAddInstallElement().

rpmfi rpmteSetFI ( rpmte  te,
rpmfi  fi 
)

Definition at line 595 of file rpmte.c.

References rpmfiFree(), and rpmfiLink().

Referenced by rpmteClose(), and rpmtsPrepare().

static void rpmtsiFini ( void *  _tsi) [static]

Definition at line 755 of file rpmte.c.

References rpmtsFree().

Referenced by rpmtsiGetPool().

static rpmtsi rpmtsiGetPool ( rpmioPool  pool) [static]

Definition at line 769 of file rpmte.c.

References _rpmte_debug, _rpmtsiPool, rpmioGetPool(), rpmioNewPool(), and rpmtsiFini().

Referenced by XrpmtsiInit().

static rpmte rpmtsiNextElement ( rpmtsi  tsi) [static]

Return next transaction element.

Parameters:
tsitransaction element iterator
Returns:
transaction element, NULL on termination

Definition at line 803 of file rpmte.c.

References rpmtsElement(), and rpmtsNElements().

Referenced by rpmtsiNext().


Variable Documentation

int __mydebug = 0 [static]

Definition at line 674 of file rpmte.c.

int _rpmte_debug = 0

Definition at line 26 of file rpmte.c.

Referenced by rpmte_Debug(), rpmteGetPool(), and rpmtsiGetPool().

Definition at line 221 of file rpmte.c.

Referenced by rpmteGetPool().

Definition at line 767 of file rpmte.c.

Referenced by rpmtsiGetPool().