16 #define _RPMDB_INTERNAL
19 #define _RPMDS_INTERNAL
20 #define _RPMEVR_INTERNAL
24 #define _RPMTE_INTERNAL
26 #define _RPMTS_INTERNAL
36 #define CACHE_DEPENDENCY_RESULT 1
37 #if defined(CACHE_DEPENDENCY_RESULT)
57 static int uintcmp(
const void * a,
const void *
b)
60 const uint32_t * aptr = (
const uint32_t *) a;
61 const uint32_t * bptr = (
const uint32_t *) b;
62 int rc = (*aptr - *bptr);
85 if (ts->numRemovedPackages > 0 && ts->removedPackages !=
NULL) {
86 uint32_t * needle =
NULL;
87 needle = (uint32_t *) bsearch(&hdrNum,
88 ts->removedPackages, ts->numRemovedPackages,
89 sizeof(*ts->removedPackages),
uintcmp);
93 *indexp = needle - ts->removedPackages;
98 if (ts->rbf ==
NULL) {
99 static size_t n = 10000;
100 static double e = 1.0e-4;
103 rpmbfParams(n, e, &m, &k);
104 ts->rbf = rpmbfNew(m, k, 0);
107 if (ts->numRemovedPackages == ts->allocedRemovedPackages) {
108 ts->allocedRemovedPackages += ts->delta;
110 ts->removedPackages = (uint32_t *)
xrealloc(ts->removedPackages,
111 sizeof(*ts->removedPackages) * ts->allocedRemovedPackages);
115 xx = rpmbfAdd(ts->rbf, &hdrNum,
sizeof(hdrNum));
117 ts->removedPackages[ts->numRemovedPackages] =
hdrNum;
118 ts->numRemovedPackages++;
119 if (ts->numRemovedPackages > 1)
120 qsort(ts->removedPackages, ts->numRemovedPackages,
121 sizeof(*ts->removedPackages),
uintcmp);
123 if (ts->orderCount >= ts->orderAlloced) {
124 ts->orderAlloced += (ts->orderCount - ts->orderAlloced) + ts->delta;
126 ts->order = (
rpmte *)
xrealloc(ts->order,
sizeof(*ts->order) * ts->orderAlloced);
131 ts->order[ts->orderCount] =
p;
134 *indexp = ts->orderCount;
153 const char * one, * two;
165 rc = ((
strcmp(one, two) == 0) ? 1 : 0);
166 else if (one && !two)
168 else if (!one && two)
227 if (tscolor && hcolor && ohcolor && !(hcolor & ohcolor))
234 if (p->originTid[0] == 0 || p->originTid[0] > he->
p.
ui32p[0]
235 || (he->
c > 1 && p->originTid[0] == he->
p.
ui32p[0] && p->originTid[1] > he->
p.
ui32p[1]))
237 p->originTid[0] = he->
p.
ui32p[0];
238 p->originTid[1] = (he->
c > 1 ? he->
p.
ui32p[1] : 0);
245 if (p->originTime[0] == 0 || p->originTime[0] > he->
p.
ui32p[0]
246 || (he->
c > 1 && p->originTime[0] == he->
p.
ui32p[0] && p->originTime[1] > he->
p.
ui32p[1]))
248 p->originTime[0] = he->
p.
ui32p[0];
249 p->originTime[1] = (he->
c > 1 ? he->
p.
ui32p[1] : 0);
254 #if defined(RPM_VENDOR_WINDRIVER)
261 if (tscolor && (!hcolor || !ohcolor)) {
270 if (arch !=
NULL && oharch !=
NULL) {
271 if (
strcmp(
"noarch", arch) ||
strcmp(
"noarch", oharch)) {
272 if (!_isCompatibleArch(arch, oharch)) {
274 oharch =
_free(oharch);
280 oharch =
_free(oharch);
291 assert(lastx >= 0 && lastx < ts->orderCount);
292 q = ts->order[lastx];
316 size_t flen = strlen(fn);
317 size_t slen = strlen(suffix);
318 return (flen > slen && !
strcmp(fn + flen - slen, suffix));
356 default:
return 0;
break;
362 xx =
rpmmiPrune(mi, ts->removedPackages, ts->numRemovedPackages, 1);
383 if (nrefs == 0 && debuginfoInstance > 0 && debuginfoHeader !=
NULL) {
391 assert(lastx >= 0 && lastx < ts->orderCount);
392 q = ts->order[lastx];
405 debuginfoHeader =
NULL;
440 if (obsoletes !=
NULL)
454 if (tscolor && dscolor && !(tscolor & dscolor))
467 xx =
rpmmiPrune(mi, ts->removedPackages, ts->numRemovedPackages, 1);
478 if (tscolor && hcolor && ohcolor && !(hcolor & ohcolor))
492 assert(lastx >= 0 && lastx < ts->orderCount);
493 q = ts->order[lastx];
511 #if defined(RPM_VENDOR_WINDRIVER)
513 int _isCompatibleArch(
const char * arch,
const char * compat)
515 const char * compatArch =
rpmExpand(compat,
" %{?_", compat,
"_compat_arch}",
NULL);
516 const char *
p, * pe, *
t;
520 if (arch[0] ==
'i' && arch[2] ==
'8' && arch[3] ==
'6') {
521 if ((arch[0] == compat[0]) &&
522 (arch[2] == compat[2]) &&
523 (arch[3] == compat[3]))
526 if (!
strcmp(compat,
"x86_32"))
530 for ( p = pe = compatArch ; *pe && match == 0 ; ) {
532 pe =
p ;
while (*pe && !
xisspace(*pe)) pe++;
535 t = strndup(p, (pe - p));
542 compatArch =
_free(compatArch);
557 const char * arch =
NULL;
558 const char * os =
NULL;
559 rpmds oldChk, newChk;
606 platform = he->
p.
str;
607 if (!xx || platform ==
NULL)
612 #if defined(RPM_VENDOR_MANDRIVA)
619 platform =
_free(platform);
644 platform =
_free(platform);
680 #if defined(RPM_VENDOR_WINDRIVER)
682 if (!_isCompatibleArch(arch, parch))
686 if (arch[0] ==
'i' && arch[2] ==
'8' && arch[3] ==
'6') {
687 if (arch[0] != parch[0])
continue;
688 if (arch[2] != parch[2])
continue;
689 if (arch[3] != parch[3])
continue;
692 else if (
strcmp(arch, parch))
712 _(
"package %s was already added, skipping %s\n"),
713 (pkgNEVR ? pkgNEVR + 2 :
"?pkgNEVR?"),
714 (addNEVR ? addNEVR + 2 :
"?addNEVR?"));
726 _(
"package %s was already added, replacing with %s\n"),
727 (pkgNEVR ? pkgNEVR + 2 :
"?pkgNEVR?"),
728 (addNEVR ? addNEVR + 2 :
"?addNEVR?"));
745 if (oc >= ts->orderAlloced) {
746 ts->orderAlloced += (oc - ts->orderAlloced) + ts->delta;
748 ts->order = (
rpmte *)
xrealloc(ts->order, ts->orderAlloced *
sizeof(*ts->order));
755 if (duplicate && oc < ts->orderCount) {
774 ts->teInstall =
NULL;
781 ts->numAddedPackages++;
784 ts->teInstall = ts->order[
oc];
791 if (!(upgrade & 0x1))
838 if (rc == 0 && oc >= 0 && oc < ts->orderCount) {
840 ts->teErase = ts->order[
oc];
873 sysinfo_path =
_free(sysinfo_path);
896 #if defined(CACHE_DEPENDENCY_RESULT)
897 int _cacheThisRC = 1;
908 #if defined(CACHE_DEPENDENCY_RESULT)
925 size_t DNEVRlen = strlen(DNEVR);
927 xx = dbiCopen(dbi, dbiTxnid(dbi), &dbcursor, 0);
929 memset(key, 0,
sizeof(*key));
930 key->
data = (
void *) DNEVR;
931 key->
size = DNEVRlen;
932 memset(data, 0,
sizeof(*data));
934 data->
size = datalen;
936 xx = dbiGet(dbi, dbcursor, key, data,
DB_SET);
938 DNEVR = (
char *) key->
data;
939 DNEVRlen = key->
size;
941 datalen = data->
size;
943 if (xx == 0 && datap && datalen == 4)
944 memcpy(&rc, datap, datalen);
945 xx = dbiCclose(dbi, dbcursor, 0);
963 if (Flags & RPMSENSE_MISSINGOK)
973 s = Name;
while (*s &&
xisdigit(*s)) s++;
978 uid = strtol(Name,
NULL, 10);
981 rc = (xx >= 0 ? 0 : 1);
982 if (Flags & RPMSENSE_MISSINGOK)
990 s = Name;
while (*s &&
xisdigit(*s)) s++;
995 gid = strtol(Name,
NULL, 10);
998 rc = (xx >= 0 ? 0 : 1);
999 if (Flags & RPMSENSE_MISSINGOK)
1008 if (Flags & RPMSENSE_MISSINGOK)
1016 const char ** fs =
NULL;
1021 fs = ts->filesystems;
1022 nfs = ts->filesystemCount;
1025 for (i = 0; i < nfs; i++) {
1026 if (!
strcmp(fs[i], Name))
1029 rc = (i < nfs ? 0 : 1);
1030 if (Flags & RPMSENSE_MISSINGOK)
1037 size_t nb = strlen(Name);
1038 rpmDiskSpaceInfo dsi =
NULL;
1039 const char ** fs =
NULL;
1040 size_t fslen = 0, longest = 0;
1045 fs = ts->filesystems;
1046 nfs = ts->filesystemCount;
1049 for (i = 0; i < nfs; i++) {
1050 fslen = strlen(fs[i]);
1053 if (strncmp(fs[i], Name, fslen))
1055 if (fslen > 1 && Name[fslen] !=
'/' && Name[fslen] !=
'\0')
1057 if (fslen < longest)
1071 if (strchr(
"Gg", end[0]) && strchr(
"Bb", end[1]) && !end[2])
1072 needed *= 1024 * 1024 * 1024;
1073 if (strchr(
"Mm", end[0]) && strchr(
"Bb", end[1]) && !end[2])
1074 needed *= 1024 * 1024;
1075 if (strchr(
"Kk", end[0]) && strchr(
"Bb", end[1]) && !end[2])
1078 needed *= 1024 * 1024;
1080 needed = BLOCK_ROUND(needed, dsi->f_bsize);
1081 xx = (dsi->f_bavail - needed);
1087 if (Flags & RPMSENSE_MISSINGOK)
1095 const char *filename;
1103 if ((cp = (
char *) strchr(filename,
':')) !=
NULL) {
1105 digestHashAlgo = algo;
1110 fd =
Fopen(filename,
"r.fdio");
1114 size_t digestlen = 0;
1116 size_t nbuf = 8 * BUFSIZ;
1120 while ((nb =
Fread(buf,
sizeof(buf[0]), nbuf, fd)) > 0)
1125 xx = (EVR && *EVR && digest && *
digest) ? strcasecmp(EVR, digest) : -1;
1129 if (Flags & RPMSENSE_MISSINGOK)
1153 if (Flags & RPMSENSE_MISSINGOK)
1169 else if (Name[0] ==
'/')
1174 if (!(Name[0] ==
'/' || !
strcmp(Name,
"*")))
1184 if (Flags & RPMSENSE_MISSINGOK)
1192 if (!(EVR && *EVR)) {
1193 static const char gnupg_pre[] =
"%(%{__gpg} --batch --no-tty --quiet --verify ";
1194 static const char gnupg_post[] =
" 2>/dev/null; echo $?)";
1195 const char * t =
rpmExpand(gnupg_pre, Name, gnupg_post,
NULL);
1196 rc = (t && t[0] ==
'0') ? 0 : 1;
1200 static const char gnupg_pre[] =
"%(%{__gpg} --batch --no-tty --quiet --verify ";
1201 static const char gnupg_post[] =
" 2>&1 | grep '^Primary key fingerprint:' | sed -e 's;^.*: *;;' -e 's; *;;g')";
1202 const char * t =
rpmExpand(gnupg_pre, Name, gnupg_post,
NULL);
1203 rc = ((Flags &
RPMSENSE_EQUAL) && strcasecmp(EVR, t) == 0) ? 0 : 1;
1206 if (Flags & RPMSENSE_MISSINGOK)
1213 static const char macro_pre[] =
"%{?";
1214 static const char macro_post[] =
":0}";
1215 const char * a =
rpmExpand(macro_pre, Name, macro_post,
NULL);
1217 rc = (a && a[0] ==
'0') ? 0 : 1;
1219 if (Flags & RPMSENSE_MISSINGOK)
1226 const char * a = envGet(Name);
1233 int sense = (a && *a) ?
strcmp(a, b) : -1;
1247 if (Flags & RPMSENSE_MISSINGOK)
1255 pid_t
pid = strtol(Name, &t, 10);
1257 if (t ==
NULL || *t !=
'\0') {
1261 if (fn && *fn !=
'%' && (fd =
Fopen(fn,
"r.fdio")) && !
Ferror(fd)) {
1263 size_t nb =
Fread(buf,
sizeof(buf[0]),
sizeof(buf), fd);
1266 pid = strtol(buf, &t, 10);
1273 rc = (pid > 0 ? (kill(pid, 0) < 0 &&
errno == ESRCH) : 1);
1274 if (Flags & RPMSENSE_MISSINGOK)
1296 if (Flags & RPMSENSE_MISSINGOK)
1317 if (Flags & RPMSENSE_MISSINGOK)
1324 if (sysinfo_path ==
NULL) {
1326 if (!(sysinfo_path !=
NULL && *sysinfo_path ==
'/')) {
1327 sysinfo_path =
_free(sysinfo_path);
1351 static int oneshot = -1;
1355 if (rpmlibP ==
NULL)
1366 static int oneshot = -1;
1368 if (oneshot && cpuinfoP ==
NULL)
1370 if (cpuinfoP ==
NULL)
1381 static int oneshot = -1;
1385 if (getconfP ==
NULL)
1396 static int oneshot = -1;
1413 char *
fn = strcpy((
char *)
alloca(strlen(Name)+1), Name);
1420 fn[strlen(fn)-1] =
'\0';
1425 if (!(xx == 0 && sonameP !=
NULL))
1445 #if defined(CACHE_DEPENDENCY_RESULT)
1459 if (Name[0] ==
'/' && Name[1] ==
'\0') {
1463 if (Name[0] ==
'/') {
1466 ts->removedPackages, ts->numRemovedPackages, 1);
1477 ts->removedPackages, ts->numRemovedPackages, 1);
1492 if (ts->solve !=
NULL) {
1493 xx = (*ts->solve) (ts, dep, ts->solveData);
1505 if (Flags & RPMSENSE_MISSINGOK) {
1507 #if defined(CACHE_DEPENDENCY_RESULT)
1520 #if defined(CACHE_DEPENDENCY_RESULT)
1531 size_t DNEVRlen = strlen(DNEVR);
1535 memset(key, 0,
sizeof(*key));
1536 key->
data = (
void *) DNEVR;
1537 key->
size = DNEVRlen;
1538 memset(data, 0,
sizeof(*data));
1543 xx = dbiPut(dbi, dbcursor, key, data, 0);
1574 const char * depName,
1589 #if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_VENDOR_PLD) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS)
1595 if (requires !=
NULL)
1596 while (ourrc < terminate &&
rpmdsNext(requires) >= 0) {
1602 if (depName !=
NULL &&
strcmp(depName, Name))
1612 if (tscolor && dscolor && !(tscolor & dscolor))
1623 if (ts->availablePackages !=
NULL) {
1628 rpmdsProblem(ps, pkgNEVRA, requires, suggestedKeys, adding);
1641 if (conflicts !=
NULL)
1642 while (ourrc < terminate &&
rpmdsNext(conflicts) >= 0) {
1648 if (depName !=
NULL &&
strcmp(depName, Name))
1658 if (tscolor && dscolor && !(tscolor & dscolor))
1678 #if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_VENDOR_PLD) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS)
1679 dirname_deps =
rpmExpandNumeric(
"%{?_check_dirname_deps}%{?!_check_dirname_deps:1}");
1683 if (dirnames !=
NULL)
1684 while (ourrc < terminate &&
rpmdsNext(dirnames) >= 0) {
1690 if (depName !=
NULL &&
strcmp(depName, Name))
1700 if (tscolor && dscolor && !(tscolor & dscolor))
1711 if (ts->availablePackages !=
NULL) {
1716 rpmdsProblem(ps, pkgNEVRA, dirnames, suggestedKeys, adding);
1727 #if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_VENDOR_PLD) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS)
1730 symlink_deps =
rpmExpandNumeric(
"%{?_check_symlink_deps}%{?!_check_symlink_deps:1}");
1734 if (linktos !=
NULL)
1735 while (ourrc < terminate &&
rpmdsNext(linktos) >= 0) {
1743 if (depName !=
NULL &&
strcmp(depName, Name))
1753 if (tscolor && dscolor && !(tscolor & dscolor))
1764 if (ts->availablePackages !=
NULL) {
1769 rpmdsProblem(ps, pkgNEVRA, linktos, suggestedKeys, adding);
1780 #if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_ARK) || defined(RPM_VENDOR_PLD) || defined(RPM_OPTIONAL_DIRNAME_AND_SYMLINK_DEPS)
1812 ts->removedPackages, ts->numRemovedPackages, 1);
1824 if (ourrc >= terminate) {
1844 requires, conflicts, dirnames, linktos,
1845 depName, depNS, tscolor, adding);
1910 const char * depName =
NULL;
1915 int closeatexit = 0;
1929 closeatexit = (rc == 0);
1931 if (rc && (ourrc = rc) >= terminate)
1944 rpmds provides, requires, conflicts, dirnames, linktos;
1967 requires, conflicts, dirnames, linktos,
1969 if (rc && (ourrc = rc) >= terminate)
1974 if (provides !=
NULL)
1975 while (ourrc < terminate &&
rpmdsNext(provides) >= 0) {
1976 depName =
_free(depName);
1984 if (envPut(depName, EVR));
1993 if (rc && (ourrc = rc) >= terminate)
1998 while (ourrc < terminate &&
rpmfiNext(fi) >= 0) {
1999 depName =
_free(depName);
2005 if (rc && (ourrc = rc) >= terminate)
2009 if (rc && (ourrc = rc) >= terminate)
2027 if (provides !=
NULL)
2028 while (ourrc < terminate &&
rpmdsNext(provides) >= 0) {
2029 depName =
_free(depName);
2036 if (rc && (ourrc = rc) >= terminate)
2041 while (ourrc < terminate &&
rpmfiNext(fi) >= 0) {
2042 depName =
_free(depName);
2048 if (rc && (ourrc = rc) >= terminate)
2052 if (rc && (ourrc = rc) >= terminate)
2058 {
const char * tsNEVRA =
"transaction dependencies";
2063 const char * dep =
NULL;
2068 if (rc && (ourrc = rc) >= terminate)
2074 depName =
_free(depName);
2080 #if defined(CACHE_DEPENDENCY_RESULT)
int rpmdsNext(rpmds ds)
Return next dependency set iterator index.
static const char * suffix[]
const char * rpmteNEVRA(rpmte te)
Retrieve name-version-release.arch string from transaction element.
qsort(mc->macroTable, mc->firstFree, sizeof(mc->macroTable[0]), compareMacroName)
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
Retrieve operation timestamp from a transaction set.
struct rpmQVKArguments_s * QVA_t
rpmlog(RPMLOG_ERR,"%s\n", buf)
rpmuint32_t rpmteColor(rpmte te)
Retrieve color bits of transaction element.
int rpmdsNegateRC(const rpmds ds, int rc)
Negate return code for negated comparisons.
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.
enum nsType_e nsType
Dependency types.
const char * rpmProblemString(const rpmProblem prob)
Return formatted string representation of a problem.
rpmProblem rpmpsGetProblem(rpmps ps, int num)
Return a problem from problem set.
#define RPMSENSE_SENSEMASK
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.
void * alKey
An added/available package retrieval key.
Structures used for an "rpmte" transaction element.
struct rpmPRCO_s * rpmPRCO
Container for commonly extracted dependency set(s).
static rpmTag _debuginfo_tag
char * xstrdup(const char *str)
int rpmtsDBMode(rpmts ts)
Retrieve dbmode of transaction set.
FD_t Fopen(const char *path, const char *_fmode)
fopen(3) clone.
char * rpmGetPath(const char *path,...)
Return (malloc'ed) expanded, canonicalized, file path.
uint32_t rpmmiInstance(rpmmi mi)
Return header instance for current position of rpmdb iterator.
rpmuint32_t hGetColor(Header h)
Return header color.
Structure(s) used for file info tag sets.
rpmfi rpmteFI(rpmte te, rpmTag tag)
Retrieve file info tag set from transaction element.
static char *size_t nb
fgets(3) analogue that reads \ continuations.
static int unsatisfiedDepend(rpmts ts, rpmds dep, int adding)
Check dep for an unsatisfied dependency.
struct rpmts_s * rpmts
The RPM Transaction Set.
int rpmPlatformScore(const char *platform, void *mi_re, int mi_nre)
evrFlags rpmdsFlags(const rpmds ds)
Return current dependency flags.
rpmdb rpmtsGetRdb(rpmts ts)
Get transaction set database handle.
char * gidToGname(gid_t gid)
alKey rpmalAdd(rpmal *alistp, alKey pkgKey, fnpyKey key, rpmds provides, rpmfi fi, rpmuint32_t tscolor)
Add package to available list.
rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
Return next transaction element of type.
const char * rpmfiFN(rpmfi fi)
Return current file name from file info set.
static char * sysinfo_path
rpmPRCO rpmdsNewPRCO(Header h)
Create dependency set(s) container.
struct rpmps_s * rpmps
Transaction problems found while processing a transaction set/.
const char * rpmteN(rpmte te)
Retrieve name string of transaction element.
int rpmdsGetconf(rpmds *dsp, const char *path)
Load getconf provides into a dependency set.
rpmds rpmdsNew(Header h, rpmTag tagN, int flags)
Create and load a dependency set.
static int uintcmp(const void *a, const void *b)
Compare removed package instances (qsort/bsearch).
static int checkDependentConflicts(rpmts ts, const char *depName, nsType depNS)
Check to-be-added dependencies against installed conflicts.
Command line option information.
int rpmfiFC(rpmfi fi)
Return file count from file info set.
static int rpmtsAddObsoletes(rpmts ts, rpmte p, rpmuint32_t hcolor)
Add Obsoletes: erasures to a transaction set.
static int removePackage(rpmts ts, Header h, uint32_t hdrNum, int *indexp, alKey depends)
Add removed package instance to ordered transaction set.
const char * rpmteA(rpmte te)
Retrieve arch string of transaction element.
int rpmpsNumProblems(rpmps ps)
Return number of problems in set.
rpmPRCO rpmdsFreePRCO(rpmPRCO PRCO)
Free dependency set(s) container.
enum evrFlags_e evrFlags
Dependency Attributes.
rpmds rpmteDS(rpmte te, rpmTag tag)
Retrieve dependency tag set from transaction element.
alKey rpmteSetAddedKey(rpmte te, alKey npkgKey)
int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
Display results of package verify.
#define RPMSENSE_NOTEQUAL
enum rpmRC_e rpmRC
RPM return codes.
memset(_r, 0, sizeof(*_r))
enum rpmElementType_e rpmElementType
Transaction element type.
int rpmteChain(rpmte p, rpmte q, Header oh, const char *msg)
Chain p <-> q forward/backward transaction element links.
rpmds rpmdsSingle(rpmTag tagN, const char *N, const char *EVR, evrFlags Flags)
Create, load and initialize a dependency set of size 1.
int _rpmtsCheck(rpmts ts)
assert(key->size==sizeof(hdrNum))
int rpmtsAddEraseElement(rpmts ts, Header h, uint32_t hdrNum)
Add package to be erased to transaction set.
void rpmnsClean(void)
Clean global name space dependency sets.
void rpmdsNotify(rpmds ds, const char *where, int rc)
Notify of results of dependency match.
rpmRC rpmnsProbeSignature(void *_ts, const char *fn, const char *sigfn, const char *pubfn, const char *pubid, int flags)
Verify OpenPGP signature on a file.
rpmmi rpmmiFree(rpmmi mi)
Destroy rpm database iterator.
alKey rpmteAddedKey(rpmte te)
static int checkPackageSet(rpmts ts, const char *depName, nsType depNS, rpmmi mi, int adding)
Check dependency against installed packages.
fprintf(stderr,"--> %s(%p,%p,%p) sig %p sigp %p\n", __FUNCTION__, dig, t, rsactx, sig, sigp)
int rpmdsSearch(rpmds ds, rpmds ods)
Search a sorted dependency set for an element that overlaps.
int gnameToGid(const char *thisGname, gid_t *gid)
int rpmdsCpuinfo(rpmds *dsp, const char *fn)
Load /proc/cpuinfo provides into a dependency set.
static int rpmtsEraseDebuginfo(rpmts ts, rpmte p, Header h, alKey pkgKey)
Add unreferenced debuginfo erasures to a transaction set.
rpmds rpmdsFromPRCO(rpmPRCO PRCO, rpmTag tagN)
Retrieve a dependency set from container.
enum pgpHashAlgo_e pgpHashAlgo
9.4.
int rpmdsAnyMatchesDep(const Header h, const rpmds req, int nopromote)
Compare package provides dependencies from header with a single dependency.
static int rpmHeadersIdentical(Header first, Header second)
Are two headers identical?
rpmTag rpmdsTagN(const rpmds ds)
Return current dependency type.
static int xisspace(int c)
unsigned long long rpmuint64_t
int rpmDigestUpdate(DIGEST_CTX ctx, const void *data, size_t len)
Update context with next plain text buffer.
ARGV_t argvFree(ARGV_t argv)
Destroy an argv array.
int rpmtsCloseDB(rpmts ts)
Close the database used by the transaction.
int rpmioAccess(const char *FN, const char *path, int mode)
Check FN access, expanding relative paths and twiddles.
static rpmTag _obsolete_tag
Header rpmmiNext(rpmmi mi)
Return next package header from iteration.
rpmuint32_t rpmtsColor(rpmts ts)
Retrieve color bits of transaction set.
Structure(s) used for dependency tag sets.
int rpmdbCloseDBI(rpmdb db, int tag)
Close a single database index.
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 argvAdd(ARGV_t *argvp, ARGstr_t val)
Add a string to an argv array.
const char * _sysinfo_path
int rpmdsMergePRCO(void *context, rpmds ds)
Merge provides/requires/conflicts/obsoletes dependencies.
DIGEST_CTX rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
Initialize digest.
const char * rpmteSourcerpm(rpmte te)
Retrieve sourcerpm string from transaction element.
char * rpmExpand(const char *arg,...)
Return (malloc'ed) concatenated macro expansion(s).
int rpmtsOpenDB(rpmts ts, int dbmode)
Open the database used by the transaction.
size_t Fread(void *buf, size_t size, size_t nmemb, FD_t fd)
fread(3) clone.
rpmtsi rpmtsiFree(rpmtsi tsi)
Destroy transaction element iterator.
rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type, fnpyKey key, rpmRelocation relocs, uint32_t dboffset, alKey pkgKey)
Create a transaction element.
int Fclose(FD_t fd)
fclose(3) clone.
struct rpmds_s * rpmds
Dependency tag sets from a header, so that a header can be discarded early.
Header rpmteSetHeader(rpmte te, Header h)
Save header into transaction element.
int rpmfiNext(rpmfi fi)
Return next file iterator index.
int rpmteIsSource(rpmte te)
Retrieve isSource attribute of transaction element.
rpmps rpmpsFree(rpmps ps)
Destroy a problem set.
rpmds rpmdsFree(rpmds ds)
Destroy a dependency set.
#define CACHE_DEPENDENCY_RESULT
int Ferror(FD_t fd)
ferror(3) clone.
rpmfi rpmfiInit(rpmfi fi, int fx)
Initialize file iterator index.
struct rpmtsi_s * rpmtsi
Transaction element iterator.
return strcmp(ame->name, bme->name)
static int xisdigit(int c)
nsType rpmdsNSType(const rpmds ds)
Return dependency class type.
const char * rpmteO(rpmte te)
Retrieve os string of transaction element.
fnpyKey rpmalSatisfiesDepend(const rpmal al, const rpmds ds, alKey *keyp)
Check added package file lists for first package that has a provide.
dbiIndex dbiOpen(rpmdb db, rpmTag tag, unsigned int flags)
int rpmdsCompare(const rpmds A, const rpmds B)
Compare two versioned dependency ranges, looking for overlap.
rpmds rpmdsInit(rpmds ds)
Initialize dependency set iterator.
rpmtransFlags rpmtsFlags(rpmts ts)
Get transaction flags, i.e.
int rpmdsRpmlib(rpmds *dsp, void *tblp)
Load rpmlib provides into a dependency set.
rpmuint32_t rpmdsColor(const rpmds ds)
Return current dependency color.
static int checkDependentPackages(rpmts ts, const char *depName, nsType depNS)
Check to-be-erased dependencies against installed requires.
rpmds rpmdsLink(rpmds ds, const char *msg)
Reference a dependency set instance.
char * uidToUname(uid_t uid)
rpmRC rpmtsRollback(rpmts rbts, rpmprobFilterFlags ignoreSet, int running, rpmte rbte)
Rollback a failed transaction.
static int rpmtsAddUpgrades(rpmts ts, rpmte p, rpmuint32_t hcolor, Header h)
Add upgrade erasures to a transaction set.
const char * rpmdsEVR(const rpmds ds)
Return current dependency epoch-version-release.
const char * rpmdsDNEVR(const rpmds ds)
Return current formatted dependency string.
static int chkSuffix(const char *fn, const char *suffix)
Check string for a suffix.
rpmElementType rpmteType(rpmte te)
Retrieve type of transaction element.
int rpmdsUname(rpmds *dsp, const struct utsname *un)
enum rpmQueryFlags_e rpmQueryFlags
Bit(s) to control rpmQuery() operation, stored in qva_flags.
static int checkPackageDeps(rpmts ts, const char *pkgNEVRA, rpmds requires, rpmds conflicts, rpmds dirnames, rpmds linktos, const char *depName, nsType depNS, rpmuint32_t tscolor, int adding)
Check added requires/conflicts against against installed+added packages.
int argvSplit(ARGV_t *argvp, const char *str, const char *seps)
Split a string into an argv array.
void rpmalMakeIndex(rpmal al)
Generate index for available list.
static rpmTag _upgrade_tag
rpmPRCO rpmtsPRCO(rpmts ts)
Get transaction set dependencies.
fnpyKey * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, alKey *keyp)
Check added package file lists for package(s) that have a provide.
pgpHashAlgo pgpHashAlgoStringToNumber(const char *name, size_t name_len)
Convert a hash algorithm "foo" to the internal PGPHASHALGO_FOO number.
static void
Print copy of spec file, filling in Group/Description/Summary from specspo.
char * buf
Parse (and execute) macro undefinition.
const char * rpmteNEVR(rpmte te)
Retrieve name-version-release string from transaction element.
int rpmdsELF(const char *fn, int flags, int(*add)(void *context, rpmds ds), void *context)
Return a soname dependency constructed from an elf string.
int
Save source and expand field into target.
struct rpmfi_s * rpmfi
File info tag sets from a header, so that a header can be discarded early.
int rpmmiPrune(rpmmi mi, uint32_t *hdrNums, int nHdrNums, int sorted)
Remove items from set of package instances to iterate.
void rpmDigestFinal(rpmDigestDup(md5ctx),&md5sum,&md5len, 0)
const char * rpmdsN(const rpmds ds)
Return current dependency name.
fnpyKey rpmteKey(rpmte te)
Retrieve key from transaction element.
Access RPM indices using Berkeley DB interface(s).
int unameToUid(const char *thisUname, uid_t *uid)
rpmte rpmteFree(rpmte te)
Destroy a transaction element.
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.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
static const char * platform
int(* rpmtsCheck)(rpmts ts)
Perform dependency resolution on the transaction set.
rpmds rpmdsThis(Header h, rpmTag tagN, evrFlags Flags)
Create, load and initialize a dependency for this header.
enum rpmdepFlags_e rpmdepFlags
Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.
int rpmExpandNumeric(const char *arg)
Return macro expansion as a numeric value.
#define RPMDBI_PACKAGES
Pseudo-tags used by the rpmdb and rpmgi iterator API's.
void rpmdsProblem(rpmps ps, const char *pkgNEVR, const rpmds ds, const fnpyKey *suggestedKeys, int adding)
Report a Requires: or Conflicts: dependency problem.
rpmtsi rpmtsiInit(rpmts ts)
Create transaction element iterator.
int rpmdsSetNoPromote(rpmds ds, int nopromote)
Set "Don't promote Epoch:" flag.
static PyObject *rpmds ds
rpmps rpmtsProblems(rpmts ts)
Return current transaction set problems.
struct _dbiIndex * dbiIndex
const unsigned char * digest