RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Per Øyvind Karlsen Root: /v/rpm/cvs Email: pkarl...@rpm5.org Module: rpm Date: 19-Oct-2011 14:59:19 Branch: rpm-5_4 Handle: 2011101912591801 Modified files: (Branch: rpm-5_4) rpm CHANGES rpm/lib transaction.c Log: fix different epoch being ignored when comparing two packages with same NVRA. Summary: Revision Changes Path 1.3501.2.184+2 -0 rpm/CHANGES 1.429.2.5 +22 -16 rpm/lib/transaction.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3501.2.183 -r1.3501.2.184 CHANGES --- rpm/CHANGES 15 Oct 2011 12:56:56 -0000 1.3501.2.183 +++ rpm/CHANGES 19 Oct 2011 12:59:18 -0000 1.3501.2.184 @@ -1,4 +1,6 @@ 5.4.3 -> 5.4.4: + - proyvind: fix different epoch being ignored when comparing two packages + with same NVRA. - proyvind: add %ruby_sitedir and %ruby_vendor macros. - devzero2000: get rid of bashisms in dbconvert.sh and gstreamer.sh - jbj: start rpm-5.4.4 development. @@ . patch -p0 <<'@@ .' Index: rpm/lib/transaction.c ============================================================================ $ cvs diff -u -r1.429.2.4 -r1.429.2.5 transaction.c --- rpm/lib/transaction.c 12 Jul 2011 10:42:59 -0000 1.429.2.4 +++ rpm/lib/transaction.c 19 Oct 2011 12:59:19 -0000 1.429.2.5 @@ -1131,28 +1131,34 @@ RPMMIRE_STRCMP, rpmteNEVRA(p), &keys); nkeys = argvCount(keys); -#if defined(RPM_VENDOR_MANDRIVA) /* mdvbz: #63711 - * workaround for distepoch never being added to RPMTAG_NVRA yet, - * leading to packages of same EVRA but with different distepoch + * workaround for epoch & distepoch not being part of RPMTAG_NVRA, + * leading to packages of same VRA but with different epoch or distepoch * being treated as the same package */ if (nkeys > 0) { - int i; - for (i = 0; i < nkeys; i++) { - rpmmi mi = rpmtsInitIterator(ts, RPMTAG_NVRA, keys[i], 0); - Header h; - while ((h = rpmmiNext(mi)) != NULL) { - HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); - he->tag = RPMTAG_DISTEPOCH; - xx = headerGet(h, he, 0); - if (strcmp(he->p.str ? he->p.str : "", rpmteD(p) ? rpmteD(p) : "")) - nkeys--; - he->p.ptr = _free(he->p.ptr); + int i, t; + rpmTag tags[2] = { RPMTAG_EPOCH, RPMTAG_DISTEPOCH }; + for (t = 0; t < 2; t++) { + for (i = 0; i < nkeys; i++) { + rpmmi mi = rpmtsInitIterator(ts, RPMTAG_NVRA, keys[i], 0); + Header h; + while ((h = rpmmiNext(mi)) != NULL) { + HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); + const char *val = NULL; + he->tag = tags[t]; + xx = headerGet(h, he, 0); + if (he->tag == RPMTAG_EPOCH) + val = rpmteE(p); + else if (he->tag == RPMTAG_DISTEPOCH) + val = rpmteD(p); + if (strcmp(he->p.str ? he->p.str : "", val ? val : "")) + nkeys--; + he->p.ptr = _free(he->p.ptr); + } + mi = rpmmiFree(mi); } - mi = rpmmiFree(mi); } } -#endif if (nkeys > 0) rpmpsAppend(ps, RPMPROB_PKG_INSTALLED, rpmteNEVR(p), rpmteKey(p), @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org