[yum-cvs] yum/yum depsolve.py,1.67,1.68 sqlitesack.py,1.22,1.23

Jeremy Katz katzj at login.linux.duke.edu
Wed Sep 21 17:33:54 UTC 2005


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

Modified Files:
	depsolve.py sqlitesack.py 
Log Message:
returnByName* methods are expected to return a list.  make sure we do so (and
deal with it being done) consistently.  (rh bug#168712)


Index: depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- depsolve.py	9 Jul 2005 22:57:09 -0000	1.67
+++ depsolve.py	21 Sep 2005 17:33:52 -0000	1.68
@@ -485,14 +485,14 @@
             if len(uplist) > 0:
                 if name not in self.conf.exactarchlist:
                     pkgs = self.pkgSack.returnNewestByName(name)
-                    archs = []
+                    archs = {}
                     for pkg in pkgs:
                         (n,a,e,v,r) = pkg.pkgtup
-                        archs.append(a)
-                    a = rpmUtils.arch.getBestArchFromList(archs)
-                    po = self.pkgSack.returnNewestByNameArch((n,a))
+                        archs[a] = pkg
+                    a = rpmUtils.arch.getBestArchFromList(archs.keys())
+                    po = archs[a]
                 else:
-                    po = self.pkgSack.returnNewestByNameArch((name,arch))
+                    po = self.pkgSack.returnNewestByNameArch((name,arch))[0]
                 if po.pkgtup not in uplist:
                     po = None
 
@@ -691,14 +691,14 @@
             if len(uplist) > 0:
                 if confname not in self.conf.exactarchlist:
                     pkgs = self.pkgSack.returnNewestByName(confname)
-                    archs = []
+                    archs = {}
                     for pkg in pkgs:
                         (n,a,e,v,r) = pkg.pkgtup
-                        archs.append(a)
-                    a = rpmUtils.arch.getBestArchFromList(archs)
-                    po = self.pkgSack.returnNewestByNameArch((n,a))
+                        archs[a] = pkg
+                    a = rpmUtils.arch.getBestArchFromList(archs.keys())
+                    po = archs[a]
                 else:
-                    po = self.pkgSack.returnNewestByNameArch((confname,confarch))
+                    po = self.pkgSack.returnNewestByNameArch((confname,confarch))[0]
                 if po.pkgtup not in uplist:
                     po = None
 

Index: sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- sqlitesack.py	16 Sep 2005 22:02:51 -0000	1.22
+++ sqlitesack.py	21 Sep 2005 17:33:52 -0000	1.23
@@ -411,7 +411,7 @@
         # if we've got zilch then raise
         if not allpkg:
             raise mdErrors.PackageSackError, 'No Package Matching %s.%s' % naTup
-        return mdUtils.newestInList(allpkg)
+        return [ mdUtils.newestInList(allpkg) ]
 
     def returnNewestByName(self, name=None):
         # If name is set do it from the database otherwise use our parent's
@@ -432,7 +432,7 @@
         # if we've got zilch then raise
         if not allpkg:
             raise mdErrors.PackageSackError, 'No Package Matching %s' % name
-        return mdUtils.newestInList(allpkg)
+        return [ mdUtils.newestInList(allpkg) ]
 
     def returnPackages(self, repoid=None):
         """Returns a list of packages, only containing nevra information """




More information about the Yum-cvs-commits mailing list