#include "system.h"
#include <rpmlib.h>
#include "psm.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmte.h"
#include "rpmts.h"
#include "debug.h"
Go to the source code of this file.
Defines | |
#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. | |
rpmte | rpmteFree (rpmte te) |
Destroy a transaction element. | |
rpmte | rpmteNew (const rpmts ts, Header h, rpmElementType type, fnpyKey key, rpmRelocation *relocs, int dboffset, alKey pkgKey) |
Create a transaction element. | |
unsigned int | 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 * | 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. | |
uint_32 | rpmteColor (rpmte te) |
Retrieve color bits of transaction element. | |
uint_32 | rpmteSetColor (rpmte te, uint_32 color) |
Set color bits of transaction element. | |
uint_32 | rpmtePkgFileSize (rpmte te) |
Retrieve size in bytes of package file. | |
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) |
Retrieve pkgKey of TR_ADDED transaction element. | |
alKey | rpmteSetAddedKey (rpmte te, alKey npkgKey) |
Set pkgKey of TR_ADDED transaction element. | |
alKey | rpmteDependsOnKey (rpmte te) |
Retrieve dependent pkgKey of TR_REMOVED transaction element. | |
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. | |
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. | |
void | rpmteColorDS (rpmte te, rpmTag tag) |
Calculate transaction element dependency colors/refs from file info. | |
int | rpmtsiOc (rpmtsi tsi) |
Return transaction element index. | |
rpmtsi | XrpmtsiFree (rpmtsi tsi, const char *fn, unsigned int ln) |
Destroy transaction element iterator. | |
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. | |
Variables | |
int | _rpmte_debug = 0 |
Definition in file rpmte.c.
static void addTE | ( | rpmts | ts, | |
rpmte | p, | |||
Header | h, | |||
fnpyKey | key, | |||
rpmRelocation * | relocs | |||
) | [static] |
Initialize transaction element data from header.
ts | transaction set | |
p | transaction element | |
h | header | |
key | (TR_ADDED) package retrieval key (e.g. file name) | |
relocs | (TR_ADDED) package file relocations |
Definition at line 85 of file rpmte.c.
References headerGetEntryMinMemory(), headerIsEntry(), hGetNEVR(), rpmRelocation_s::newPath, rpmRelocation_s::oldPath, RPM_MACHTABLE_INSTARCH, RPM_MACHTABLE_INSTOS, rpmdsNew(), rpmdsThis(), rpmfiNew(), rpmMachineScore(), RPMSENSE_EQUAL, RPMTAG_ARCH, RPMTAG_BASENAMES, RPMTAG_CONFLICTNAME, RPMTAG_EPOCH, RPMTAG_OBSOLETENAME, RPMTAG_OS, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_SOURCEPACKAGE, rpmteColorDS(), rpmtsSetRelocateElement(), stpcpy(), xmalloc(), and xstrdup().
Referenced by rpmteNew().
static void delTE | ( | rpmte | p | ) | [static] |
Destroy transaction element data.
p | transaction element |
Definition at line 38 of file rpmte.c.
References _free(), fdFree, headerFree(), rpmRelocation_s::newPath, rpmRelocation_s::oldPath, rpmfiFree(), and rpmteCleanDS().
Referenced by rpmteFree().
const char* rpmteA | ( | rpmte | te | ) |
Retrieve arch string of transaction element.
te | transaction element |
Definition at line 292 of file rpmte.c.
Referenced by rpmpsmStage(), rpmte_A(), rpmte_print(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmtsRun().
Retrieve pkgKey of TR_ADDED transaction element.
te | transaction element |
Definition at line 454 of file rpmte.c.
References RPMAL_NOMATCH.
Referenced by addRelation(), rpmte_AddedKey(), rpmtsAddInstallElement(), rpmtsOrder(), and rpmtsRun().
int rpmteBreadth | ( | rpmte | te | ) |
void rpmteCleanDS | ( | rpmte | te | ) |
Destroy dependency set info of transaction element.
te | transaction element |
Definition at line 25 of file rpmte.c.
References rpmdsFree().
Referenced by delTE(), and rpmtsClean().
Retrieve color bits of transaction element.
te | transaction element |
Definition at line 307 of file rpmte.c.
Referenced by addQ(), handleInstInstalledFiles(), rpmte_Color(), rpmtsCheck(), and rpmtsRun().
Calculate transaction element dependency colors/refs from file info.
te | transaction element | |
tag | dependency tag (RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME) |
Definition at line 540 of file rpmte.c.
References alloca(), rpmdsCount(), rpmdsInit(), rpmdsNext(), rpmdsSetColor(), rpmdsSetRefs(), rpmfiFC(), rpmfiFColor(), rpmfiFDepends(), rpmfiInit(), rpmfiNext(), RPMTAG_BASENAMES, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmteDS(), and rpmteFI().
Referenced by addTE().
unsigned int rpmteDBInstance | ( | rpmte | te | ) |
Retrieve last instance installed to the database.
te | transaction element |
Definition at line 240 of file rpmte.c.
Referenced by _rpmtsAddRollbackElement().
int rpmteDBOffset | ( | rpmte | te | ) |
Retrieve rpmdb instance of TR_REMOVED transaction element.
te | transaction element |
Definition at line 475 of file rpmte.c.
Referenced by rpmte_DBOffset(), and rpmtsRun().
int rpmteDegree | ( | rpmte | te | ) |
Retrieve number of children of transaction element.
te | transaction element |
Definition at line 406 of file rpmte.c.
Referenced by rpmte_Degree(), and rpmtsOrder().
Retrieve dependent pkgKey of TR_REMOVED transaction element.
te | transaction element |
Definition at line 470 of file rpmte.c.
References RPMAL_NOMATCH.
Referenced by rpmte_DependsOnKey(), rpmtsOrder(), and rpmtsRun().
int rpmteDepth | ( | rpmte | te | ) |
Retrieve dependency tree depth of transaction element.
te | transaction element |
Definition at line 327 of file rpmte.c.
Referenced by addRelation(), rpmGraph(), rpmte_Depth(), and rpmtsOrder().
Retrieve dependency tag set from transaction element.
te | transaction element | |
tag | dependency tag |
Definition at line 502 of file rpmte.c.
References RPMTAG_CONFLICTNAME, RPMTAG_NAME, RPMTAG_OBSOLETENAME, RPMTAG_PROVIDENAME, and RPMTAG_REQUIRENAME.
Referenced by rpmte_DS(), rpmteColorDS(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmtsOrder().
const char* rpmteE | ( | rpmte | te | ) |
Retrieve epoch string of transaction element.
te | transaction element |
Definition at line 277 of file rpmte.c.
Referenced by ensureOlder(), rpmpsmStage(), rpmte_E(), and rpmtsRun().
Retrieve file handle from transaction element.
te | transaction element |
Definition at line 490 of file rpmte.c.
Referenced by rpmpsmStage(), and rpmtsRun().
Retrieve file info tag set from transaction element.
te | transaction element | |
tag | file info tag (RPMTAG_BASENAMES) |
Definition at line 527 of file rpmte.c.
References RPMTAG_BASENAMES.
Referenced by rpmte_FI(), rpmteColorDS(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmtsCheckDSIProblems().
Destroy a transaction element.
te | transaction element |
Definition at line 199 of file rpmte.c.
References _free(), and delTE().
Referenced by rpmpsmFree(), rpmtsAddInstallElement(), and rpmtsEmpty().
void rpmteFreeTSI | ( | rpmte | te | ) |
Destroy tsort info of transaction element.
te | transaction element |
Definition at line 428 of file rpmte.c.
References _free(), and rpmteTSI().
Referenced by rpmteNewTSI(), and rpmtsOrder().
Retrieve header from transaction element.
te | transaction element |
Definition at line 252 of file rpmte.c.
References headerLink().
Referenced by rpmgiNext().
int rpmteIsSource | ( | rpmte | te | ) |
Retrieve isSource attribute of transaction element.
te | transaction element |
Definition at line 302 of file rpmte.c.
Referenced by rpmtsAddInstallElement().
Retrieve key from transaction element.
te | transaction element |
Definition at line 497 of file rpmte.c.
Referenced by ensureOlder(), handleInstInstalledFiles(), handleOverlappedFiles(), relocateFileList(), rpmte_Key(), rpmtsAddInstallElement(), rpmtsCheckDSIProblems(), rpmtsGetKeys(), rpmtsNotify(), and rpmtsRun().
const char* rpmteN | ( | rpmte | te | ) |
Retrieve name string of transaction element.
te | transaction element |
Definition at line 272 of file rpmte.c.
Referenced by _rpmtsAddRollbackElement(), ensureOlder(), getRepackageHeaderFromTE(), ignoreDep(), rpmGraph(), rpmpsmStage(), rpmte_N(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsRun(), rpmtsScoreInit(), and runTriggers().
const char* rpmteNEVR | ( | rpmte | te | ) |
Retrieve name-version-release string from transaction element.
te | transaction element |
Definition at line 480 of file rpmte.c.
Referenced by ensureOlder(), handleInstInstalledFiles(), handleOverlappedFiles(), relocateFileList(), rpmpsmStage(), rpmte_NEVR(), rpmte_print(), rpmtsCheck(), rpmtsCheckDSIProblems(), and rpmtsRun().
const char* rpmteNEVRA | ( | rpmte | te | ) |
Retrieve name-version-release.arch string from transaction element.
te | transaction element |
Definition at line 485 of file rpmte.c.
Referenced by _rpmtsAddRollbackElement(), rpmtsCheck(), rpmtsOrder(), and zapRelation().
rpmte rpmteNew | ( | const rpmts | ts, | |
Header | h, | |||
rpmElementType | type, | |||
fnpyKey | key, | |||
rpmRelocation * | relocs, | |||
int | dboffset, | |||
alKey | pkgKey | |||
) |
Create a transaction element.
ts | transaction set | |
h | header | |
type | TR_ADDED/TR_REMOVED | |
key | (TR_ADDED) package retrieval key (e.g. file name) | |
relocs | (TR_ADDED) package file relocations | |
dboffset | (TR_REMOVED) rpmdb instance | |
pkgKey | associated added package (if any) |
Definition at line 209 of file rpmte.c.
References addTE(), headerGetEntry(), RPMTAG_SIGSIZE, TR_ADDED, TR_REMOVED, and xcalloc().
Referenced by removePackage(), and rpmtsAddInstallElement().
void rpmteNewTSI | ( | rpmte | te | ) |
Initialize tsort info of transaction element.
te | transaction element |
Definition at line 446 of file rpmte.c.
References rpmteFreeTSI(), and xcalloc().
Referenced by rpmtsOrder().
int rpmteNpreds | ( | rpmte | te | ) |
Retrieve tsort no.
of predecessors of transaction element.
te | transaction element |
Definition at line 357 of file rpmte.c.
Referenced by rpmte_Npreds(), and rpmtsOrder().
const char* rpmteO | ( | rpmte | te | ) |
Retrieve os string of transaction element.
te | transaction element |
Definition at line 297 of file rpmte.c.
Referenced by rpmpsmStage(), rpmte_O(), rpmtsAddInstallElement(), rpmtsCheck(), and rpmtsRun().
Retrieve parent transaction element.
te | transaction element |
Definition at line 387 of file rpmte.c.
Referenced by rpmGraph(), and rpmte_Parent().
Retrieve size in bytes of package file.
te | transaction element |
Definition at line 322 of file rpmte.c.
Referenced by rpmte_PkgFileSize(), and rpmtsOrder().
const char* rpmteR | ( | rpmte | te | ) |
Retrieve release string of transaction element.
te | transaction element |
Definition at line 287 of file rpmte.c.
Referenced by ensureOlder(), rpmpsmStage(), rpmte_R(), and rpmtsRun().
Set pkgKey of TR_ADDED transaction element.
te | transaction element | |
npkgKey | new pkgKey |
Definition at line 459 of file rpmte.c.
References RPMAL_NOMATCH.
Referenced by rpmtsAddInstallElement().
int rpmteSetBreadth | ( | rpmte | te, | |
int | nbreadth | |||
) |
Set dependency tree breadth of transaction element.
te | transaction element | |
nbreadth | new breadth |
Definition at line 347 of file rpmte.c.
Referenced by rpmtsOrder().
void rpmteSetDBInstance | ( | rpmte | te, | |
unsigned int | instance | |||
) |
Set last instance installed to the database.
te | transaction element | |
instance | Database instance of last install element. |
Definition at line 246 of file rpmte.c.
Referenced by rpmpsmStage().
int rpmteSetDegree | ( | rpmte | te, | |
int | ndegree | |||
) |
Set number of children of transaction element.
te | transaction element | |
ndegree | new number of children |
Definition at line 411 of file rpmte.c.
Referenced by rpmtsOrder().
int rpmteSetDepth | ( | rpmte | te, | |
int | ndepth | |||
) |
Set dependency tree depth of transaction element.
te | transaction element | |
ndepth | new depth |
Definition at line 332 of file rpmte.c.
Referenced by addRelation(), and rpmtsOrder().
Save header into transaction element.
te | transaction element | |
h | header |
Definition at line 257 of file rpmte.c.
References headerFree(), and headerLink().
Referenced by rpmtsAddInstallElement().
int rpmteSetNpreds | ( | rpmte | te, | |
int | npreds | |||
) |
Set tsort no.
of predecessors of transaction element.
te | transaction element | |
npreds | new no. of predecessors |
Definition at line 362 of file rpmte.c.
Referenced by rpmtsOrder().
Set parent transaction element.
te | transaction element | |
pte | new parent transaction element |
Definition at line 392 of file rpmte.c.
Referenced by rpmtsOrder().
int rpmteSetTree | ( | rpmte | te, | |
int | ntree | |||
) |
Set tree index of transaction element.
te | transaction element | |
ntree | new tree index |
Definition at line 377 of file rpmte.c.
Referenced by rpmtsOrder().
int rpmteTree | ( | rpmte | te | ) |
Retrieve tree index of transaction element.
te | transaction element |
Definition at line 372 of file rpmte.c.
Referenced by rpmGraph(), rpmte_Tree(), and rpmtsOrder().
Retrieve tsort info for transaction element.
te | transaction element |
Definition at line 421 of file rpmte.c.
Referenced by addQ(), addRelation(), markLoop(), rpmteFreeTSI(), rpmtsOrder(), and zapRelation().
rpmElementType rpmteType | ( | rpmte | te | ) |
Retrieve type of transaction element.
te | transaction element |
Definition at line 267 of file rpmte.c.
Referenced by _rpmtsAddRollbackElement(), _rpmtsRollback(), addRelation(), fsmMapPath(), handleOverlappedFiles(), mapInitIterator(), rpmfiTypeString(), rpmte_print(), rpmte_TEType(), rpmtsAddInstallElement(), rpmtsGetKeys(), rpmtsOrder(), rpmtsRun(), and rpmtsScoreInit().
const char* rpmteV | ( | rpmte | te | ) |
Retrieve version string of transaction element.
te | transaction element |
Definition at line 282 of file rpmte.c.
Referenced by ensureOlder(), rpmpsmStage(), rpmte_V(), and rpmtsRun().
rpmte rpmtsiNext | ( | rpmtsi | tsi, | |
rpmElementType | type | |||
) |
Return next transaction element of type.
tsi | transaction element iterator | |
type | transaction element type selector (0 for any) |
Definition at line 673 of file rpmte.c.
References rpmtsiNextElement().
Referenced by _rpmtsAddRollbackElement(), _rpmtsRollback(), addRelation(), rpmgiNext(), rpmGraph(), rpmts_iternext(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsClean(), rpmtsEmpty(), rpmtsGetKeys(), rpmtsOrder(), rpmtsRun(), and rpmtsScoreInit().
Return next transaction element.
tsi | transaction element iterator |
Definition at line 651 of file rpmte.c.
References rpmtsElement(), and rpmtsNElements().
Referenced by rpmtsiNext().
int rpmtsiOc | ( | rpmtsi | tsi | ) |
Return transaction element index.
tsi | transaction element iterator |
Definition at line 608 of file rpmte.c.
Referenced by rpmtsOrder(), and rpmtsRun().
Destroy transaction element iterator.
tsi | transaction element iterator | |
fn | ||
ln |
Definition at line 613 of file rpmte.c.
References _free(), _rpmte_debug, and rpmtsFree().
Create transaction element iterator.
ts | transaction set | |
fn | ||
ln |
Definition at line 629 of file rpmte.c.
References _rpmte_debug, RPMTRANS_FLAG_REVERSE, rpmtsFlags(), rpmtsLink, rpmtsNElements(), and xcalloc().
int _rpmte_debug = 0 |