From: jbj Date: Tue, 31 Dec 2002 02:12:02 +0000 (+0000) Subject: Dump multilib code, colored depndencies instead. X-Git-Tag: rpm-4.4-release~748 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86f5190567b804dc82398802ca10a55322288df9;p=platform%2Fupstream%2Frpm.git Dump multilib code, colored depndencies instead. CVS patchset: 5990 CVS date: 2002/12/31 02:12:02 --- diff --git a/build/reqprov.c b/build/reqprov.c index 9171462..4c7249b 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -55,7 +55,7 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, extra = depFlags & _ALL_REQUIRES_MASK; } - depFlags = (depFlags & (RPMSENSE_SENSEMASK | RPMSENSE_MULTILIB)) | extra; + depFlags = (depFlags & RPMSENSE_SENSEMASK) | extra; /*@-branchstate@*/ if (depEVR == NULL) @@ -83,8 +83,7 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, if (strcmp(names[len], depName)) continue; if (flagtag && versions != NULL && - (strcmp(versions[len], depEVR) || - ((flags[len] | RPMSENSE_MULTILIB) != (depFlags | RPMSENSE_MULTILIB)))) + (strcmp(versions[len], depEVR) || flags[len] != depFlags)) continue; if (indextag && indexes != NULL && indexes[len] != index) continue; @@ -92,10 +91,6 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, /* This is a duplicate dependency. */ duplicate = 1; - if (flagtag && isDependsMULTILIB(depFlags) && - !isDependsMULTILIB(flags[len])) - flags[len] |= RPMSENSE_MULTILIB; - break; } /*@=boundsread@*/ diff --git a/build/rpmfc.c b/build/rpmfc.c index 2e18c36..9f37b0e 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -1343,8 +1343,6 @@ static int rpmfcGenerateDependsHelper(const Spec spec, Package pkg, rpmfi fi) } /* Parse dependencies into header */ - tagflags &= ~RPMSENSE_MULTILIB; - rc = parseRCPOT(spec, pkg, getStringBuf(sb_stdout), tag, 0, tagflags); sb_stdout = freeStringBuf(sb_stdout); diff --git a/lib/cpio.h b/lib/cpio.h index 7cbb61b..b6ef297 100644 --- a/lib/cpio.h +++ b/lib/cpio.h @@ -61,8 +61,7 @@ typedef enum cpioMapFlags_e { CPIO_MAP_ABSOLUTE = (1 << 5), CPIO_MAP_ADDDOT = (1 << 6), CPIO_ALL_HARDLINKS = (1 << 7), /*!< fail if hardlinks are missing. */ - CPIO_MAP_TYPE = (1 << 8), /*!< only for building. */ - CPIO_MULTILIB = (1 << 31) /*!< internal, only for building. */ + CPIO_MAP_TYPE = (1 << 8) /*!< only for building. */ } cpioMapFlags; #define CPIO_NEWC_MAGIC "070701" diff --git a/lib/depends.c b/lib/depends.c index 56fd404..8ce4cde 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -1574,8 +1574,10 @@ int rpmtsCheck(rpmts ts) while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) { rpmds provides; +/*@-nullpass@*/ /* FIX: rpmts{A,O} can return null. */ rpmMessage(RPMMESS_DEBUG, "========== +++ %s %s/%s 0x%x\n", rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); +/*@=nullpass@*/ rc = checkPackageDeps(ts, rpmteNEVR(p), rpmteDS(p, RPMTAG_REQUIRENAME), rpmteDS(p, RPMTAG_CONFLICTNAME), @@ -1622,8 +1624,10 @@ int rpmtsCheck(rpmts ts) rpmds provides; rpmfi fi; +/*@-nullpass@*/ /* FIX: rpmts{A,O} can return null. */ rpmMessage(RPMMESS_DEBUG, "========== --- %s %s/%s 0x%x\n", rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); +/*@=nullpass@*/ #if defined(DYING) || defined(__LCLINT__) /* XXX all packages now have Provides: name = version-release */ diff --git a/lib/psm.c b/lib/psm.c index 4d8bde9..1040259 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -154,199 +154,6 @@ static int rpmInstallLoadMacros(rpmfi fi, Header h) return 0; } -#ifdef DYING -/** - * Copy file data from h to newH. - * @param fi transaction element file info - * @param h header from - * @param newH header to - * @return 0 on success - */ -/*@-boundswrite@*/ -static rpmRC mergeFiles(rpmfi fi, Header h, Header newH) - /*@modifies h @*/ -{ - HGE_t hge = (HGE_t)fi->hge; - HME_t hme = (HME_t)fi->hme; - HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); - fileAction * actions = fi->actions; - int i, j, k, fc, xx; - rpmTagType type = 0; - int_32 count = 0; - int_32 dirNamesCount, dirCount; - void * data, * newdata; - int_32 * dirIndexes, * newDirIndexes; - uint_32 * fileSizes, fileSize; - const char ** dirNames; - const char ** newDirNames; - static rpmTag mergeTags[] = { - RPMTAG_FILESIZES, - RPMTAG_FILESTATES, - RPMTAG_FILEMODES, - RPMTAG_FILERDEVS, - RPMTAG_FILEMTIMES, - RPMTAG_FILEMD5S, - RPMTAG_FILELINKTOS, - RPMTAG_FILEFLAGS, - RPMTAG_FILEUSERNAME, - RPMTAG_FILEGROUPNAME, - RPMTAG_FILEVERIFYFLAGS, - RPMTAG_FILEDEVICES, - RPMTAG_FILEINODES, - RPMTAG_FILELANGS, - RPMTAG_BASENAMES, - 0, - }; - static rpmTag requireTags[] = { - RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_REQUIREFLAGS, - RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_PROVIDEFLAGS, - RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_CONFLICTFLAGS - }; - - xx = hge(h, RPMTAG_SIZE, NULL, (void **) &fileSizes, NULL); - fileSize = *fileSizes; - xx = hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count); - for (i = 0, fc = 0; i < count; i++) - if (actions[i] != FA_SKIPCOLOR) { - fc++; - fileSize += fileSizes[i]; - } - xx = hme(h, RPMTAG_SIZE, RPM_INT32_TYPE, &fileSize, 1); - - /*@-sizeoftype@*/ - for (i = 0; mergeTags[i]; i++) { - if (!hge(newH, mergeTags[i], &type, (void **) &data, &count)) - continue; - switch (type) { - case RPM_CHAR_TYPE: - case RPM_INT8_TYPE: - newdata = xcalloc(fc, sizeof(int_8)); - for (j = 0, k = 0; j < count; j++) - if (actions[j] != FA_SKIPCOLOR) - ((int_8 *) newdata)[k++] = ((int_8 *) data)[j]; - xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); - free (newdata); - /*@switchbreak@*/ break; - case RPM_INT16_TYPE: - newdata = xcalloc(fc, sizeof(int_16)); - for (j = 0, k = 0; j < count; j++) - if (actions[j] != FA_SKIPCOLOR) - ((int_16 *) newdata)[k++] = ((int_16 *) data)[j]; - xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); - free (newdata); - /*@switchbreak@*/ break; - case RPM_INT32_TYPE: - newdata = xcalloc(fc, sizeof(int_32)); - for (j = 0, k = 0; j < count; j++) - if (actions[j] != FA_SKIPCOLOR) - ((int_32 *) newdata)[k++] = ((int_32 *) data)[j]; - xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); - free (newdata); - /*@switchbreak@*/ break; - case RPM_STRING_ARRAY_TYPE: - newdata = xcalloc(fc, sizeof(char *)); - for (j = 0, k = 0; j < count; j++) - if (actions[j] != FA_SKIPCOLOR) - ((char **) newdata)[k++] = ((char **) data)[j]; - xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); - free (newdata); - /*@switchbreak@*/ break; - default: - rpmError(RPMERR_DATATYPE, _("Data type %d not supported\n"), - (int) type); - return RPMRC_FAIL; - /*@notreached@*/ /*@switchbreak@*/ break; - } - data = hfd(data, type); - } - /*@=sizeoftype@*/ - xx = hge(newH, RPMTAG_DIRINDEXES, NULL, (void **) &newDirIndexes, &count); - xx = hge(newH, RPMTAG_DIRNAMES, NULL, (void **) &newDirNames, NULL); - xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &data, &dirNamesCount); - - dirNames = xcalloc(dirNamesCount + fc, sizeof(*dirNames)); - for (i = 0; i < dirNamesCount; i++) - dirNames[i] = ((char **) data)[i]; - dirCount = dirNamesCount; - newdata = xcalloc(fc, sizeof(*newDirIndexes)); - for (i = 0, k = 0; i < count; i++) { - if (actions[i] == FA_SKIPCOLOR) - continue; - for (j = 0; j < dirCount; j++) - if (!strcmp(dirNames[j], newDirNames[newDirIndexes[i]])) - /*@innerbreak@*/ break; - if (j == dirCount) - dirNames[dirCount++] = newDirNames[newDirIndexes[i]]; - ((int_32 *) newdata)[k++] = j; - } - xx = headerAddOrAppendEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, newdata, fc); - if (dirCount > dirNamesCount) - xx = headerAddOrAppendEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, - dirNames + dirNamesCount, - dirCount - dirNamesCount); - data = hfd(data, -1); - newDirNames = hfd(newDirNames, -1); - free (newdata); - free (dirNames); - - for (i = 0; i < 9; i += 3) { - const char **Names, **EVR, **newNames, **newEVR; - rpmTagType nnt, nvt, rnt; - uint_32 *Flags, *newFlags; - int Count = 0, newCount = 0; - - if (!hge(newH, requireTags[i], &nnt, (void **) &newNames, &newCount)) - continue; - - xx = hge(newH, requireTags[i+1], &nvt, (void **) &newEVR, NULL); - xx = hge(newH, requireTags[i+2], NULL, (void **) &newFlags, NULL); - if (hge(h, requireTags[i], &rnt, (void **) &Names, &Count)) - { - xx = hge(h, requireTags[i+1], NULL, (void **) &EVR, NULL); - xx = hge(h, requireTags[i+2], NULL, (void **) &Flags, NULL); - for (j = 0; j < newCount; j++) - for (k = 0; k < Count; k++) - if (!strcmp (newNames[j], Names[k]) - && !strcmp (newEVR[j], EVR[k]) - && (newFlags[j] & RPMSENSE_SENSEMASK) == - (Flags[k] & RPMSENSE_SENSEMASK)) - { - newNames[j] = NULL; - /*@innerbreak@*/ break; - } - } - for (j = 0, k = 0; j < newCount; j++) { -#ifdef DYING - if (!newNames[j] || !isDependsMULTILIB(newFlags[j])) -#else - if (!newNames[j]) -#endif - /*@innercontinue@*/ continue; - if (j != k) { - newNames[k] = newNames[j]; - newEVR[k] = newEVR[j]; - newFlags[k] = newFlags[j]; - } - k++; - } - if (k) { - xx = headerAddOrAppendEntry(h, requireTags[i], - RPM_STRING_ARRAY_TYPE, newNames, k); - xx = headerAddOrAppendEntry(h, requireTags[i+1], - RPM_STRING_ARRAY_TYPE, newEVR, k); - xx = headerAddOrAppendEntry(h, requireTags[i+2], RPM_INT32_TYPE, - newFlags, k); - } - newNames = hfd(newNames, nnt); - newEVR = hfd(newEVR, nvt); - Names = hfd(Names, rnt); - } - return RPMRC_OK; -} -/*@=boundswrite@*/ -#endif - /** * Mark files in database shared with this package as "replaced". * @param psm package state machine data @@ -1644,11 +1451,6 @@ assert(psm->mi == NULL); while ((psm->oh = rpmdbNextIterator(psm->mi))) { fi->record = rpmdbGetIteratorOffset(psm->mi); -#ifdef DYING - if (rpmtsFlags(ts) & RPMTRANS_FLAG_MULTILIB) - psm->oh = headerCopy(psm->oh); - else -#endif psm->oh = NULL; /*@loopbreak@*/ break; } @@ -2056,25 +1858,6 @@ psm->te->h = headerLink(fi->h); xx = headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, &installTime, 1); -#ifdef DYING - if (rpmtsFlags(ts) & RPMTRANS_FLAG_MULTILIB) { - uint_32 multiLib, * newMultiLib, * p; - - if (hge(fi->h, RPMTAG_MULTILIBMASK, NULL, - (void **) &newMultiLib, NULL) && - hge(psm->oh, RPMTAG_MULTILIBMASK, NULL, - (void **) &p, NULL)) - { - multiLib = *p; - multiLib |= *newMultiLib; - xx = hme(psm->oh, RPMTAG_MULTILIBMASK, RPM_INT32_TYPE, - &multiLib, 1); - } - rc = mergeFiles(fi, psm->oh, fi->h); - if (rc) break; - } -#endif - /* * If this package has already been installed, remove it from * the database before adding the new one. diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 77db41d..f14e9be 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -725,21 +725,6 @@ assert(p != NULL); fileTypes ft; int fnlen; -#ifdef DYING - /* - * If only adding libraries of different arch into an already - * installed package, skip all other files. - */ - if (rpmteColor(p) && !isFileMULTILIB((fFlags[i]))) { - if (actions) { - actions[i] = FA_SKIPMULTILIB; - rpmMessage(RPMMESS_DEBUG, _("excluding multilib path %s%s\n"), - dirNames[dirIndexes[i]], baseNames[i]); - } - continue; - } -#endif - len = reldel + strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1; /*@-branchstate@*/ diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 31c61d3..b2b7883 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -365,7 +365,9 @@ typedef enum rpmTag_e { RPMTAG_PAYLOADFORMAT = 1124, RPMTAG_PAYLOADCOMPRESSOR = 1125, RPMTAG_PAYLOADFLAGS = 1126, - RPMTAG_MULTILIBMASK = 1127, +/*@-enummemuse@*/ + RPMTAG_MULTILIBMASK = 1127, /*!< internal - obsolete */ +/*@=enummemuse@*/ RPMTAG_INSTALLTID = 1128, RPMTAG_REMOVETID = 1129, /*@-enummemuse@*/ @@ -426,15 +428,9 @@ typedef enum rpmfileAttrs_e { RPMFILE_UNPATCHED = (1 << 10), /*!< placeholder (SuSE) */ RPMFILE_PUBKEY = (1 << 11), /*!< from %%pubkey */ } rpmfileAttrs; -#define RPMFILE_MULTILIB_SHIFT 12 -#define RPMFILE_MULTILIB(N) ((N) << RPMFILE_MULTILIB_SHIFT) -#define RPMFILE_MULTILIB_MASK RPMFILE_MULTILIB(7) #define RPMFILE_ALL ~(RPMFILE_NONE) -/* XXX Check file flags for multilib marker. */ -#define isFileMULTILIB(_fflags) ((_fflags) & RPMFILE_MULTILIB_MASK) - /** * Dependency Attributes. */ @@ -462,7 +458,7 @@ typedef enum rpmsenseFlags_e { RPMSENSE_TRIGGERIN = (1 << 16), /*!< %triggerin dependency. */ RPMSENSE_TRIGGERUN = (1 << 17), /*!< %triggerun dependency. */ RPMSENSE_TRIGGERPOSTUN = (1 << 18), /*!< %triggerpostun dependency. */ - RPMSENSE_MULTILIB = (1 << 19), + /* (1 << 19) unused. */ RPMSENSE_SCRIPT_PREP = (1 << 20), /*!< %prep build dependency. */ RPMSENSE_SCRIPT_BUILD = (1 << 21), /*!< %build build dependency. */ RPMSENSE_SCRIPT_INSTALL = (1 << 22),/*!< %install build dependency. */ @@ -482,8 +478,6 @@ typedef enum rpmsenseFlags_e { #define RPMSENSE_TRIGGER \ (RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN) -#define isDependsMULTILIB(_dflags) ((_dflags) & RPMSENSE_MULTILIB) - #define _ALL_REQUIRES_MASK (\ RPMSENSE_INTERP | \ RPMSENSE_SCRIPT_PRE | \ @@ -915,7 +909,7 @@ typedef enum rpmtransFlags_e { /*@-enummemuse@*/ RPMTRANS_FLAG_KEEPOBSOLETE = (1 << 7), /*!< @todo Document. */ /*@=enummemuse@*/ - RPMTRANS_FLAG_MULTILIB = (1 << 8), /*!< @todo Document. */ + /* (1 << 8) unused. */ RPMTRANS_FLAG_DIRSTASH = (1 << 9), /*!< from --dirstash */ RPMTRANS_FLAG_REPACKAGE = (1 << 10), /*!< from --repackage */ diff --git a/lib/rpmte.h b/lib/rpmte.h index d263b22..edb1c23 100644 --- a/lib/rpmte.h +++ b/lib/rpmte.h @@ -444,12 +444,14 @@ rpmfi rpmteFI(rpmte te, rpmTag tag) /*@*/; /** - * Calculate transaction lemnt dependency colors/refs from file info. + * Calculate transaction element dependency colors/refs from file info. * @param te transaction element * @param tag dependency tag (RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME) */ +/*@-exportlocal@*/ void rpmteColorDS(rpmte te, rpmTag tag) /*@modifies te @*/; +/*@=exportlocal@*/ /** * Return transaction element index. diff --git a/lib/rpmts.h b/lib/rpmts.h index fbb7476..dc04f2e 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -818,7 +818,8 @@ int rpmtsSetNotifyCallback(rpmts ts, */ /*@newref@*/ rpmts rpmtsCreate(void) - /*@*/; + /*@globals rpmGlobalMacroContext @*/ + /*@modifies rpmGlobalMacroContext @*/; /** \ingroup rpmts * Add package to be installed to transaction set. diff --git a/lib/transaction.c b/lib/transaction.c index 91e93bb..e42dfdc 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1003,7 +1003,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) (void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | _noTransTriggers)); /* XXX MULTILIB is broken, as packages can and do execute /sbin/ldconfig. */ - if (rpmtsFlags(ts) & (RPMTRANS_FLAG_JUSTDB | RPMTRANS_FLAG_MULTILIB)) + if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) (void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | _noTransScripts | _noTransTriggers)); ts->probs = rpmpsFree(ts->probs); @@ -1510,13 +1510,6 @@ rpmMessage(RPMMESS_DEBUG, _("computing file dispositions\n")); } psm->fi = rpmfiLink(p->fi, NULL); -#ifdef DYING - if (rpmteColor(p)) - (void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_MULTILIB)); - else -#endif - (void) rpmtsSetFlags(ts, (rpmtsFlags(ts) & ~RPMTRANS_FLAG_MULTILIB)); - /*@-nullstate@*/ /* FIX: psm->fi may be NULL */ if (rpmpsmStage(psm, PSM_PKGINSTALL)) { ourrc++; diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 251775a..d1de979 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -459,6 +459,7 @@ void initrpm(void) REGISTER_ENUM(RPMFILE_STATE_REPLACED); REGISTER_ENUM(RPMFILE_STATE_NOTINSTALLED); REGISTER_ENUM(RPMFILE_STATE_NETSHARED); + REGISTER_ENUM(RPMFILE_STATE_WRONGCOLOR); REGISTER_ENUM(RPMFILE_CONFIG); REGISTER_ENUM(RPMFILE_DOC); @@ -491,7 +492,6 @@ void initrpm(void) REGISTER_ENUM(RPMSENSE_TRIGGERIN); REGISTER_ENUM(RPMSENSE_TRIGGERUN); REGISTER_ENUM(RPMSENSE_TRIGGERPOSTUN); - REGISTER_ENUM(RPMSENSE_MULTILIB); REGISTER_ENUM(RPMSENSE_SCRIPT_PREP); REGISTER_ENUM(RPMSENSE_SCRIPT_BUILD); REGISTER_ENUM(RPMSENSE_SCRIPT_INSTALL); @@ -510,7 +510,6 @@ void initrpm(void) REGISTER_ENUM(RPMTRANS_FLAG_NODOCS); REGISTER_ENUM(RPMTRANS_FLAG_ALLFILES); REGISTER_ENUM(RPMTRANS_FLAG_KEEPOBSOLETE); - REGISTER_ENUM(RPMTRANS_FLAG_MULTILIB); REGISTER_ENUM(RPMTRANS_FLAG_REPACKAGE); REGISTER_ENUM(RPMTRANS_FLAG_REVERSE); REGISTER_ENUM(RPMTRANS_FLAG_NOPRE); diff --git a/python/rpmte-py.c b/python/rpmte-py.c index 2b90021..02787e2 100644 --- a/python/rpmte-py.c +++ b/python/rpmte-py.c @@ -41,7 +41,7 @@ * - te.A() Return package architecture. * - te.O() Return package operating system. * - te.NEVR() Return package name-version-release. - * - te.Mutilib() Return package multilib attribute. + * - te.Color() Return package color bits. * - te.Depth() Return the level in the dependency tree (after ordering). * - te.Npreds() Return the number of package prerequisites (after ordering). * - te.Degree() Return the parent's degree + 1.