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)
200 (
int event,
rpmte te,
rpmte other,
void *data);
320 const void * keyp,
size_t keylen);
367 int (*solve) (
rpmts ts,
rpmds ds,
const void * data),
368 const void * solveData);
658 const fnpyKey key,
int upgrade,
rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types)
Return next transaction element of type.
rpmtsi rpmtsiInit(rpmts ts)
Create transaction element iterator.
rpmtsi rpmtsiFree(rpmtsi tsi)
Destroy transaction element iterator.
int rpmtsGetNotifyStyle(rpmts ts)
Get transaction notify callback style.
rpmtxn rpmtxnBegin(rpmts ts, rpmtxnFlags flags)
Create a transaction (lock) handle.
rpmVSFlags_e
Bit(s) to control digest and signature verification.
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
Set transaction notify callback function and argument.
rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color)
Set preferred file color.
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total)
Perform transaction progress notify callback.
rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color)
Set color bits of transaction set.
int rpmtsAddInstallElement(rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)
Add package to be installed to transaction set.
rpmtransFlags rpmtsFlags(rpmts ts)
Get transaction flags, i.e.
int rpmtsAddReinstallElement(rpmts ts, Header h, const fnpyKey key)
Add package to be reinstalled to transaction set.
rpmps rpmtsProblems(rpmts ts)
Return current transaction set problems.
rpmte rpmtsElement(rpmts ts, int ix)
Return (ordered) transaction set element.
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
Process all package elements in a transaction set.
int rpmtsRebuildDB(rpmts ts)
Rebuild the database used by the transaction.
rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload)
Retrieve handle for keyring used for this transaction set.
rpmVSFlags rpmtsSetVfyFlags(rpmts ts, rpmVSFlags vfyflags)
Set package verify flag(s).
rpmVSFlags rpmtsVSFlags(rpmts ts)
Get verify signatures flag(s).
int rpmtsGetDBMode(rpmts ts)
Return the transaction database mode.
rpmts rpmtsFree(rpmts ts)
Destroy transaction set, closing the database as well.
int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring)
Set keyring to use for this transaction set.
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
Set verify signatures flag(s).
rpm_tid_t rpmtsGetTid(rpmts ts)
Get transaction id, i.e.
rpmRC rpmtsImportHeader(rpmtxn txn, Header h, rpmFlags flags)
Import a header into the rpmdb.
rpmVSFlags rpmtsVfyFlags(rpmts ts)
Get package verify flag(s).
rpmts rpmtsLink(rpmts ts)
Reference a transaction set instance.
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
Set transaction flags, i.e.
rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid)
Set transaction id, i.e.
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
Set transaction script file handle, i.e.
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
Add package to be erased to transaction set.
void rpmtsEmpty(rpmts ts)
Re-create an empty transaction set.
int rpmtsSetChangeCallback(rpmts ts, rpmtsChangeFunction notify, void *data)
Set transaction change callback function and argument.
int(* rpmtsChangeFunction)(int event, rpmte te, rpmte other, void *data)
Transaction change callback type.
int rpmtsOpenDB(rpmts ts, int dbmode)
Open the database used by the transaction.
rpmtsOpX_e
Indices for timestamps.
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData)
Set dependency solver callback.
rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char *pkt, size_t pktlen)
Import public key packet(s).
void rpmtsCleanProblems(rpmts ts)
Clean current transaction problem set.
int rpmtsVerifyDB(rpmts ts)
Verify the database used by the transaction.
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()
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
Return transaction database iterator.
int rpmtsVfyLevel(rpmts ts)
Get enforced package verify level.
rpm_color_t rpmtsPrefColor(rpmts ts)
Retrieve preferred file color.
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
Get problem ignore bit mask, i.e.
int rpmtsOrder(rpmts ts)
Determine package order in a transaction set according to dependencies.
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
Retrieve operation timestamp from a transaction set.
int rpmtsSetVfyLevel(rpmts ts, int vfylevel)
Set enforced package verify level.
rpmtxn rpmtxnEnd(rpmtxn txn)
Destroy transaction (lock) handle.
rpmtransFlags_e
Bit(s) to control rpmtsRun() operation.
rpmts rpmtsCreate(void)
Create an empty transaction set.
int rpmtsSetDBMode(rpmts ts, int dbmode)
Set the transaction database mode.
rpm_color_t rpmtsColor(rpmts ts)
Retrieve color bits of transaction set.
void rpmtsClean(rpmts ts)
Free memory needed only for dependency checks and ordering.
int rpmtsSetNotifyStyle(rpmts ts, int style)
Set transaction notify callback style.
int rpmtsNElements(rpmts ts)
Return number of (ordered) transaction set elements.
int rpmtsCloseDB(rpmts ts)
Close the database used by the transaction.
const char * rpmtsRootDir(rpmts ts)
Get transaction rootDir, i.e.
rpmdb rpmtsGetRdb(rpmts ts)
Get transaction set database handle.
int rpmtsCheck(rpmts ts)
Perform dependency resolution on the transaction set.
rpmPlugins rpmtsPlugins(rpmts ts)
Get the plugins associated with a transaction set.
enum rpmtsOpX_e rpmtsOpX
Indices for timestamps.
FD_t rpmtsScriptFd(rpmts ts)
Get transaction script file handle, i.e.
int rpmtsInitDB(rpmts ts, int perms)
Initialize the database used by the transaction.
@ RPMTRANS_FLAG_NOCONFIGS
@ RPMTRANS_FLAG_NOPLUGINS
@ RPMTRANS_FLAG_NOFILEDIGEST
@ RPMTRANS_FLAG_NOARTIFACTS
@ RPMTRANS_FLAG_NOTRIGGERIN
@ RPMTRANS_FLAG_NOTRIGGERPREIN
@ RPMTRANS_FLAG_NOPRETRANS
@ RPMTRANS_FLAG_NOSCRIPTS
@ RPMTRANS_FLAG_NOTRIGGERPOSTUN
@ RPMTRANS_FLAG_NOTRIGGERUN
@ RPMTRANS_FLAG_NOCONTEXTS
@ RPMTRANS_FLAG_NOTRIGGERS
@ RPMTRANS_FLAG_NOPOSTTRANS
@ RPMTRANS_FLAG_BUILD_PROBS
struct rpmdbMatchIterator_s * rpmdbMatchIterator
struct _FD_s * FD_t
RPM IO file descriptor type.
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
enum rpmRC_e rpmRC
Package read return codes.
struct headerToken_s * Header
RPM header and data retrieval types.
enum rpmCallbackType_e rpmCallbackType
Bit(s) to identify progress callbacks.
rpmFlags rpmprobFilterFlags
enum rpmtsEvent_e rpmtsEvent
struct rpmPlugins_s * rpmPlugins
struct rpmKeyring_s * rpmKeyring
We pass these around as an array with a sentinel.
Cumulative statistics for an operation.