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:39:52
  Branch: HEAD                             Handle: 2011071210395200

  Modified files:
    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.3661      +2  -0      rpm/CHANGES
    1.433       +23 -0      rpm/lib/transaction.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3660 -r1.3661 CHANGES
  --- rpm/CHANGES       6 Jul 2011 12:55:29 -0000       1.3660
  +++ rpm/CHANGES       12 Jul 2011 10:39:52 -0000      1.3661
  @@ -1,4 +1,6 @@
   HEAD:
  +    - 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.
       - proyvind: check-multiarch-files: remove unnecessary import of 
MDK::Common,
        causing undesired dependency from perl dependency generator.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/transaction.c
  ============================================================================
  $ cvs diff -u -r1.432 -r1.433 transaction.c
  --- rpm/lib/transaction.c     1 Feb 2011 13:53:33 -0000       1.432
  +++ rpm/lib/transaction.c     12 Jul 2011 10:39:52 -0000      1.433
  @@ -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