[Yum-devel] fix for broken patterns

Chris Lumens clumens at redhat.com
Thu Aug 17 19:14:34 UTC 2006


Somewhere along the way, one of our commits broke passing patterns to
install.  The problem is that bestPackagesFromList is only returning a
singleton list.  So if you try to install *, you end up with only the
package with the shortest name (and whatever depends on it, of course).
Good times.

See the attached patch for a fix.  Comments?

- Chris
-------------- next part --------------
diff -ruN yum-2.9.4/yum/__init__.py yum-2.9.4.new/yum/__init__.py
--- yum-2.9.4/yum/__init__.py	2006-08-09 00:14:44.000000000 -0400
+++ yum-2.9.4.new/yum/__init__.py	2006-08-17 14:44:53.000000000 -0400
@@ -42,6 +42,7 @@
 import transactioninfo
 import urlgrabber
 from urlgrabber.grabber import URLGrabError
+from packageSack import ListPackageSack
 import depsolve
 import plugins
 import logginglevels
@@ -1759,7 +1760,15 @@
                      ver=nevra_dict['version'], rel=nevra_dict['release'])
                 
             if pkgs:
-                pkgs = self.bestPackagesFromList(pkgs)
+                pkgSack = ListPackageSack(pkgs)
+                pkgs = pkgSack.returnNewestByName()
+                del(pkgSack)
+
+                lst = []
+                for pkg in pkgs:
+                    lst.extend(self.bestPackagesFromList(pkg))
+
+                pkgs = lst
 
         if len(pkgs) == 0:
             #FIXME - this is where we could check to see if it already installed


More information about the Yum-devel mailing list