Files | |
file | rpmte.h |
Structures used for an "rpmte" transaction element. | |
file | rpmts.h |
Structures and prototypes used for an "rpmts" transaction set. | |
Typedefs | |
typedef enum rpmtransFlags_e | rpmtransFlags |
Bit(s) to control rpmtsRun() operation. | |
typedef enum rpmVSFlags_e | rpmVSFlags |
Bit(s) to control digest and signature verification. | |
typedef enum rpmtsOpX_e | rpmtsOpX |
Indices for timestamps. | |
Enumerations | |
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_REVERSE = (1 << 15), 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_NOMD5 = (1 << 27), RPMTRANS_FLAG_NOFILEDIGEST = (1 << 27), RPMTRANS_FLAG_NOSUGGEST = (1 << 28), RPMTRANS_FLAG_ADDINDEPS = (1 << 29), RPMTRANS_FLAG_NOCONFIGS = (1 << 30), RPMTRANS_FLAG_DEPLOOPS = (1 << 31) } |
Bit(s) to control rpmtsRun() operation. More... | |
enum | rpmVSFlags_e { RPMVSF_DEFAULT = 0, RPMVSF_NOHDRCHK = (1 << 0), RPMVSF_NEEDPAYLOAD = (1 << 1), RPMVSF_NOSHA1HEADER = (1 << 8), RPMVSF_NOMD5HEADER = (1 << 9), RPMVSF_NODSAHEADER = (1 << 10), RPMVSF_NORSAHEADER = (1 << 11), RPMVSF_NOSHA1 = (1 << 16), RPMVSF_NOMD5 = (1 << 17), RPMVSF_NODSA = (1 << 18), RPMVSF_NORSA = (1 << 19) } |
Bit(s) to control digest and signature verification. More... | |
enum | rpmtsOpX_e { RPMTS_OP_TOTAL = 0, RPMTS_OP_CHECK = 1, RPMTS_OP_ORDER = 2, RPMTS_OP_FINGERPRINT = 3, 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_MAX = 17 } |
Indices for timestamps. More... | |
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. | |
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 | rpmtsGetDBMode (rpmts ts) |
Return the transaction database mode. | |
int | rpmtsSetDBMode (rpmts ts, int dbmode) |
Set the transaction database mode. | |
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, pgpDig dig) |
Retrieve pubkey from rpm database. | |
rpmRC | rpmtsImportPubkey (rpmts ts, const unsigned char *pkt, size_t pktlen) |
Import public key packet(s). | |
rpmKeyring | rpmtsGetKeyring (rpmts ts, int autoload) |
Retrieve handle for keyring used for this transaction set. | |
int | rpmtsSetKeyring (rpmts ts, rpmKeyring keyring) |
Set keyring to use for this transaction set. | |
int | rpmtsSetSolveCallback (rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData) |
Set dependency solver callback. | |
rpmps | rpmtsProblems (rpmts ts) |
Return current transaction set problems. | |
void | rpmtsCleanProblems (rpmts ts) |
Clean current transaction problem set. | |
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). | |
const char * | rpmtsRootDir (rpmts ts) |
Get transaction rootDir, i.e. | |
int | 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. | |
rpm_tid_t | rpmtsGetTid (rpmts ts) |
Get transaction id, i.e. | |
rpm_tid_t | rpmtsSetTid (rpmts ts, rpm_tid_t tid) |
Set transaction id, i.e. | |
rpmdb | rpmtsGetRdb (rpmts ts) |
Get transaction set database handle. | |
void * | rpmtsNotify (rpmts ts, rpmte te, rpmCallbackType what, rpm_loff_t amount, rpm_loff_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. | |
rpmSpec | rpmtsSpec (rpmts ts) |
Get spec control structure from transaction set. | |
rpmSpec | rpmtsSetSpec (rpmts ts, rpmSpec spec) |
Set a spec control structure in transaction set. | |
rpm_color_t | rpmtsColor (rpmts ts) |
Retrieve color bits of transaction set. | |
rpm_color_t | rpmtsPrefColor (rpmts ts) |
Retrieve prefered file color. | |
rpm_color_t | rpmtsSetColor (rpmts ts, rpm_color_t color) |
Set color bits of transaction set. | |
rpm_color_t | rpmtsSetPrefColor (rpmts ts, rpm_color_t color) |
Set prefered file color. | |
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. |
typedef enum rpmtransFlags_e rpmtransFlags |
Bit(s) to control rpmtsRun() operation.
typedef enum rpmtsOpX_e rpmtsOpX |
Indices for timestamps.
typedef enum rpmVSFlags_e rpmVSFlags |
Bit(s) to control digest and signature verification.
enum rpmtransFlags_e |
Bit(s) to control rpmtsRun() operation.
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 |
|
RPMTRANS_FLAG_NOCONTEXTS |
from --nocontexts |
RPMTRANS_FLAG_DIRSTASH |
obsolete, unused |
RPMTRANS_FLAG_REPACKAGE |
obsolete, unused |
RPMTRANS_FLAG_PKGCOMMIT | |
RPMTRANS_FLAG_PKGUNDO | |
RPMTRANS_FLAG_COMMIT | |
RPMTRANS_FLAG_UNDO | |
RPMTRANS_FLAG_REVERSE | |
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_NOMD5 |
from --nomd5 |
RPMTRANS_FLAG_NOFILEDIGEST |
from --nofiledigest (alias to --nomd5) |
RPMTRANS_FLAG_NOSUGGEST |
from --nosuggest |
RPMTRANS_FLAG_ADDINDEPS |
from --aid |
RPMTRANS_FLAG_NOCONFIGS |
from --noconfigs |
RPMTRANS_FLAG_DEPLOOPS |
from --deploops |
enum rpmtsOpX_e |
Indices for timestamps.
enum rpmVSFlags_e |
Add package to be erased to transaction set.
ts | transaction set | |
h | header | |
dboffset | ununsed |
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.
ts | transaction set | |
h | header | |
key | package retrieval key (e.g. file name) | |
upgrade | is package being upgraded? | |
relocs | package file relocations |
Referenced by checkSpec().
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.
ts | transaction set |
Referenced by checkSpec().
int rpmtsChrootDone | ( | rpmts | ts | ) |
Get chrootDone flag, i.e.
has chroot(2) been performed?
ts | transaction set |
void rpmtsClean | ( | rpmts | ts | ) |
Free memory needed only for dependency checks and ordering.
ts | transaction set |
Referenced by checkSpec().
void rpmtsCleanProblems | ( | rpmts | ts | ) |
Clean current transaction problem set.
ts | transaction set |
int rpmtsCloseDB | ( | rpmts | ts | ) |
Close the database used by the transaction.
ts | transaction set |
rpm_color_t rpmtsColor | ( | rpmts | ts | ) |
Retrieve color bits of transaction set.
ts | transaction set |
rpmts rpmtsCreate | ( | void | ) |
const char* rpmtsCurrDir | ( | rpmts | ts | ) |
Get transaction currDir, i.e.
current directory before chroot(2).
ts | transaction set |
Return (ordered) transaction set element.
ts | transaction set | |
ix | transaction element index |
void rpmtsEmpty | ( | rpmts | ts | ) |
Re-create an empty transaction set.
ts | transaction set |
rpmprobFilterFlags rpmtsFilterFlags | ( | rpmts | ts | ) |
Get problem ignore bit mask, i.e.
bits to filter encountered problems.
ts | transaction set |
Retrieve pubkey from rpm database.
ts | rpm transaction | |
dig | OpenPGP packet container |
rpmtransFlags rpmtsFlags | ( | rpmts | ts | ) |
Get transaction flags, i.e.
bits that control rpmtsRun().
ts | transaction set |
Destroy transaction set, closing the database as well.
ts | transaction set |
Referenced by main().
int rpmtsGetDBMode | ( | rpmts | ts | ) |
Return the transaction database mode.
ts | transaction set |
rpmKeyring rpmtsGetKeyring | ( | rpmts | ts, | |
int | autoload | |||
) |
Retrieve handle for keyring used for this transaction set.
ts | transaction set | |
autoload | load default keyring if keyring is not set |
Get transaction set database handle.
ts | transaction set |
Get transaction id, i.e.
transaction time stamp.
ts | transaction set |
Import public key packet(s).
ts | transaction set | |
pkt | pgp pubkey packet(s) | |
pktlen | pgp pubkey length |
int rpmtsInitDB | ( | rpmts | ts, | |
int | dbmode | |||
) |
Initialize the database used by the transaction.
ts | transaction set | |
dbmode | O_RDONLY or O_RDWR |
Referenced by main().
rpmdbMatchIterator rpmtsInitIterator | ( | const rpmts | ts, | |
rpmTag | rpmtag, | |||
const void * | keyp, | |||
size_t | keylen | |||
) |
Return transaction database iterator.
ts | transaction set | |
rpmtag | rpm tag | |
keyp | key data (NULL for sequential access) | |
keylen | key data length (0 will use strlen(keyp)) |
Reference a transaction set instance.
ts | transaction set | |
msg |
int rpmtsNElements | ( | rpmts | ts | ) |
Return number of (ordered) transaction set elements.
ts | transaction set |
void* rpmtsNotify | ( | rpmts | ts, | |
rpmte | te, | |||
rpmCallbackType | what, | |||
rpm_loff_t | amount, | |||
rpm_loff_t | total | |||
) |
Perform transaction progress notify callback.
ts | transaction set | |
te | current transaction element | |
what | type of call back | |
amount | current value | |
total | final value |
Retrieve operation timestamp from a transaction set.
ts | transaction set | |
opx | operation timestamp index |
int rpmtsOpenDB | ( | rpmts | ts, | |
int | dbmode | |||
) |
Open the database used by the transaction.
ts | transaction set | |
dbmode | O_RDONLY or O_RDWR |
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.
ts | transaction set |
rpm_color_t rpmtsPrefColor | ( | rpmts | ts | ) |
Retrieve prefered file color.
ts | transaction set |
Return current transaction set problems.
ts | transaction set |
Referenced by checkSpec().
int rpmtsRebuildDB | ( | rpmts | ts | ) |
Rebuild the database used by the transaction.
ts | transaction set |
Referenced by main().
const char* rpmtsRootDir | ( | rpmts | ts | ) |
Get transaction rootDir, i.e.
path to chroot(2).
ts | transaction set |
Referenced by buildForTarget().
int rpmtsRun | ( | rpmts | ts, | |
rpmps | okProbs, | |||
rpmprobFilterFlags | ignoreSet | |||
) |
Process all package elements in a transaction set.
Before calling rpmtsRun be sure to have:
Additionally, though not required you may want to:
ts | transaction set | |
okProbs | previously known problems (or NULL) | |
ignoreSet | bits to filter problem types |
Get transaction script file handle, i.e.
stdout/stderr on scriptlet execution
ts | transaction set |
int rpmtsSELinuxEnabled | ( | rpmts | ts | ) |
Get selinuxEnabled flag, i.e.
is SE linux enabled?
ts | transaction set |
int rpmtsSetChrootDone | ( | rpmts | ts, | |
int | chrootDone | |||
) |
Set chrootDone flag, i.e.
has chroot(2) been performed?
ts | transaction set | |
chrootDone | new chrootDone flag |
rpm_color_t rpmtsSetColor | ( | rpmts | ts, | |
rpm_color_t | color | |||
) |
Set color bits of transaction set.
ts | transaction set | |
color | new color bits |
void rpmtsSetCurrDir | ( | rpmts | ts, | |
const char * | currDir | |||
) |
Set transaction currDir, i.e.
current directory before chroot(2).
ts | transaction set | |
currDir | new transaction currDir (or NULL) |
int rpmtsSetDBMode | ( | rpmts | ts, | |
int | dbmode | |||
) |
Set the transaction database mode.
Only permitted when when backing database hasn't been opened yet (ie rpmtsGetRdb(ts) == NULL)
ts | transaction set | |
dbmode | O_RDONLY, O_RDWR or -1 (disable lazy opens) |
rpmtransFlags rpmtsSetFlags | ( | rpmts | ts, | |
rpmtransFlags | transFlags | |||
) |
Set transaction flags, i.e.
bits that control rpmtsRun().
ts | transaction set | |
transFlags | new transaction flags |
int rpmtsSetKeyring | ( | rpmts | ts, | |
rpmKeyring | keyring | |||
) |
Set keyring to use for this transaction set.
Keyring can be only changed while the underlying rpm database is not yet open.
ts | transaction set | |
keyring | keyring handle (NULL to free current keyring) |
int rpmtsSetNotifyCallback | ( | rpmts | ts, | |
rpmCallbackFunction | notify, | |||
rpmCallbackData | notifyData | |||
) |
Set transaction notify callback function and argument.
ts | transaction set | |
notify | progress callback | |
notifyData | progress callback private data |
rpm_color_t rpmtsSetPrefColor | ( | rpmts | ts, | |
rpm_color_t | color | |||
) |
Set prefered file color.
ts | transaction set | |
color | new color bits |
int rpmtsSetRootDir | ( | rpmts | ts, | |
const char * | rootDir | |||
) |
Set transaction rootDir, i.e.
path to chroot(2).
ts | transaction set | |
rootDir | new transaction rootDir (or NULL) |
Referenced by main().
Set transaction script file handle, i.e.
stdout/stderr on scriptlet execution
ts | transaction set | |
scriptFd | new script file handle (or NULL) |
int rpmtsSetSolveCallback | ( | rpmts | ts, | |
int(*)(rpmts ts, rpmds ds, const void *data) | solve, | |||
const void * | solveData | |||
) |
Set dependency solver callback.
ts | transaction set | |
(*solve) | dependency solver callback | |
solveData | dependency solver callback data (opaque) |
Set a spec control structure in transaction set.
ts | transaction set | |
spec | new spec control structure |
Referenced by buildForTarget().
Set transaction id, i.e.
transaction time stamp.
ts | transaction set | |
tid | new transaction id |
rpmVSFlags rpmtsSetVSFlags | ( | rpmts | ts, | |
rpmVSFlags | vsflags | |||
) |
Get spec control structure from transaction set.
ts | transaction set |
Unreference a transaction instance.
ts | transaction set | |
msg |
int rpmtsVerifyDB | ( | rpmts | ts | ) |
Verify the database used by the transaction.
ts | transaction set |
Referenced by main().
rpmVSFlags rpmtsVSFlags | ( | rpmts | ts | ) |
Get verify signatures flag(s).
ts | transaction set |