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: 12-Jul-2011 12:44:42 Branch: rpm-5_3 Handle: 2011071210444100 Modified files: (Branch: rpm-5_3) rpm CHANGES rpm/lib transaction.c Log: fix rpm treating packages of same NVRA, but different distepoch as equal, preventing upgrades between them. Summary: Revision Changes Path 1.3296.2.243+2 -0 rpm/CHANGES 1.428.2.7 +23 -0 rpm/lib/transaction.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3296.2.242 -r1.3296.2.243 CHANGES --- rpm/CHANGES 6 Jul 2011 12:58:03 -0000 1.3296.2.242 +++ rpm/CHANGES 12 Jul 2011 10:44:41 -0000 1.3296.2.243 @@ -1,4 +1,6 @@ 5.3.12 -> 5.3.13 + - proyvind: fix rpm treating packages of same NVRA, but different distepoch + as equal, preventing upgrades between them. - proyvind: dbconvert: fix segfault when no root is specified. - devzero2000: merge afb patch portability of endian - proyvind: check-multiarch-files: remove unnecessary import of MDK::Common, @@ . patch -p0 <<'@@ .' Index: rpm/lib/transaction.c ============================================================================ $ cvs diff -u -r1.428.2.6 -r1.428.2.7 transaction.c --- rpm/lib/transaction.c 24 Mar 2011 16:48:03 -0000 1.428.2.6 +++ rpm/lib/transaction.c 12 Jul 2011 10:44:41 -0000 1.428.2.7 @@ -1168,6 +1168,29 @@ xx = rpmdbMireApply(rpmtsGetRdb(ts), RPMTAG_NVRA, 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 + * 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); + } + 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