[PATCH rhel6-branch master] Add the best package for this arch to the optional package selector (#591653).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Before, we were just having ayum.searchNevra return a list of packages and grab
whatever happened to be first on that list.  Sometimes it ends up being the
x86-64 package, and sometimes it ends up being the i686 one instead.  To be
more deterministic, we should return the best package for the architecture
we're running on always.
---
 iw/GroupSelector.py |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/iw/GroupSelector.py b/iw/GroupSelector.py
index 4d64e59..29bc2ab 100644
--- a/iw/GroupSelector.py
+++ b/iw/GroupSelector.py
@@ -206,10 +206,19 @@ class OptionalPackageSelector:
             
 
     def __getPackageObject(self, pkgname):
-        pos = self.ayum.pkgSack.searchNevra(name=pkgname)
-        if len(pos) > 0:
-            return pos[0]
-        return None
+        try:
+            pkgs = self.ayum.pkgSack.returnNewestByName(pkgname)
+        except:
+            return None
+
+        if not pkgs:
+            return None
+
+        pkgs = self.ayum.bestPackagesFromList(pkgs)
+        if not pkgs:
+            return None
+
+        return pkgs[0]
 
     def _populate(self):
         pkgs = self.group.default_packages.keys() + \
-- 
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux