Go to the documentation of this file.
11 #include <rpm/rpmtypes.h>
12 #include <rpm/rpmte.h>
13 #include <rpm/rpmps.h>
14 #include <rpm/rpmsw.h>
15 #include <rpm/rpmpgp.h>
16 #include <rpm/rpmfi.h>
17 #include <rpm/rpmcallback.h>
62 #define _noTransScripts \
63 ( RPMTRANS_FLAG_NOPRE | \
64 RPMTRANS_FLAG_NOPOST | \
65 RPMTRANS_FLAG_NOPREUN | \
66 RPMTRANS_FLAG_NOPOSTUN | \
67 RPMTRANS_FLAG_NOPRETRANS | \
68 RPMTRANS_FLAG_NOPOSTTRANS \
71 #define _noTransTriggers \
72 ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
73 RPMTRANS_FLAG_NOTRIGGERIN | \
74 RPMTRANS_FLAG_NOTRIGGERUN | \
75 RPMTRANS_FLAG_NOTRIGGERPOSTUN \
79 #define RPMTRANS_FLAG_NOPAYLOAD 0
80 #define RPMTRANS_FLAG_APPLYONLY 0
81 #define RPMTRANS_FLAG_KEEPOBSOLETE 0
82 #define RPMTRANS_FLAG_DIRSTASH 0
83 #define RPMTRANS_FLAG_REPACKAGE 0
84 #define RPMTRANS_FLAG_PKGCOMMIT 0
85 #define RPMTRANS_FLAG_PKGUNDO 0
86 #define RPMTRANS_FLAG_COMMIT 0
87 #define RPMTRANS_FLAG_UNDO 0
88 #define RPMTRANS_FLAG_REVERSE 0
89 #define RPMTRANS_FLAG_NOSUGGEST 0
90 #define RPMTRANS_FLAG_ADDINDEPS 0
114 #define RPMVSF_MASK_NODIGESTS \
115 ( RPMVSF_NOSHA1HEADER | \
116 RPMVSF_NOSHA256HEADER | \
119 #define _RPMVSF_NODIGESTS RPMVSF_MASK_NODIGESTS
121 #define RPMVSF_MASK_NOSIGNATURES \
122 ( RPMVSF_NODSAHEADER | \
123 RPMVSF_NORSAHEADER | \
126 #define _RPMVSF_NOSIGNATURES RPMVSF_MASK_NOSIGNATURES
128 #define RPMVSF_MASK_NOHEADER \
129 ( RPMVSF_NOSHA1HEADER | \
130 RPMVSF_NOSHA256HEADER | \
131 RPMVSF_NODSAHEADER | \
133 #define _RPMVSF_NOHEADER RPMVSF_MASK_NOHEADER
135 #define RPMVSF_MASK_NOPAYLOAD \
140 #define _RPMVSF_NOPAYLOAD RPMVSF_MASK_NOPAYLOAD
149 #define RPMSIG_VERIFIABLE_TYPE (RPMSIG_DIGEST_TYPE|RPMSIG_SIGNATURE_TYPE)
150 #define RPMSIG_UNVERIFIED_TYPE (1 << 30)
301 const void * keyp,
size_t keylen);
348 int (*solve) (
rpmts ts,
rpmds ds,
const void * data),
349 const void * solveData);
608 const fnpyKey key,
int upgrade,
rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char *pkt, size_t pktlen)
Import public key packet(s).
rpmps rpmtsProblems(rpmts ts)
Return current transaction set problems.
rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid)
Set transaction id, i.e.
@ RPMTRANS_FLAG_NOTRIGGERUN
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color)
Set color bits of transaction set.
@ RPMTRANS_FLAG_NOPOSTTRANS
rpmdb rpmtsGetRdb(rpmts ts)
Get transaction set database handle.
@ RPMTRANS_FLAG_NOFILEDIGEST
int rpmtsCheck(rpmts ts)
Perform dependency resolution on the transaction set.
@ RPMTRANS_FLAG_NOSCRIPTS
rpm_tid_t rpmtsGetTid(rpmts ts)
Get transaction id, i.e.
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
Set transaction notify callback function and argument.
enum rpmtsOpX_e rpmtsOpX
Indices for timestamps.
int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring)
Set keyring to use for this transaction set.
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
Set transaction flags, i.e.
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total)
Perform transaction progress notify callback.
@ RPMTRANS_FLAG_NOPLUGINS
rpmts rpmtsFree(rpmts ts)
Destroy transaction set, closing the database as well.
rpm_color_t rpmtsColor(rpmts ts)
Retrieve color bits of transaction set.
@ RPMTRANS_FLAG_NOTRIGGERIN
rpm_color_t rpmtsPrefColor(rpmts ts)
Retrieve preferred file color.
rpmts rpmtsLink(rpmts ts)
Reference a transaction set instance.
rpmPlugins rpmtsPlugins(rpmts ts)
Get the plugins associated with a transaction set.
struct rpmKeyring_s * rpmKeyring
FD_t rpmtsScriptFd(rpmts ts)
Get transaction script file handle, i.e.
void rpmtsEmpty(rpmts ts)
Re-create an empty transaction set.
int rpmtsInitDB(rpmts ts, int dbmode)
Initialize the database used by the transaction.
int rpmtsAddInstallElement(rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)
Add package to be installed to transaction set.
int rpmtsRebuildDB(rpmts ts)
Rebuild the database used by the transaction.
rpmFlags rpmprobFilterFlags
rpmts rpmtsCreate(void)
Create an empty transaction set.
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
Return transaction database iterator.
int rpmtsAddReinstallElement(rpmts ts, Header h, const fnpyKey key)
Add package to be reinstalled to transaction set.
void *(* rpmCallbackFunction)(const void *h, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, rpmCallbackData data)
Function pointer type for rpmtsSetNotifyCallback() triggered by rpmtsNotify()
rpmtransFlags_e
Bit(s) to control rpmtsRun() operation.
int rpmtsSetVfyLevel(rpmts ts, int vfylevel)
Set enforced package verify level.
enum rpmRC_e rpmRC
Package read return codes.
int rpmtsVerifyDB(rpmts ts)
Verify the database used by the transaction.
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData)
Set dependency solver callback.
int rpmtsOpenDB(rpmts ts, int dbmode)
Open the database used by the transaction.
@ RPMTRANS_FLAG_BUILD_PROBS
rpmte rpmtsElement(rpmts ts, int ix)
Return (ordered) transaction set element.
int rpmtsSetDBMode(rpmts ts, int dbmode)
Set the transaction database mode.
@ RPMTRANS_FLAG_NOTRIGGERS
int rpmtsCloseDB(rpmts ts)
Close the database used by the transaction.
enum rpmCallbackType_e rpmCallbackType
Bit(s) to identify progress callbacks.
rpmVSFlags rpmtsSetVfyFlags(rpmts ts, rpmVSFlags vfyflags)
Set package verify flag(s).
@ RPMTRANS_FLAG_NOTRIGGERPREIN
@ RPMTRANS_FLAG_NOTRIGGERPOSTUN
rpmtsi rpmtsiFree(rpmtsi tsi)
Destroy transaction element iterator.
rpmVSFlags_e
Bit(s) to control digest and signature verification.
struct rpmdbMatchIterator_s * rpmdbMatchIterator
rpmRC rpmtsImportHeader(rpmtxn txn, Header h, rpmFlags flags)
Import a header into the rpmdb.
@ RPMTRANS_FLAG_NOCONFIGS
We pass these around as an array with a sentinel.
const char * rpmtsRootDir(rpmts ts)
Get transaction rootDir, i.e.
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
Set verify signatures flag(s).
rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload)
Retrieve handle for keyring used for this transaction set.
int rpmtsOrder(rpmts ts)
Determine package order in a transaction set according to dependencies.
@ RPMTRANS_FLAG_NOARTIFACTS
struct _FD_s * FD_t
RPM IO file descriptor type.
void rpmtsClean(rpmts ts)
Free memory needed only for dependency checks and ordering.
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
Add package to be erased to transaction set.
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
Process all package elements in a transaction set.
rpmVSFlags rpmtsVfyFlags(rpmts ts)
Get package verify flag(s).
int rpmtsNElements(rpmts ts)
Return number of (ordered) transaction set elements.
@ RPMTRANS_FLAG_NOCONTEXTS
Cumulative statistics for an operation.
rpmtsOpX_e
Indices for timestamps.
int rpmtsGetDBMode(rpmts ts)
Return the transaction database mode.
rpmtxn rpmtxnBegin(rpmts ts, rpmtxnFlags flags)
Create a transaction (lock) handle.
rpmtransFlags rpmtsFlags(rpmts ts)
Get transaction flags, i.e.
struct headerToken_s * Header
RPM header and data retrieval types.
rpmtsi rpmtsiInit(rpmts ts)
Create transaction element iterator.
rpmVSFlags rpmtsVSFlags(rpmts ts)
Get verify signatures flag(s).
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
Retrieve operation timestamp from a transaction set.
int rpmtsVfyLevel(rpmts ts)
Get enforced package verify level.
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
Get problem ignore bit mask, i.e.
void rpmtsCleanProblems(rpmts ts)
Clean current transaction problem set.
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.
struct rpmPlugins_s * rpmPlugins
rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color)
Set preferred file color.
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
Set transaction script file handle, i.e.
rpmtxn rpmtxnEnd(rpmtxn txn)
Destroy transaction (lock) handle.
rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types)
Return next transaction element of type.
@ RPMTRANS_FLAG_NOPRETRANS