14 #include <rpmkeyring.h>
19 #define _RPMTAG_INTERNAL
23 #define _RPMDB_INTERNAL
32 #define _RPMTE_INTERNAL
35 #define _RPMTS_INTERNAL
36 #define _RPMBAG_INTERNAL
45 #if STATFS_IN_SYS_STATVFS
47 #if defined(__LCLINT__)
49 extern int statvfs (
const char *
file,
struct statvfs * buf)
55 # include <sys/statvfs.h>
58 # if STATFS_IN_SYS_VFS
61 # if STATFS_IN_SYS_MOUNT
62 # include <sys/mount.h>
64 # if STATFS_IN_SYS_STATFS
65 # include <sys/statfs.h>
86 GENfree(rpmDiskSpaceInfo)
105 if (ts->rdb != NULL) {
119 if (ts->rdb != NULL && ts->dbmode == dbmode)
127 rc =
rpmdbOpen(ts->rootDir, &ts->rdb, ts->dbmode, (mode_t)0644);
129 const char * dn =
rpmGetPath(ts->rootDir,
"%{_dbpath}", NULL);
150 if (!(db->db_api == 3 || db->db_api == 4))
157 for (dbix = 0; dbix < db->db_ndbi; dbix++) {
161 switch (dbiTags->tag) {
175 fn =
rpmGetPath(db->db_root, db->db_home,
"/",
176 (dbiTags->str != NULL ? dbiTags->str :
tagName(dbiTags->tag)),
185 (void)
dbiOpen(db, dbiTags->tag, db->db_flags);
195 (
unsigned)db->db_maxkey);
196 fn =
rpmGetPath(db->db_root, db->db_home,
"/Seqno", NULL);
213 const void * keyp,
size_t keylen)
217 :
rpmmiInit(ts->rdb, rpmtag, keyp, keylen);
228 rpmsdb * sdbp = bag->sdbp;
235 sdb = (
rpmdb) sdbp[i]->_db;
254 static int has_sdbpath = -1;
258 int sdbmode = O_RDONLY;
259 const char * s = NULL;
261 const char * rootDir = ts->rootDir;
263 const char * rootDir =
"/";
277 sdb = (
rpmdb) (sdbp[0] ? sdbp[0]->_db : NULL);
278 sdbmode = (sdbp[0] ? sdbp[0]->dbmode : O_RDONLY);
280 if (sdb != NULL && sdbmode == dbmode) {
289 if (has_sdbpath <= 0) {
294 s =
rpmExpand(
"%{?_solve_dbpath}", NULL);
298 for (i = 0; i < ac; i++) {
302 if (av[i] == NULL || *av[i] ==
'\0')
310 xx =
rpmdbOpen(rootDir, &sdb, dbmode, (mode_t)0644);
314 const char * dn =
rpmGetPath(rootDir,
"/", fn, NULL);
333 fprintf(stderr,
"<-- %s(%p, 0%o) rc %d\n", __FUNCTION__, ts, dbmode, rc);
343 static int sugcmp(
const void * a,
const void *
b)
346 const char * astr = *(
const char **)a;
347 const char * bstr = *(
const char **)b;
348 return strcmp(astr, bstr);
356 const char *
errstr = NULL;
357 const char *
str = NULL;
361 size_t bhnamelen = 0;
371 fprintf(stderr,
"--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
404 for (i = 0; i < (int)bag->nsdbp; i++) {
409 sdb = (
rpmdb) sdbp[i]->_db;
415 mi =
rpmmiInit(sdb, rpmtag, keyp, keylen);
425 hnamelen = ((xx && he->
p.
str) ? strlen(he->
p.
str) : 0);
429 if (bhnamelen > 0 && hnamelen > bhnamelen)
446 bhnamelen = hnamelen;
464 const char * qfmt =
rpmExpand(
"%{?_solve_name_fmt}", NULL);
465 if (qfmt == NULL || *qfmt ==
'\0') {
484 fd =
Fopen(str,
"r.fdio");
485 if (fd == NULL ||
Ferror(fd)) {
520 if (ts->suggests != NULL && ts->nsuggests > 0) {
521 if (bsearch(&str, ts->suggests, ts->nsuggests,
522 sizeof(*ts->suggests),
sugcmp))
530 ts->suggests = (
const void **)
xrealloc(ts->suggests,
531 sizeof(*ts->suggests) * (ts->nsuggests + 2));
532 ts->suggests[ts->nsuggests] =
str;
534 ts->suggests[ts->nsuggests] = NULL;
536 if (ts->nsuggests > 1)
537 qsort(ts->suggests, ts->nsuggests,
sizeof(*ts->suggests),
sugcmp);
541 fprintf(stderr,
"<-- %s(%p,%p,%p) rc %d N %s EVR %s F 0x%x\n", __FUNCTION__, ts, ds, data, rc,
rpmdsN(ds),
rpmdsEVR(ds),
rpmdsFlags(ds));
550 if (ts->availablePackages == NULL)
557 if (sugkey[0] != NULL) {
558 ts->suggests = (
const void **)
xrealloc(ts->suggests,
559 sizeof(*ts->suggests) * (ts->nsuggests + 2));
560 ts->suggests[ts->nsuggests] = sugkey[0];
563 ts->suggests[ts->nsuggests] = NULL;
565 sugkey =
_free(sugkey);
571 const void * solveData)
578 ts->solveData = solveData;
586 static const char msg[] =
"rpmtsProblems";
589 if (ts->probs == NULL)
611 ts->addedPackages =
rpmalFree(ts->addedPackages);
612 ts->numAddedPackages = 0;
614 ts->erasedPackages =
rpmalFree(ts->erasedPackages);
615 ts->numErasedPackages = 0;
617 ts->suggests =
_free(ts->suggests);
639 ts->order[oc] =
rpmteFree(ts->order[oc]);
643 ts->numAddedFiles = 0;
644 ts->numErasedFiles = 0;
650 ts->numRemovedPackages = 0;
660 static unsigned int scale = (1000 * 1000);
661 if (op != NULL && op->
count > 0)
662 fprintf(stderr,
" %s %8d %6lu.%06lu MB %6lu.%06lu secs\n",
664 (
unsigned long)op->
bytes/scale, (
unsigned long)op->
bytes%scale,
728 assert(ts->txn == NULL);
735 ts->removedPackages =
_free(ts->removedPackages);
737 ts->availablePackages =
rpmalFree(ts->availablePackages);
738 ts->numAvailablePackages = 0;
740 ts->dsi =
_free(ts->dsi);
742 if (ts->scriptFd != NULL) {
744 ts->scriptFd =
fdFree(ts->scriptFd, __FUNCTION__);
748 ts->rootDir =
_free(ts->rootDir);
749 ts->currDir =
_free(ts->currDir);
752 ts->order =
_free(ts->order);
754 ts->orderAlloced = 0;
756 ts->keyring = rpmKeyringFree(ts->keyring);
764 const char ** av = NULL;
782 if (_rpmtsPool == NULL) {
783 _rpmtsPool =
rpmioNewPool(
"ts",
sizeof(*ts), -1, _rpmts_debug,
788 memset(((
char *)ts)+
sizeof(ts->_item), 0,
sizeof(*ts)-
sizeof(ts->_item));
794 rpmKeyring keyring = NULL;
797 if (ts->keyring == NULL && autoload)
799 keyring = rpmKeyringLink(ts->keyring);
801 keyring = ts->keyring;
805 return (
void *)keyring;
811 rpmKeyring keyring = (rpmKeyring) _keyring;
826 ts->keyring = rpmKeyringFree(ts->keyring);
830 ts->keyring = rpmKeyringLink(keyring);
833 ts->keyring = keyring;
872 return (
rpmTSType) ((ts != NULL) ? ts->type : 0);
883 return ((ts != NULL) ? ts->arbgoal : 0);
894 int unorderedSuccessors = 0;
896 unorderedSuccessors = ts->unorderedSuccessors;
898 ts->unorderedSuccessors = first;
900 return unorderedSuccessors;
905 const char * rootDir = NULL;
907 if (ts != NULL && ts->rootDir != NULL) {
932 ts->rootDir =
_free(ts->rootDir);
934 if (rootDir == NULL) {
940 rootLen = strlen(rootDir);
943 if (!(rootLen && rootDir[rootLen - 1] ==
'/')) {
944 char * t = (
char *)
alloca(rootLen + 2);
949 ts->rootDir =
xstrdup(rootDir);
955 const char * currDir = NULL;
957 currDir = ts->currDir;
965 ts->currDir =
_free(ts->currDir);
967 ts->currDir =
xstrdup(currDir);
973 FD_t scriptFd = NULL;
975 scriptFd = ts->scriptFd;
986 if (ts->scriptFd != NULL) {
988 ts->scriptFd =
fdFree(ts->scriptFd,
"rpmtsSetScriptFd");
993 if (scriptFd != NULL)
994 ts->scriptFd =
fdLink((
void *)scriptFd,
"rpmtsSetScriptFd");
1001 int selinuxEnabled = 0;
1003 selinuxEnabled = (ts->selinuxEnabled > 0);
1004 return selinuxEnabled;
1009 return (ts != NULL ? ts->chrootDone : 0);
1014 int ochrootDone = 0;
1016 ochrootDone = ts->chrootDone;
1017 if (ts->rdb != NULL)
1018 ts->rdb->db_chrootDone = chrootDone;
1019 ts->chrootDone = chrootDone;
1049 static int oneshot = 0;
1051 const char * fn =
rpmGetPath(
"%{?_rpmds_sysinfo_path}", NULL);
1069 rpmDiskSpaceInfo dsi;
1076 if (ts->filesystems != NULL)
1081 D_(
" i dev bsize bavail iavail mount point\n"));
1084 if (rc || ts->filesystems == NULL || ts->filesystemCount == 0)
1089 ts->dsi =
_free(ts->dsi);
1090 ts->dsi = (rpmDiskSpaceInfo)
xcalloc((ts->filesystemCount + 1),
sizeof(*ts->dsi));
1095 for (i = 0; (i < ts->filesystemCount) && dsi; i++, dsi++) {
1096 #if STATFS_IN_SYS_STATVFS
1098 memset(&sfb, 0,
sizeof(sfb));
1099 rc = statvfs(ts->filesystems[i], &sfb);
1102 memset(&sfb, 0,
sizeof(sfb));
1109 rc = statfs(ts->filesystems[i], &sfb,
sizeof(sfb), 0);
1111 rc = statfs(ts->filesystems[i], &sfb);
1117 rc = stat(ts->filesystems[i], &sb);
1120 dsi->dev = sb.st_dev;
1122 #if STATFS_IN_SYS_STATVFS
1123 dsi->f_frsize = sfb.f_frsize;
1124 #if defined(RPM_OS_AIX)
1127 dsi->f_fsid = sfb.f_fsid;
1129 dsi->f_flag = sfb.f_flag;
1130 dsi->f_favail = (
long long) sfb.f_favail;
1131 dsi->f_namemax = sfb.f_namemax;
1132 #elif defined(__APPLE__) && defined(__MACH__) && !defined(_SYS_STATVFS_H_)
1134 dsi->f_namemax = pathconf(ts->filesystems[i], _PC_NAME_MAX);
1135 #elif defined(__OpenBSD__)
1137 dsi->f_namemax = pathconf(ts->filesystems[i], _PC_NAME_MAX);
1139 dsi->f_fsid = sfb.f_fsid;
1140 dsi->f_namemax = sfb.f_namelen;
1143 dsi->f_bsize = sfb.f_bsize;
1144 dsi->f_blocks = (
unsigned long long)sfb.f_blocks;
1145 dsi->f_bfree = (
unsigned long long)sfb.f_bfree;
1146 dsi->f_files = (
unsigned long long)sfb.f_files;
1147 dsi->f_ffree = (
unsigned long long)sfb.f_ffree;
1151 #ifdef STATFS_HAS_F_BAVAIL
1152 dsi->f_bavail = (
long long)(sfb.f_bavail ? sfb.f_bavail : 1);
1153 if (sfb.f_ffree > 0 && sfb.f_files > 0 && sfb.f_favail > 0)
1154 dsi->f_favail = (
long long)sfb.f_favail;
1156 dsi->f_favail = !(sfb.f_ffree == 0 && sfb.f_files == 0)
1157 ? (
signed long long) sfb.f_ffree : -1;
1163 dsi->f_bavail = sfb.f_blocks - sfb.f_bfree;
1165 dsi->f_favail = !(sfb.f_ffree == 0 && sfb.f_files == 0)
1169 #if !defined(ST_RDONLY)
1173 (
unsigned)i, (
unsigned) dsi->dev, (
unsigned) dsi->f_bsize,
1174 (
signed long) dsi->f_bavail, (
signed long) dsi->f_favail,
1175 ((dsi->f_flag &
ST_RDONLY) ?
"ro" :
"rw"),
1176 ts->filesystems[i]);
1186 rpmDiskSpaceInfo dsi;
1191 while (dsi->f_bsize && dsi->dev != dev)
1193 if (dsi->f_bsize == 0)
1199 bneeded = BLOCK_ROUND(fileSize, dsi->f_bsize);
1206 dsi->bneeded += bneeded;
1215 dsi->bneeded += bneeded;
1216 dsi->bneeded -= BLOCK_ROUND(prevSize, dsi->f_bsize);
1221 dsi->bneeded -= bneeded;
1229 dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->f_bsize);
1234 rpmDiskSpaceInfo dsi;
1239 if (ts->filesystems == NULL || ts->filesystemCount == 0)
1250 for (i = 0; i < ts->filesystemCount; i++, dsi++) {
1252 if (dsi->f_bavail > 0 && adj_fs_blocks(dsi->bneeded) > dsi->f_bavail) {
1253 if (dsi->bneeded != dsi->obneeded) {
1256 ts->filesystems[i], NULL, NULL,
1257 (adj_fs_blocks(dsi->bneeded) - dsi->f_bavail) * dsi->f_bsize);
1258 dsi->obneeded = dsi->bneeded;
1262 if (dsi->f_favail > 0 && adj_fs_blocks(dsi->ineeded) > dsi->f_favail) {
1263 if (dsi->ineeded != dsi->oineeded) {
1266 ts->filesystems[i], NULL, NULL,
1267 (adj_fs_blocks(dsi->ineeded) - dsi->f_favail));
1268 dsi->oineeded = dsi->ineeded;
1272 if ((dsi->bneeded || dsi->ineeded) && (dsi->f_flag &
ST_RDONLY)) {
1275 ts->filesystems[i], NULL, NULL, 0);
1285 if (ts && ts->notify) {
1299 ptr = ts->notify(h, what, amount, total, cbkey, ts->notifyData);
1311 if (ts != NULL && ts->order != NULL) {
1312 nelements = ts->orderCount;
1320 if (ts != NULL && ts->order != NULL) {
1321 if (ix >= 0 && ix < ts->orderCount)
1338 transFlags = ts->transFlags;
1351 otransFlags = ts->transFlags;
1358 ts->transFlags = transFlags;
1365 return (
rpmdepFlags) (ts != NULL ? ts->depFlags : 0);
1372 odepFlags = ts->depFlags;
1373 ts->depFlags = depFlags;
1387 Spec ospec = ts->spec;
1397 return ts->relocateElement;
1403 rpmte orelocateElement = ts->relocateElement;
1405 ts->relocateElement = relocateElement;
1407 return orelocateElement;
1427 return (ts != NULL ? ts->dbmode : 0);
1434 odbmode = ts->dbmode;
1435 ts->dbmode = dbmode;
1442 return (ts != NULL ? ts->color : 0);
1457 return (ts != NULL ? ts->prefcolor : 0);
1464 ts->notify = notify;
1465 ts->notifyData = notifyData;
1475 memset(&ts->ops, 0,
sizeof(ts->ops));
1479 ts->filesystemCount = 0;
1480 ts->filesystems = NULL;
1484 ts->solveData = NULL;
1486 ts->suggests = NULL;
1493 ts->dbmode = O_RDONLY;
1496 ts->scriptFd = NULL;
1497 {
struct timeval tv;
1498 xx = gettimeofday(&tv, NULL);
1506 if (!ts->prefcolor) ts->prefcolor = 0x2;
1509 ts->numRemovedPackages = 0;
1510 ts->allocedRemovedPackages = ts->delta;
1511 ts->removedPackages = (uint32_t *)
xcalloc(ts->allocedRemovedPackages,
1512 sizeof(*ts->removedPackages));
1520 ts->numAddedPackages = 0;
1521 ts->addedPackages = NULL;
1523 ts->numErasedPackages = 0;
1524 ts->erasedPackages = NULL;
1526 ts->numAvailablePackages = 0;
1527 ts->availablePackages = NULL;
1529 ts->orderAlloced = 0;
1542 ts->arbgoal = 0xffffffff;
Spec rpmtsSpec(rpmts ts)
Get spec control structure from transaction set.
evrFlags rpmdsFlags(const rpmds ds)
Return current dependency flags.
rpmPRCO rpmdsFreePRCO(rpmPRCO PRCO)
Free dependency set(s) container.
mongo_error_t const char * errstr
rpmtime_t rpmswExit(rpmop op, ssize_t rc)
Exit timed operation.
int rpmtxnCheckpoint(rpmdb rpmdb)
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total)
Perform transaction progress notify callback.
const char bson_timestamp_t * ts
rpmte rpmteFree(rpmte te)
Destroy a transaction element.
enum urltype_e urltype
Supported URL types.
OpenPGP constants and structures from RFC-2440.
const char * rpmtsRootDir(rpmts ts)
Get transaction rootDir, i.e.
rpmte rpmtsElement(rpmts ts, int ix)
Return (ordered) transaction set element.
void yarnPossess(yarnLock bolt)
void rpmpsAppend(rpmps ps, rpmProblemType type, const char *pkgNEVR, fnpyKey key, const char *dn, const char *bn, const char *altNEVR, rpmuint64_t ulong1)
Append a problem to current set of problems.
enum iosmFileAction_e iosmFileAction
File disposition(s) during package install/erase processing.
static void rpmtsPrintStats(rpmts ts)
Structures used for an "rpmte" transaction element.
char * xstrdup(const char *str)
FD_t Fopen(const char *path, const char *_fmode)
fopen(3) clone.
int rpmtsAddInstallElement(rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation relocs)
Add package to be installed to transaction set.
char * rpmGetPath(const char *path,...)
Return (malloc'ed) expanded, canonicalized, file path.
Structure(s) used for file info tag sets.
enum rpmprobFilterFlags_e rpmprobFilterFlags
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds key, const void *data), const void *solveData)
rpmtime_t rpmswAdd(rpmop to, rpmop from)
Sum statistic counters.
int Stat(const char *path, struct stat *st)
stat(2) clone.
FD_t fdLink(void *cookie, const char *msg)
static rpmVSFlags vsflags
void * rpmtsFreeLock(void *lock)
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
Set transaction notify callback function and argument.
enum rpmCallbackType_e rpmCallbackType
Bit(s) to identify progress callbacks.
Structure(s) and routine(s) used for classifying and parsing names.
Access mounted file system information.
enum rpmTSType_e rpmTSType
Transaction Types.
void addMacro(MacroContext mc, const char *n, const char *o, const char *b, int level)
Add macro to context.
rpmTag rpmdsTagN(const rpmds ds)
Return current dependency type.
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
Retrieve operation timestamp from a transaction set.
int rpmtsSetChrootDone(rpmts ts, int chrootDone)
Set chrootDone flag, i.e.
rpmtsi rpmtsiFree(rpmtsi tsi)
Destroy transaction element iterator.
struct rpmtsi_s * rpmtsi
Transaction element iterator.
rpmTSType rpmtsType(rpmts ts)
Return the type of a transaction.
static void rpmlog(int code, const char *fmt,...)
struct rpmps_s * rpmps
Transaction problems found while processing a transaction set/.
rpmts rpmtsLink(rpmts ts, const char *msg)
Reference a transaction set instance.
int rpmsxEnabled(rpmsx sx)
Return SELinux enabled state.
struct rpmds_s * rpmds
Dependency tag sets from a header, so that a header can be discarded early.
rpmhkp rpmhkpFree(rpmhkp hkp)
Destroy a hkp handle.
rpmPRCO rpmtsPRCO(rpmts ts)
Get transaction set dependencies.
struct rpmPRCO_s * rpmPRCO
Container for commonly extracted dependency set(s).
rpmbag rpmbagNew(const char *fn, int flags)
Create and load a bag wrapper.
char * headerSprintf(Header h, const char *fmt, headerTagTableEntry tags, headerSprintfExtension exts, errmsg_t *errmsg)
Return formatted output string from header tags.
int rpmfiFC(rpmfi fi)
Return file count from file info set.
struct rpmte_s * rpmte
An element of a transaction set, i.e.
rpmmi rpmmiInit(rpmdb db, rpmTag tag, const void *keyp, size_t keylen)
Return database iterator.
int rpmtsInitDSI(const rpmts ts)
Initialize disk space info for each and every mounted file systems.
const char * rpmtsCurrDir(rpmts ts)
Get transaction currDir, i.e.
rpmPRCO rpmdsNewPRCO(Header h)
Create dependency set(s) container.
Yet Another syslog(3) API clone.
enum rpmElementType_e rpmElementType
Transaction element type.
rpmuint32_t rpmtsSetTid(rpmts ts, rpmuint32_t tid)
Set transaction id, i.e.
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
Set transaction flags, i.e.
void delMacro(MacroContext mc, const char *n)
Delete macro from context.
pgpVSFlags pgpDigVSFlags
Disabler bits(s) for signature/digest checking.
void rpmtsCleanDig(rpmts ts)
Free signature verification data.
const char * rpmteNEVR(rpmte te)
Retrieve name-version-release string from transaction element.
const char * Fstrerror(FD_t fd)
strerror(3) clone.
void * xcalloc(size_t nmemb, size_t size)
int rpmdsSysinfo(rpmPRCO PRCO, const char *fn)
Load sysinfo dependencies into a dependency set.
rpmps rpmpsCreate(void)
Create a problem set.
rpmbf rpmbfFree(rpmbf bf)
Destroy a Bloom filter.
rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
Get unused item from pool, or alloc a new item.
void *(* rpmCallbackFunction)(const void *h, const rpmCallbackType what, const rpmuint64_t amount, const rpmuint64_t total, fnpyKey key, rpmCallbackData data)
int rpmGetMacroEntries(MacroContext mc, void *_mire, int used, const char ***avp)
Return macro entries as string array.
rpmfi rpmteFI(rpmte te, rpmTag tag)
Retrieve file info tag set from transaction element.
FD_t fdFree(FD_t fd, const char *msg)
int rpmbagDel(rpmbag bag, int i)
int argvCount(const ARGV_t argv)
Return no.
const char const bson * data
int rpmtsCloseSDB(rpmts ts)
Close the database used by the transaction to solve dependencies.
enum rpmdepFlags_e rpmdepFlags
Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.
unsigned long long rpmuint64_t
ARGV_t argvFree(ARGV_t argv)
Destroy an argv array.
int rpmtsNElements(rpmts ts)
Return number of (ordered) transaction set elements.
const char * rpmdsEVR(const rpmds ds)
Return current dependency epoch-version-release.
const char * tagName(rpmTag tag)
Return tag name from value.
int rpmdbOpen(const char *prefix, rpmdb *dbp, int mode, mode_t perms)
Open rpm database.
int rpmioAccess(const char *FN, const char *path, int mode)
Check FN access, expanding relative paths and twiddles.
rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char *fn, Header *hdrp)
Return package header from file handle, verifying digests/signatures.
rpmuint32_t rpmtsPrefColor(rpmts ts)
Retrieve preferred file color.
Structure(s) used for dependency tag sets.
void rpmteCleanDS(rpmte te)
Destroy dependency set info of transaction element.
struct tagStore_s * tagStore_t
int rpmtsRebuildDB(rpmts ts)
Rebuild the database used by the transaction.
The FD_t File Handle data structure.
rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
Return transaction database iterator.
struct rpmdb_s * rpmdb
Database of headers and tag value indices.
int rpmtsChrootDone(rpmts ts)
Get chrootDone flag, i.e.
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 rpmtsSolve(rpmts ts, rpmds ds, const void *data)
Attempt to solve a needed dependency using the solve database.
int rpmtsSetKeyring(rpmts ts, void *_keyring)
Set transaction keyring.
The structure used to store values parsed from a spec file.
pgpVSFlags rpmVSFlags
Bit(s) to control digest and signature verification.
Header headerFree(Header h)
Dereference a header instance.
static void rpmtsPrintStat(const char *name, struct rpmop_s *op)
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
const char const bson const bson * op
char * rpmExpand(const char *arg,...)
Return (malloc'ed) concatenated macro expansion(s).
rpmuint32_t rpmtsARBGoal(rpmts ts)
Return the autorollback goal.
static rpmts rpmtsGetPool(rpmioPool pool)
void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal)
Set autorollback goal.
int rpmdsAnyMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
void rpmtsSetType(rpmts ts, rpmTSType type)
Set transaction type.
void rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.
int rpmtsSetDBMode(rpmts ts, int dbmode)
Set dbmode of transaction set.
void rpmtsSetCurrDir(rpmts ts, const char *currDir)
Set transaction currDir, i.e.
static int sugcmp(const void *a, const void *b)
Compare suggested package resolutions (qsort/bsearch).
const char * rpmdsN(const rpmds ds)
Return current dependency name.
rpmmi rpmmiFree(rpmmi mi)
Destroy rpm database iterator.
int Fclose(FD_t fd)
fclose(3) clone.
Cumulative statistics for an operation.
rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
Return next transaction element of type.
void argvPrint(const char *msg, ARGV_t argv, FILE *fp)
Print argv array elements.
void yarnRelease(yarnLock bolt)
Spec rpmtsSetSpec(rpmts ts, Spec spec)
Set a spec control structure in transaction set.
rpmps rpmpsFree(rpmps ps)
Destroy a problem set.
Header headerLink(Header h)
Reference a header instance.
rpmte rpmtsRelocateElement(rpmts ts)
Get current relocate transaction element.
rpmdb rpmtsGetRdb(rpmts ts)
Get transaction set database handle.
int rpmbagAdd(rpmbag bag, void *_db, int dbmode)
fnpyKey rpmteKey(rpmte te)
Retrieve key from transaction element.
enum rpmRC_e rpmRC
RPM return codes.
void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
Check a transaction element for disk space problems.
int Ferror(FD_t fd)
ferror(3) clone.
rpmuint32_t rpmtsColor(rpmts ts)
Retrieve color bits of transaction set.
rpmdepFlags rpmtsDFlags(rpmts ts)
Get dependency flags, i.e.
urltype urlPath(const char *url, const char **pathp)
Return path component of URL.
const char const bson * key
rpmdepFlags rpmtsSetDFlags(rpmts ts, rpmdepFlags depFlags)
Set dependency flags, i.e.
dbiIndex dbiOpen(rpmdb db, rpmTag tag, unsigned int flags)
rpmts rpmtsCreate(void)
Create an empty transaction set.
Methods to handle package elements.
rpmte rpmtsSetRelocateElement(rpmts ts, rpmte relocateElement)
Set current relocate transaction element.
rpmioPool rpmioNewPool(const char *name, size_t size, int limit, int flags, char *(*dbg)(void *item), void(*init)(void *item), void(*fini)(void *item))
Create a memory pool.
rpmps rpmtsProblems(rpmts ts)
Return current transaction set problems.
enum rpmtransFlags_e rpmtransFlags
Bit(s) to control rpmtsRun() operation.
int rpmtsOpenSDB(rpmts ts, int dbmode)
Open the database used by the transaction to solve dependencies.
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
Set verify signatures flag(s).
char * stpcpy(char *dest, const char *src)
int rpmGetFilesystemList(const char ***listptr, rpmuint32_t *num)
Return (cached) file system mount points.
struct rpmts_s * rpmts
The RPM Transaction Set.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
tsmStage rpmtsGoal(rpmts ts)
Retrieve goal of transaction set.
Structures and prototypes used for an "rpmts" transaction set.
Header rpmmiNext(rpmmi mi)
Return next package header from iteration.
rpmVSFlags rpmtsVSFlags(rpmts ts)
Get verify signatures flag(s).
void * rpmtsAcquireLock(rpmts ts)
int argvSplit(ARGV_t *argvp, const char *str, const char *seps)
Split a string into an argv array.
int rpmtsUnorderedSuccessors(rpmts ts, int first)
Set index of 1st element of successors.
int rpmtsOpenDB(rpmts ts, int dbmode)
Open the database used by the transaction.
fnpyKey * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, alKey *keyp)
Check added package file lists for package(s) that have a provide.
rpmal rpmalFree(rpmal al)
Destroy available list.
#define RMIL_DEFAULT
Markers for sources of macros added throughout rpm.
void * rpmtsGetKeyring(rpmts ts, int autoload)
Get transaction keyring.
Structures used for managing added/available package lists.
File state machine to handle archive I/O and system call's.
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
Get problem ignore bit mask, i.e.
rpmbag rpmbagFree(rpmbag bag)
Destroy a bag wrapper.
int rpmtsSELinuxEnabled(rpmts ts)
Get selinuxEnabled flag, i.e.
rpmps rpmpsLink(rpmps ps, const char *msg)
Reference a problem set instance.
rpmuint32_t rpmtsGetTid(rpmts ts)
Get transaction id, i.e.
rpmtsi rpmtsiInit(rpmts ts)
Create transaction element iterator.
Access RPM indices using Berkeley DB interface(s).
int rpmdbClose(rpmdb db)
Close all database indices and free rpmdb.
rpmtransFlags rpmtsFlags(rpmts ts)
Get transaction flags, i.e.
int rpmtsDBMode(rpmts ts)
Retrieve dbmode of transaction set.
rpmuint32_t rpmtsSetColor(rpmts ts, rpmuint32_t color)
Set color bits of transaction set.
int rpmtsCloseDB(rpmts ts)
Close the database used by the transaction.
int rpmExpandNumeric(const char *arg)
Return macro expansion as a numeric value.
static void rpmtsFini(void *_ts)
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
#define RPMDBI_PACKAGES
Pseudo-tags used by the rpmdb and rpmgi iterator API's.
FD_t rpmtsScriptFd(rpmts ts)
void rpmtsEmpty(rpmts ts)
Re-create an empty transaction set.
tsmStage rpmtsSetGoal(rpmts ts, tsmStage goal)
Set goal of transaction set.
void rpmtsClean(rpmts ts)
Free memory needed only for dependency checks and ordering.
int rpmtsAvailable(rpmts ts, const rpmds ds)
Attempt to solve a needed dependency using memory resident tables.
int Unlink(const char *path)
unlink(2) clone.