[yum-cvs] rpmUtils/updates.py

Jeremy Katz katzj at linux.duke.edu
Wed Oct 10 15:43:26 UTC 2007


 rpmUtils/updates.py |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 5badc2b67b9885d2993b6f77423bc632b8595b01
Author: Jeremy Katz <katzj at redhat.com>
Date:   Wed Oct 10 11:12:24 2007 -0400

    when an obsolete is available for a package, only install most matching arch
    rather than all available arches (rh#301661)

diff --git a/rpmUtils/updates.py b/rpmUtils/updates.py
index 5a98fde..116a1d4 100644
--- a/rpmUtils/updates.py
+++ b/rpmUtils/updates.py
@@ -199,6 +199,12 @@ class Updates:
         # look through all the obsoleting packages look for multiple archs per name
         # if you find it look for the packages they obsolete
         # 
+        obs_arches = {}
+        for (n, a, e, v, r) in self.rawobsoletes.keys():
+            if not obs_arches.has_key(n):
+                obs_arches[n] = []
+            obs_arches[n].append(a)
+
         for pkgtup in self.rawobsoletes.keys():
             (name, arch, epoch, ver, rel) = pkgtup
             for (obs_n, flag, (obs_e, obs_v, obs_r)) in self.rawobsoletes[(pkgtup)]:
@@ -214,6 +220,8 @@ class Updates:
                                     if self.returnNewest((pkgver, installedver)) == installedver:
                                         willInstall = 0
                                         break
+                            if rpm_a != arch and rpm_a in obs_arches[n]:
+                                willInstall = 0
                             if willInstall:
                                 if not obsdict.has_key(pkgtup):
                                     obsdict[pkgtup] = []



More information about the Yum-cvs-commits mailing list