diff options
author | jbj <devnull@localhost> | 2001-11-01 23:18:15 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-11-01 23:18:15 +0000 |
commit | b0e16172c3b42c758fd411650a8c2bbbf791a507 (patch) | |
tree | 7bd3d8466d96fdd1fd5c3b79c6aadfc18702f2f5 /lib | |
parent | fe68f3c0cd84698d54764fd24a1b91a28e8703f5 (diff) | |
download | rpm-b0e16172c3b42c758fd411650a8c2bbbf791a507.tar.gz rpm-b0e16172c3b42c758fd411650a8c2bbbf791a507.tar.bz2 rpm-b0e16172c3b42c758fd411650a8c2bbbf791a507.zip |
- depends.c: availablePackage is (almost) opaque.
CVS patchset: 5147
CVS date: 2001/11/01 23:18:15
Diffstat (limited to 'lib')
-rw-r--r-- | lib/depends.c | 185 | ||||
-rw-r--r-- | lib/depends.h | 22 | ||||
-rw-r--r-- | lib/header.c | 8 | ||||
-rw-r--r-- | lib/header.h | 2 | ||||
-rw-r--r-- | lib/psm.c | 2 | ||||
-rw-r--r-- | lib/rpmal.c | 21 | ||||
-rw-r--r-- | lib/rpmal.h | 11 | ||||
-rw-r--r-- | lib/transaction.c | 10 |
8 files changed, 217 insertions, 44 deletions
diff --git a/lib/depends.c b/lib/depends.c index 010a27afc..005f23d21 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -412,8 +412,10 @@ rpmTransactionSet rpmtransCreateSet(rpmdb db, const char * rootDir) ts->currDir = NULL; ts->chrootDone = 0; + ts->numAddedPackages = 0; ts->addedPackages = alCreate(ts->delta); + ts->numAvailablePackages = 0; ts->availablePackages = alCreate(ts->delta); ts->orderAlloced = ts->delta; @@ -452,6 +454,7 @@ static int intcmp(const void * a, const void * b) /*@*/ static int removePackage(rpmTransactionSet ts, int dboffset, int depends) /*@modifies ts @*/ { + transactionElement p; /* Filter out duplicate erasures. */ if (ts->numRemovedPackages > 0 && ts->removedPackages != NULL) { @@ -478,18 +481,20 @@ static int removePackage(rpmTransactionSet ts, int dboffset, int depends) ts->order = xrealloc(ts->order, sizeof(*ts->order) * ts->orderAlloced); } - ts->order[ts->orderCount].type = TR_REMOVED; - ts->order[ts->orderCount].u.removed.dboffset = dboffset; - ts->order[ts->orderCount].u.removed.dependsOnIndex = depends; + p = ts->order + ts->orderCount; + memset(p, 0, sizeof(*p)); + p->type = TR_REMOVED; + p->u.removed.dboffset = dboffset; + p->u.removed.dependsOnIndex = depends; ts->orderCount++; return 0; } -const char * hGetNVR(Header h, const char ** np ) +char * hGetNVR(Header h, const char ** np ) { - const char * NVR, * n, * v, * r; - char * t; + const char * n, * v, * r; + char * NVR, * t; (void) headerNVR(h, &n, &v, &r); NVR = t = xcalloc(1, strlen(n) + strlen(v) + strlen(r) + sizeof("--")); @@ -512,35 +517,73 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, const char * addNVR = hGetNVR(h, &name); const char * pkgNVR = NULL; rpmTagType ont, ovt; + int duplicate = 0; + int apx; /* addedPackages index */ +#ifdef DYING availablePackage p; +#else + transactionElement p; +#endif rpmDepSet obsoletes = memset(alloca(sizeof(*obsoletes)), 0, sizeof(*obsoletes)); int alNum; int xx; int ec = 0; int rc; - int i = ts->orderCount; + int i; /* * Check for previously added versions with the same name. */ i = ts->orderCount; - for (i = 0; i < ts->orderCount; i++) { + apx = 0; + if ((p = ts->order) != NULL) + for (i = 0; i < ts->orderCount; i++, p++) { + const char * pname; Header ph; - if ((p = alGetPkg(ts->addedPackages, i)) == NULL) + /* XXX Only added packages are checked for dupes (for now). */ + switch (p->type) { + case TR_ADDED: + /*@switchbreak@*/ break; + case TR_REMOVED: + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + } + + apx++; + +#ifdef DYING + if ((p = alGetPkg(ts->addedPackages, te->u.addedIndex)) == NULL) break; /*@-type@*/ /* FIX: availablePackage excision */ if (strcmp(p->name, name)) continue; /*@=type@*/ - pkgNVR = alGetNVR(ts->addedPackages, i); + pkgNVR = alGetNVR(ts->addedPackages, te->u.addedIndex); if (pkgNVR == NULL) /* XXX can't happen */ continue; - ph = alGetHeader(ts->addedPackages, i, 0); + ph = alGetHeader(ts->addedPackages, te->u.addedIndex, 0); +#else + ph = alGetHeader(ts->addedPackages, p->u.addedIndex, 0); + if (ph == NULL) + break; + + pkgNVR = _free(pkgNVR); + pname = NULL; + pkgNVR = hGetNVR(ph, &pname); + + if (strcmp(pname, name)) { + pkgNVR = _free(pkgNVR); + ph = headerFree(ph, "alGetHeader nomatch"); + continue; + } + +#endif rc = rpmVersionCompare(ph, h); - ph = headerFree(ph, "alGetHeader"); + ph = headerFree(ph, "alGetHeader match"); if (rc > 0) { rpmMessage(RPMMESS_WARNING, @@ -556,18 +599,18 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, rpmMessage(RPMMESS_WARNING, _("older package %s already added, replacing with %s\n"), pkgNVR, addNVR); + duplicate = 1; } break; } /* XXX Note: i == ts->orderCount here almost always. */ - if (i == ts->orderAlloced) { ts->orderAlloced += ts->delta; ts->order = xrealloc(ts->order, ts->orderAlloced * sizeof(*ts->order)); } - ts->order[i].type = TR_ADDED; +#ifdef DYING { availablePackage this = alAddPackage(ts->addedPackages, i, h, key, fd, relocs); alNum = alGetPkgIndex(ts->addedPackages, this); @@ -577,9 +620,49 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, /* XXX sanity check */ if (alGetPkg(ts->addedPackages, alNum) == NULL) goto exit; +#else + alNum = alAddPackage(ts->addedPackages, apx, h, key, fd, relocs); + if (alNum == -1L) { + ec = 1; + goto exit; + } + p = ts->order + i; + memset(p, 0, sizeof(*p)); +assert(alNum == apx); + p->u.addedIndex = alNum; +#endif + + p->type = TR_ADDED; + p->multiLib = 0; + +#ifdef NOYET + /* XXX this needs a search over ts->order, not ts->addedPackages */ + { uint_32 *pp = NULL; + /* XXX This should be added always so that packages look alike. + * XXX However, there is logic in files.c/depends.c that checks for + * XXX existence (rather than value) that will need to change as well. + */ + if (hge(h, RPMTAG_MULTILIBS, NULL, (void **) &pp, NULL)) + multiLibMask = *pp; + + if (multiLibMask) { + for (i = 0; i < pkgNum - 1; i++) { + if (!strcmp (p->name, al->list[i].name) + && hge(al->list[i].h, RPMTAG_MULTILIBS, NULL, + (void **) &pp, NULL) + && !rpmVersionCompare(p->h, al->list[i].h) + && *pp && !(*pp & multiLibMask)) + p->multiLib = multiLibMask; + } + } + } +#endif - if (i == ts->orderCount) + if (!duplicate) { +assert(apx == ts->numAddedPackages); + ts->numAddedPackages++; ts->orderCount++; + } if (!upgrade) goto exit; @@ -612,11 +695,14 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, if (oldmultiLibMask && multiLibMask && !(oldmultiLibMask & multiLibMask)) { +#ifdef DYING /*@-type@*/ /* FIX: availablePackage excision */ availablePackage alp = alGetPkg(ts->addedPackages, alNum); if (alp != NULL) alp->multiLib = multiLibMask; /*@=type@*/ +#endif + p->multiLib = multiLibMask; } } /*@=branchstate@*/ @@ -673,8 +759,13 @@ exit: void rpmtransAvailablePackage(rpmTransactionSet ts, Header h, const void * key) { +#ifdef DYING availablePackage al; al = alAddPackage(ts->availablePackages, -1, h, key, NULL, NULL); +#else + /* XXX FIXME: return code -1L is error */ + (void) alAddPackage(ts->availablePackages, -1, h, key, NULL, NULL); +#endif } int rpmtransRemovePackage(rpmTransactionSet ts, int dboffset) @@ -709,7 +800,7 @@ rpmTransactionSet rpmtransFree(rpmTransactionSet ts) ts->di = _free(ts->di); ts->removedPackages = _free(ts->removedPackages); ts->order = _free(ts->order); - /*@-type@*/ /* FIX: cast? */ + /*@-type@*/ if (ts->scriptFd != NULL) { ts->scriptFd = fdFree(ts->scriptFd, "rpmtransSetScriptFd (rpmtransFree"); @@ -1016,10 +1107,17 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, {}; pp->suggestedPackages = xmalloc( (j + 1) * sizeof(*pp->suggestedPackages) ); +#ifdef DYING /*@-type@*/ /* FIX: availablePackage excision */ for (j = 0; suggestion[j] != NULL; j++) pp->suggestedPackages[j] = suggestion[j]->key; /*@=type@*/ +#else + for (j = 0; suggestion[j] != NULL; j++) + pp->suggestedPackages[j] = + alGetKey(ts->availablePackages, + alGetPkgIndex(ts->availablePackages, suggestion[j])); +#endif pp->suggestedPackages[j] = NULL; } else { pp->suggestedPackages = NULL; @@ -1532,6 +1630,8 @@ int rpmdepOrder(rpmTransactionSet ts) int qlen; int i, j; +assert(ts->numAddedPackages == alGetSize(ts->addedPackages)); + alMakeIndex(ts->addedPackages); /*@-modfilesystem -nullpass@*/ @@ -1544,6 +1644,7 @@ fprintf(stderr, "*** rpmdepOrder(%p) order %p[%d]\n", ts, ts->order, ts->orderCo if ((p = ts->order) != NULL) for (i = 0; i < ts->orderCount; i++, p++) { +#ifdef DYING /* Initialize tsortInfo. */ memset(&p->tsi, 0, sizeof(p->tsi)); p->npreds = 0; @@ -1552,6 +1653,7 @@ fprintf(stderr, "*** rpmdepOrder(%p) order %p[%d]\n", ts, ts->order, ts->orderCo p->name = NULL; p->version = NULL; p->release = NULL; +#endif /* XXX Only added packages are ordered (for now). */ switch (p->type) { @@ -1694,7 +1796,8 @@ rescan: qlen++; /*@-modfilesystem -nullpass@*/ if (_te_debug) -fprintf(stderr, "\t+++ %p[%d] %s addQ ++ q %p %d\n", p, i, p->NEVR, q, qlen); +fprintf(stderr, "\t+++ addQ ++ qlen %d p %p(%s)", qlen, p, p->NEVR); +prtTSI(" p", &p->tsi); /*@=modfilesystem =nullpass@*/ } @@ -1735,6 +1838,11 @@ fprintf(stderr, "\t+++ %p[%d] %s addQ ++ q %p %d\n", p, i, p->NEVR, q, qlen); addQ(p, &q->tsi.tsi_suc, &r); /*@=nullstate@*/ qlen++; +/*@-modfilesystem -nullpass@*/ +if (_te_debug) +fprintf(stderr, "\t+++ addQ ++ qlen %d p %p(%s)", qlen, p, p->NEVR); +prtTSI(" p", &p->tsi); +/*@=modfilesystem =nullpass@*/ } tsi = _free(tsi); } @@ -1869,8 +1977,6 @@ fprintf(stderr, "\t+++ %p[%d] %s addQ ++ q %p %d\n", p, i, p->NEVR, q, qlen); rpmMessage(RPMMESS_ERROR, _("rpmdepOrder failed, %d elements remain\n"), loopcheck); return loopcheck; - - return 1; } /* @@ -1994,9 +2100,11 @@ int rpmdepCheck(rpmTransactionSet ts, HFD_t hfd = headerFreeData; rpmdbMatchIterator mi = NULL; Header h = NULL; - availablePackage p; problemsSet ps = NULL; + transactionElement p; +#ifdef DYING int numAddedPackages; +#endif int closeatexit = 0; int i, j, xx; int rc; @@ -2008,7 +2116,9 @@ int rpmdepCheck(rpmTransactionSet ts, closeatexit = 1; } +#ifdef DYING numAddedPackages = alGetSize(ts->addedPackages); +#endif ps = xcalloc(1, sizeof(*ps)); ps->alloced = 5; @@ -2025,24 +2135,41 @@ int rpmdepCheck(rpmTransactionSet ts, * Look at all of the added packages and make sure their dependencies * are satisfied. */ - for (i = 0; i < numAddedPackages; i++) - { - char * pkgNVR, * n, * v, * r; + if ((p = ts->order) != NULL) + for (i = 0; i < ts->orderCount; i++, p++) { + char * pkgNVR = NULL, * n, * v, * r; rpmDepSet provides; uint_32 multiLib; - if ((p = alGetPkg(ts->addedPackages, i)) == NULL) - break; + /* XXX Only added packages are checked (for now). */ + switch (p->type) { + case TR_ADDED: + /*@switchbreak@*/ break; + case TR_REMOVED: + default: + continue; + /*@notreached@*/ /*@switchbreak@*/ break; + } - pkgNVR = alGetNVR(ts->addedPackages, i); +#ifdef DYING + pkgNVR = alGetNVR(ts->addedPackages, p->u.addedIndex); if (pkgNVR == NULL) /* XXX can't happen */ break; - multiLib = alGetMultiLib(ts->addedPackages, i); + multiLib = alGetMultiLib(ts->addedPackages, p->u.addedIndex); +#else + h = alGetHeader(ts->addedPackages, p->u.addedIndex, 0); + if (h == NULL) /* XXX can't happen */ + break; + + pkgNVR = _free(pkgNVR); + pkgNVR = hGetNVR(h, NULL); + multiLib = p->multiLib; +#endif rpmMessage(RPMMESS_DEBUG, "========== +++ %s\n" , pkgNVR); - h = alGetHeader(ts->addedPackages, i, 0); rc = checkPackageDeps(ts, ps, h, NULL, multiLib); h = headerFree(h, "alGetHeader"); + if (rc) { pkgNVR = _free(pkgNVR); goto exit; @@ -2061,7 +2188,7 @@ int rpmdepCheck(rpmTransactionSet ts, if (rc) goto exit; - provides = alGetProvides(ts->addedPackages, i); + provides = alGetProvides(ts->addedPackages, p->u.addedIndex); if (provides->Count == 0 || provides->N == NULL) continue; diff --git a/lib/depends.h b/lib/depends.h index 9cab805d5..c103b3bf8 100644 --- a/lib/depends.h +++ b/lib/depends.h @@ -60,6 +60,7 @@ struct transactionElement_s { char * version; /*@dependent@*/ /*@null@*/ char * release; + int npreds; /*!< No. of predecessors. */ int depth; /*!< Max. depth in dependency tree. */ struct tsortInfo_s tsi; @@ -67,6 +68,10 @@ struct transactionElement_s { TR_ADDED, /*!< Package will be installed. */ TR_REMOVED /*!< Package will be removed. */ } type; /*!< Package disposition (installed/removed). */ + + uint_32 multiLib; /* (TR_ADDED) MULTILIB */ + int_32 filesCount; /* (TR_ADDED) No. files in package. */ + /*@-fielduse@*/ /* LCL: confused by union? */ union { /*@unused@*/ int addedIndex; @@ -76,6 +81,7 @@ struct transactionElement_s { } removed; } u; /*@=fielduse@*/ + }; /** @@ -105,29 +111,39 @@ struct rpmTransactionSet_s { rpmProblemSet probs; /*!< Current problems in transaction. */ rpmprobFilterFlags ignoreSet; /*!< Bits to filter current problems. */ + int filesystemCount; /*!< No. of mounted filesystems. */ /*@dependent@*/ const char ** filesystems; /*!< Mounted filesystem names. */ /*@only@*/ struct diskspaceInfo * di; /*!< Per filesystem disk/inode usage. */ + int dbmode; /*!< Database open mode. */ /*@refcounted@*/ /*@null@*/ rpmdb rpmdb; /*!< Database handle. */ /*@only@*/ hashTable ht; /*!< Fingerprint hash table. */ + /*@only@*/ int * removedPackages; /*!< Set of packages being removed. */ - int numRemovedPackages; /*!< No. removed rpmdb instances. */ + int numRemovedPackages; /*!< No. removed package instances. */ int allocedRemovedPackages; /*!< Size of removed packages array. */ + /*@only@*/ availableList addedPackages;/*!< Set of packages being installed. */ + int numAddedPackages; /*!< No. added package instances. */ + /*@only@*/ availableList availablePackages; - /*!< Universe of possible packages. */ + /*!< Universe of available packages. */ + int numAvailablePackages; /*!< No. available package instances. */ + /*@only@*/ transactionElement order; /*!< Packages sorted by dependencies. */ int orderCount; /*!< No. of transaction elements. */ int orderAlloced; /*!< No. of allocated transaction elements. */ + /*@only@*/ TFI_t flList; /*!< Transaction element(s) file info. */ + int flEntries; /*!< No. of transaction elements. */ int chrootDone; /*!< Has chroot(2) been been done? */ /*@only@*/ const char * rootDir;/*!< Path to top of install tree. */ @@ -170,7 +186,7 @@ extern "C" { * @retval np name tag value * @return name-version-release string */ -/*@only@*/ const char * hGetNVR(Header h, /*@out@*/ const char ** np ) +/*@only@*/ char * hGetNVR(Header h, /*@out@*/ const char ** np ) /*@modifies *np @*/; /** \ingroup rpmdep diff --git a/lib/header.c b/lib/header.c index a4298aac6..01556bd56 100644 --- a/lib/header.c +++ b/lib/header.c @@ -107,7 +107,9 @@ Header XheaderLink(Header h, const char * msg, const char * fn, unsigned ln) if (_h_debug) fprintf(stderr, "--> h %p ++ %d %s at %s:%u\n", h, (h != NULL ? h->nrefs : 0), msg, fn, ln); /*@=modfilesystem@*/ - /*@-refcounttrans@*/ return h; /*@=refcounttrans@*/ + /*@-refcounttrans -nullret @*/ + return h; + /*@=refcounttrans =nullret @*/ } /** \ingroup header @@ -124,7 +126,7 @@ Header XheaderUnlink(/*@killref@*/ /*@null@*/ Header h, if (_h_debug) fprintf(stderr, "--> h %p -- %d %s at %s:%u\n", h, (h != NULL ? h->nrefs : 0), msg, fn, ln); /*@=modfilesystem@*/ - h->nrefs--; + if (h != NULL) h->nrefs--; return NULL; } @@ -140,6 +142,7 @@ Header XheaderFree( /*@null@*/ /*@killref@*/ Header h, { (void) XheaderUnlink(h, msg, fn, ln); + /*@-usereleased@*/ if (h == NULL || h->nrefs > 0) return NULL; /* XXX return previous header? */ @@ -163,6 +166,7 @@ Header XheaderFree( /*@null@*/ /*@killref@*/ Header h, /*@-refcounttrans@*/ h = _free(h); /*@=refcounttrans@*/ return h; + /*@=usereleased@*/ } /** \ingroup header diff --git a/lib/header.h b/lib/header.h index 3bd4664b5..80e17773b 100644 --- a/lib/header.h +++ b/lib/header.h @@ -320,7 +320,7 @@ Header (*HDRlink) (Header h, const char * msg, const char * fn, unsigned ln) * @return NULL always */ typedef -Header (*HDRunlink) (/*@killref@*/ Header h, +Header (*HDRunlink) (/*@killref@*/ /*@null@*/ Header h, const char * msg, const char * fn, unsigned ln) /*@modifies h @*/; @@ -1205,7 +1205,7 @@ rpmRC rpmInstallSourcePackage(rpmTransactionSet ts, goto exit; } - fi->multiLib = alGetMultiLib(ts->addedPackages, 0); + fi->multiLib = 0; /* MULTILIB for src.rpm's? */ /*@-kepttrans@*/ fi->key = alGetKey(ts->addedPackages, 0); /*@=kepttrans@*/ diff --git a/lib/rpmal.c b/lib/rpmal.c index 41cbbb9b0..5ae89852e 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -125,11 +125,13 @@ const void * alGetKey(const availableList al, int pkgNum) /*@=retexpose@*/ } +#ifdef DYING int alGetMultiLib(const availableList al, int pkgNum) { availablePackage alp = alGetPkg(al, pkgNum); return (alp != NULL ? alp->multiLib : 0); } +#endif int alGetFilesCount(const availableList al, int pkgNum) { @@ -421,7 +423,7 @@ fprintf(stderr, "*** del %p[%d] %s-%s-%s\n", al->list, pkgNum, p->name, p->versi /*@=nullstate@*/ } -availablePackage +long alAddPackage(availableList al, int pkgNum, Header h, /*@null@*/ /*@dependent@*/ const void * key, /*@null@*/ FD_t fd, /*@null@*/ rpmRelocation * relocs) @@ -432,8 +434,10 @@ alAddPackage(availableList al, int pkgNum, rpmTagType dnt, bnt; availablePackage p; int i, xx; +#ifdef DYING uint_32 multiLibMask = 0; uint_32 * pp = NULL; +#endif if (pkgNum >= 0 && pkgNum < al->size) { alDelPackage(al, pkgNum); @@ -447,8 +451,10 @@ alAddPackage(availableList al, int pkgNum, p = al->list + pkgNum; - p->h = headerLink(h, "alAddPackage"); /* XXX reference held by transaction set */ + p->h = headerLink(h, "alAddPackage"); +#ifdef DYING p->multiLib = 0; /* MULTILIB */ +#endif xx = headerNVR(p->h, &p->name, &p->version, &p->release); @@ -457,6 +463,8 @@ if (_al_debug) fprintf(stderr, "*** add %p[%d] %s-%s-%s\n", al->list, pkgNum, p->name, p->version, p->release); /*@=modfilesys@*/ +#ifdef DYING + { uint_32 *pp = NULL; /* XXX This should be added always so that packages look alike. * XXX However, there is logic in files.c/depends.c that checks for * XXX existence (rather than value) that will need to change as well. @@ -474,6 +482,8 @@ fprintf(stderr, "*** add %p[%d] %s-%s-%s\n", al->list, pkgNum, p->name, p->versi p->multiLib = multiLibMask; } } + } +#endif if (!hge(h, RPMTAG_EPOCH, NULL, (void **) &p->epoch, NULL)) p->epoch = NULL; @@ -614,7 +624,8 @@ fprintf(stderr, "*** add %p[%d] %s-%s-%s\n", al->list, pkgNum, p->name, p->versi alFreeIndex(al); - return p; +assert((p - al->list) == pkgNum); + return (p - al->list); } /** @@ -654,12 +665,14 @@ void alMakeIndex(availableList al) for (i = 0; i < al->size; i++) { for (j = 0; j < al->list[i].provides.Count; j++) { +#ifdef NOTNOW /* XXX FIXME: multilib colored dependency search */ /* If multilib install, skip non-multilib provides. */ if (al->list[i].multiLib && !isDependsMULTILIB(al->list[i].provides.Flags[j])) { ai->size--; /*@innercontinue@*/ continue; } +#endif ai->index[k].package = al->list + i; /*@-assignexpose@*/ @@ -725,6 +738,7 @@ alAllFileSatisfiesDepend(const availableList al, strcmp(dirMatch->files[i].baseName, baseName)) /*@innercontinue@*/ continue; +#ifdef NOTNOW /* XXX FIXME: multilib colored dependency search */ /* * If a file dependency would be satisfied by a file * we are not going to install, skip it. @@ -732,6 +746,7 @@ alAllFileSatisfiesDepend(const availableList al, if (al->list[dirMatch->files[i].pkgNum].multiLib && !isFileMULTILIB(dirMatch->files[i].fileFlags)) /*@innercontinue@*/ continue; +#endif if (keyType) rpmMessage(RPMMESS_DEBUG, _("%s: %-45s YES (added files)\n"), diff --git a/lib/rpmal.h b/lib/rpmal.h index 787c68f9d..c56267b52 100644 --- a/lib/rpmal.h +++ b/lib/rpmal.h @@ -19,7 +19,9 @@ struct availablePackage_s { /*@owned@*//*@null@*/ const char ** baseNames; /*!< Header file basenames. */ /*@dependent@*//*@null@*/ int_32 * epoch; /*!< Header epoch (if any). */ int filesCount; /*!< No. of files in header. */ +#ifdef DYING uint_32 multiLib; /* MULTILIB */ +#endif /*@kept@*//*@null@*/ const void * key; /*!< Private data associated with a package (e.g. file name of package). */ /*@null@*/ rpmRelocation * relocs; /*@null@*/ FD_t fd; @@ -47,6 +49,7 @@ int alGetSize(const availableList al) const void * alGetKey(/*@null@*/ const availableList al, int pkgNum) /*@*/; +#ifdef DYING /** * Return available package multiLib flag. * @param al available list @@ -55,6 +58,7 @@ const void * alGetKey(/*@null@*/ const availableList al, int pkgNum) */ int alGetMultiLib(/*@null@*/ const availableList al, int pkgNum) /*@*/; +#endif /** * Return available package files count. @@ -121,9 +125,11 @@ FD_t alGetFd(/*@null@*/ availableList al, int pkgNum) * @param pkgNum available package index * @return available package pointer */ +/*@-exportlocal@*/ /*@dependent@*/ /*@null@*/ availablePackage alGetPkg(/*@null@*/ availableList al, int pkgNum) /*@*/; +/*@=exportlocal@*/ /** * Return available package index. @@ -193,10 +199,9 @@ void alDelPackage(availableList al, int pkgNum) * @param key package private data * @param fd package file handle * @param relocs package file relocations - * @return available package pointer + * @return available package index */ -/*@exposed@*/ -availablePackage alAddPackage(availableList al, int pkgNum, +long alAddPackage(availableList al, int pkgNum, Header h, /*@null@*/ /*@dependent@*/ const void * key, /*@null@*/ FD_t fd, /*@null@*/ rpmRelocation * relocs) /*@modifies al, h @*/; diff --git a/lib/transaction.c b/lib/transaction.c index 4619d0587..8dcf757e0 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1118,8 +1118,10 @@ int keep_header = 1; /* XXX rpmProblemSetAppend prevents dumping headers. */ /* XXX multilib should not display "already installed" problems */ if (!(ts->ignoreSet & RPMPROB_FILTER_REPLACEPKG) - && !alGetMultiLib(ts->addedPackages, i)) - { +#ifdef DYING /* XXX MULTILIB multiLib from transactionElement */ + && !alGetMultiLib(ts->addedPackages, i) +#endif + ) { mi = rpmtsInitIterator(ts, RPMTAG_NAME, n, 0); xx = rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, v); xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, r); @@ -1181,7 +1183,11 @@ int keep_header = 1; /* XXX rpmProblemSetAppend prevents dumping headers. */ i = ts->order[oc].u.addedIndex; fi->h = alGetHeader(ts->addedPackages, i, 1); +#ifdef DYING /* XXX MULTILIB multiLib from transactionElement */ fi->multiLib = alGetMultiLib(ts->addedPackages, i); +#else + fi->multiLib = ts->order[oc].multiLib; +#endif /*@-kepttrans@*/ fi->key = alGetKey(ts->addedPackages, i); /*@=kepttrans@*/ |