[yum-cvs] yum cli.py,1.193,1.194

Seth Vidal skvidal at login.linux.duke.edu
Sun Nov 13 11:02:51 UTC 2005


Update of /home/groups/yum/cvs/yum
In directory login:/tmp/cvs-serv19534

Modified Files:
	cli.py 
Log Message:

- doGenericSetup() takes a cache argument so it can be used by non-root
users
- remove several duplicate functions from packages.py
- make install() handle multilib correctly


Index: cli.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/cli.py,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -r1.193 -r1.194
--- cli.py	25 Oct 2005 15:42:13 -0000	1.193
+++ cli.py	13 Nov 2005 11:02:48 -0000	1.194
@@ -34,7 +34,7 @@
 import yum.misc
 import rpmUtils.arch
 from rpmUtils.miscutils import compareEVR
-from yum.packages import parsePackages, returnBestPackages, YumInstalledPackage, YumLocalPackage
+from yum.packages import parsePackages, YumInstalledPackage, YumLocalPackage
 from yum.logger import Logger
 from yum import pgpmsg
 from i18n import _
@@ -897,25 +897,26 @@
                                         # does not include a version-rel section
                             if pkg.pkgtup in exactmatch:
                                 if not toBeInstalled.has_key(pkg.name): toBeInstalled[pkg.name] = []
-                                toBeInstalled[pkg.name].append(pkg.pkgtup)
+                                toBeInstalled[pkg.name].append(pkg)
                 else: # we've not got any installed that match n or n+a
                     self.log(4, 'No other %s installed, adding to list for potential install' % pkg.name)
                     if not toBeInstalled.has_key(pkg.name): toBeInstalled[pkg.name] = []
-                    toBeInstalled[pkg.name].append(pkg.pkgtup)
+                    toBeInstalled[pkg.name].append(pkg)
         
         
         # this is where I could catch the installs of compat and multilib 
         # arches on a single yum install command. 
-        pkglist = returnBestPackages(toBeInstalled)
-        
+        pkglist = []
+        for name in toBeInstalled.keys():
+            pkglist.extend(self.bestPackagesFromList(toBeInstalled[name]))
+            
         # This is where we need to do a lookup to find out if this install
         # is also an obsolete. if so then we need to mark it as such in the
         # tsInfo.
         if len(pkglist) > 0:
             self.log(3, 'reduced installs :')
-        for pkgtup in pkglist:
-            self.log(3,'   %s.%s %s:%s-%s' % pkgtup)
-            po = self.getPackageObject(pkgtup)
+        for po in pkglist:
+            self.log(3,'   %s.%s %s:%s-%s' % po.pkgtup)
             self.tsInfo.addInstall(po)
 
         if len(passToUpdate) > 0:




More information about the Yum-cvs-commits mailing list