17 #if defined(_RPMTS_INTERNAL)
103 #define _noTransScripts \
104 ( RPMTRANS_FLAG_NOPRETRANS | \
105 RPMTRANS_FLAG_NOPRE | \
106 RPMTRANS_FLAG_NOPOST | \
107 RPMTRANS_FLAG_NOPREUN | \
108 RPMTRANS_FLAG_NOPOSTUN | \
109 RPMTRANS_FLAG_NOPOSTTRANS \
112 #define _noTransTriggers \
113 ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
114 RPMTRANS_FLAG_NOTRIGGERIN | \
115 RPMTRANS_FLAG_NOTRIGGERUN | \
116 RPMTRANS_FLAG_NOTRIGGERPOSTUN \
164 #if defined(_RPMTS_INTERNAL)
168 #include "rpmkeyring.h"
179 typedef struct diskspaceInfo_s * rpmDiskSpaceInfo;
184 struct diskspaceInfo_s {
185 unsigned long f_bsize;
186 unsigned long f_frsize;
187 unsigned long long f_blocks;
188 unsigned long long f_bfree;
189 signed long long f_bavail;
190 unsigned long long f_files;
191 unsigned long long f_ffree;
192 signed long long f_favail;
193 unsigned long f_fsid;
194 unsigned long f_flag;
195 unsigned long f_namemax;
197 signed long long bneeded;
198 signed long long ineeded;
199 signed long long obneeded;
200 signed long long oineeded;
207 #define adj_fs_blocks(_nb) (((_nb) * 21) / 20)
209 #define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
227 const void * solveData;
230 const void ** suggests;
249 rpmDiskSpaceInfo dsi;
262 uint32_t * removedPackages;
263 int numRemovedPackages;
264 int allocedRemovedPackages;
268 int numAddedPackages;
272 rpmal erasedPackages;
273 int numErasedPackages;
278 rpmal availablePackages;
279 int numAvailablePackages;
283 rpmte relocateElement;
289 int unorderedSuccessors;
301 const char * rootDir;
303 const char * currDir;
330 #if defined(__LCLINT__)
417 int running,
rpmte rbte)
431 #define rpmtsUnlink(_ts, _msg) \
432 ((rpmts) rpmioUnlinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LINE__))
443 #define rpmtsLink(_ts, _msg) \
444 ((rpmts) rpmioLinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LINE__))
511 const void * keyp,
size_t keylen)
584 const void * solveData)
666 #define rpmtsFree(_ts) \
667 ((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__, __LINE__))
747 #if defined(_RPMTS_INTERNAL)
1126 #if defined(_RPMTS_PRINT)
1134 int rpmtsPrint(
rpmts ts, FILE * fp)
1146 fprintf(fp,
_(
"=== Transaction at %-24.24s (0x%08x):\n"), ctime(&ttid),tid);
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
Set transaction notify callback function and argument.
int rpmtsSolve(rpmts ts, rpmds ds, const void *data)
Attempt to solve a needed dependency using the solve database.
int _rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
const char * rpmteNEVRA(rpmte te)
Retrieve name-version-release.arch string from transaction element.
int rpmtsChrootDone(rpmts ts)
Get chrootDone flag, i.e.
int rpmtsSetKeyring(rpmts ts, void *_keyring)
Set transaction keyring.
static int rpmtsInitDB(rpmts ts, int dbmode)
Initialize the database used by the transaction.
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
Retrieve operation timestamp from a transaction set.
rpmte rpmtsSetRelocateElement(rpmts ts, rpmte relocateElement)
Set current relocate transaction element.
static int rpmtsVerifyDB(rpmts ts)
Verify the database used by the transaction.
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
Get problem ignore bit mask, i.e.
struct rpmdb_s * rpmdb
Database of headers and tag value indices.
int rpmtsInitDSI(const rpmts ts)
Initialize disk space info for each and every mounted file systems.
struct rpmte_s * rpmte
An element of a transaction set, i.e.
static struct fsinfo * filesystems
Spec rpmtsSetSpec(rpmts ts, Spec spec)
Set a spec control structure in transaction set.
int(* rpmtsRun)(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
Process all package elements in a transaction set.
OpenPGP constants and structures from RFC-2440.
static PyObject *int type
void *(* rpmCallbackFunction)(const void *h, const rpmCallbackType what, const rpmuint64_t amount, const rpmuint64_t total, fnpyKey key, rpmCallbackData data)
#define rpmtsUnlink(_ts, _msg)
struct rpmPRCO_s * rpmPRCO
Container for commonly extracted dependency set(s).
int rpmtsDBMode(rpmts ts)
Retrieve dbmode of transaction set.
enum rpmprobFilterFlags_e rpmprobFilterFlags
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
Set transaction flags, i.e.
struct rpmts_s * rpmts
The RPM Transaction Set.
rpmdb rpmtsGetRdb(rpmts ts)
Get transaction set database handle.
void rpmtsUpdateDSI(const rpmts ts, dev_t dev, rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixupSize, int _action)
Update disk space info for a file.
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds key, const void *data), const void *solveData)
rpmuint32_t rpmtsSetTid(rpmts ts, rpmuint32_t tid)
Set transaction id, i.e.
int rpmtsUnorderedSuccessors(rpmts ts, int first)
Set index of 1st element of successors.
pgpDig rpmtsDig(rpmts ts)
Get OpenPGP packet parameters, i.e.
enum rpmCallbackType_e rpmCallbackType
Bit(s) to identify progress callbacks.
Hash table implemenation.
rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
Return next transaction element of type.
int rpmtsRebuildDB(rpmts ts)
Rebuild the database used by the transaction.
rpmTSType rpmtsType(rpmts ts)
Return the type of a transaction.
void rpmtsEmpty(rpmts ts)
Re-create an empty transaction set.
void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal)
Set autorollback goal.
struct rpmps_s * rpmps
Transaction problems found while processing a transaction set/.
tsmStage rpmtsSetGoal(rpmts ts, tsmStage goal)
Set goal of transaction set.
rpmuint32_t rpmtsGetTid(rpmts ts)
Get transaction id, i.e.
pgpDigParams rpmtsPubkey(const rpmts ts)
Return OpenPGP pubkey constants.
void rpmtsSetCurrDir(rpmts ts, const char *currDir)
Set transaction currDir, i.e.
rpmdepFlags rpmtsSetDFlags(rpmts ts, rpmdepFlags depFlags)
Set dependency flags, i.e.
enum rpmRC_e rpmRC
RPM return codes.
void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
Check a transaction element for disk space problems.
enum rpmElementType_e rpmElementType
Transaction element type.
rpmts rpmtsCreate(void)
Create an empty transaction set.
void rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.
int _rpmtsCheck(rpmts ts)
struct rpmop_s ops[FDSTAT_MAX]
int rpmtsAddEraseElement(rpmts ts, Header h, uint32_t hdrNum)
Add package to be erased to transaction set.
void * rpmtsGetKeyring(rpmts ts, int autoload)
Get transaction keyring.
Structures and prototypes used for an "rpmps" problem set.
fprintf(stderr,"--> %s(%p,%p,%p) sig %p sigp %p\n", __FUNCTION__, dig, t, rsactx, sig, sigp)
rpmtransFlags_e
Bit(s) to control rpmtsRun() operation.
enum rpmtsOpX_e rpmtsOpX
Indices for timestamps.
rpmte rpmtsRelocateElement(rpmts ts)
Get current relocate transaction element.
unsigned long long rpmuint64_t
Set of available packages, items, and directories.
int rpmtsCloseDB(rpmts ts)
Close the database used by the transaction.
rpmuint32_t rpmtsColor(rpmts ts)
Retrieve color bits of transaction set.
enum pgpVSFlags_e pgpVSFlags
Bit(s) to control digest and signature verification.
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total)
Perform transaction progress notify callback.
int rpmtsAddInstallElement(rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation relocs)
Add package to be installed to transaction set.
The FD_t File Handle data structure.
int _orgrpmtsOrder(rpmts ts)
const char * rpmtsRootDir(rpmts ts)
Get transaction rootDir, i.e.
The structure used to store values parsed from a spec file.
int rpmtsOpenDB(rpmts ts, int dbmode)
Open the database used by the transaction.
int rpmtsCloseSDB(rpmts ts)
Close the database used by the transaction to solve dependencies.
rpmtsi rpmtsiFree(rpmtsi tsi)
Destroy transaction element iterator.
rpmte rpmtsElement(rpmts ts, int ix)
Return (ordered) transaction set element.
int rpmtsSetDBMode(rpmts ts, int dbmode)
Set dbmode of transaction set.
pgpVSFlags rpmVSFlags
Bit(s) to control digest and signature verification.
tsmStage rpmtsGoal(rpmts ts)
Retrieve goal of transaction set.
Cumulative statistics for an operation.
struct rpmds_s * rpmds
Dependency tag sets from a header, so that a header can be discarded early.
Spec rpmtsSpec(rpmts ts)
Get spec control structure from transaction set.
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
Set verify signatures flag(s).
void rpmtsClean(rpmts ts)
Free memory needed only for dependency checks and ordering.
struct rpmtsi_s * rpmtsi
Transaction element iterator.
rpmuint32_t rpmtsSetColor(rpmts ts, rpmuint32_t color)
Set color bits of transaction set.
int rpmtsSELinuxEnabled(rpmts ts)
Get selinuxEnabled flag, i.e.
static PyObject *rpmtransFlags transFlags
rpmTSType_e
Transaction Types.
enum rpmtransFlags_e rpmtransFlags
Bit(s) to control rpmtsRun() operation.
int rpmtsAvailable(rpmts ts, const rpmds ds)
Attempt to solve a needed dependency using memory resident tables.
int rpmtsNElements(rpmts ts)
Return number of (ordered) transaction set elements.
int(* rpmtsOrder)(rpmts ts)
Determine package order in a transaction set according to dependencies.
rpmtransFlags rpmtsFlags(rpmts ts)
Get transaction flags, i.e.
enum rpmTSType_e rpmTSType
Transaction Types.
rpmuint32_t rpmtsARBGoal(rpmts ts)
Return the autorollback goal.
rpmRC rpmtsRollback(rpmts rbts, rpmprobFilterFlags ignoreSet, int running, rpmte rbte)
Rollback a failed transaction.
rpmVSFlags rpmtsVSFlags(rpmts ts)
Get verify signatures flag(s).
rpmElementType rpmteType(rpmte te)
Retrieve type of transaction element.
struct pgpDigParams_s * pgpDigParams
rpmPRCO rpmtsPRCO(rpmts ts)
Get transaction set dependencies.
const char * rpmtsCurrDir(rpmts ts)
Get transaction currDir, i.e.
int rpmtsSetChrootDone(rpmts ts, int chrootDone)
Set chrootDone flag, i.e.
Structures used for managing added/available package lists.
int
Save source and expand field into target.
int _rpmtsOrder(rpmts ts)
void rpmtsSetType(rpmts ts, rpmTSType type)
Set transaction type.
rpmuint32_t rpmtsPrefColor(rpmts ts)
Retrieve preferred file color.
rpmdepFlags rpmtsDFlags(rpmts ts)
Get dependency flags, i.e.
rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
Return transaction database iterator.
int(* rpmtsCheck)(rpmts ts)
Perform dependency resolution on the transaction set.
enum rpmdepFlags_e rpmdepFlags
Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.
rpmtsOpX_e
Indices for timestamps.
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
FD_t rpmtsScriptFd(rpmts ts)
rpmRC rpmtsFindPubkey(rpmts ts, void *_dig)
Retrieve pubkey from rpm database.
rpmtsi rpmtsiInit(rpmts ts)
Create transaction element iterator.
static PyObject *rpmds ds
#define rpmtsLink(_ts, _msg)
rpmps rpmtsProblems(rpmts ts)
Return current transaction set problems.
int rpmtsOpenSDB(rpmts ts, int dbmode)
Open the database used by the transaction to solve dependencies.
rpmdepFlags_e
Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.
void rpmtsCleanDig(rpmts ts)
Free signature verification data.