[Yum-devel] [PATCH] Update from noarch pkg to arch pkg and vice versa. BZ 709225

Zdeněk Pavlas zpavlas at redhat.com
Wed Sep 21 08:26:09 UTC 2011


---
 yum/__init__.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 5fb7c00..756472b 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4271,7 +4271,16 @@ class YumBase(depsolve.Depsolve):
                     
             # check to see if the pkg we want to install is not _quite_ the newest
             # one but still technically an update over what is installed.
-            pot_updated = self.rpmdb.searchNevra(name=available_pkg.name, arch=available_pkg.arch)
+            pot_updated = []
+            for p in self.rpmdb.searchNevra(name=available_pkg.name):
+                if (
+                    p.arch == available_pkg.arch # exact arch match
+                    or self.conf.obsoletes and (
+                        p.arch == 'noarch' # from noarch
+                        or available_pkg.arch == 'noarch' # to noarch
+                    )
+                ):
+                    pot_updated.append(p)
             if pot_updated and self.allowedMultipleInstalls(available_pkg):
                 # only compare against the newest of what's installed for kernel
                 pot_updated = sorted(pot_updated)[-1:]
-- 
1.7.4.4



More information about the Yum-devel mailing list