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:42:59
  Branch: rpm-5_4                          Handle: 2011071210425801

  Modified files:           (Branch: rpm-5_4)
    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.3501.2.146+2  -0      rpm/CHANGES
    1.429.2.4   +23 -0      rpm/lib/transaction.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3501.2.145 -r1.3501.2.146 CHANGES
  --- rpm/CHANGES       6 Jul 2011 12:56:51 -0000       1.3501.2.145
  +++ rpm/CHANGES       12 Jul 2011 10:42:58 -0000      1.3501.2.146
  @@ -1,4 +1,6 @@
   5.4.1 -> 5.4.2
  +    - 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.429.2.3 -r1.429.2.4 transaction.c
  --- rpm/lib/transaction.c     1 Feb 2011 13:53:49 -0000       1.429.2.3
  +++ rpm/lib/transaction.c     12 Jul 2011 10:42:59 -0000      1.429.2.4
  @@ -1130,6 +1130,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

Reply via email to