[yum-cvs] yum/yum packages.py,1.68,1.69 sqlitesack.py,1.46,1.47

Jeremy Katz katzj at linux.duke.edu
Wed Sep 13 22:37:48 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv12110/yum

Modified Files:
	packages.py sqlitesack.py 
Log Message:
swap arguments on __init__ for a few Package types so that we have consistency


Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- packages.py	8 Sep 2006 21:05:16 -0000	1.68
+++ packages.py	13 Sep 2006 22:37:46 -0000	1.69
@@ -552,7 +552,7 @@
 
 class YumHeaderPackage(YumAvailablePackage):
     """Package object built from an rpm header"""
-    def __init__(self, hdr, repo):
+    def __init__(self, repo, hdr):
         """hand in an rpm header, we'll assume it's installed and query from there"""
        
         YumAvailablePackage.__init__(self, repo)
@@ -686,7 +686,7 @@
     """super class for dealing with packages in the rpmdb"""
     def __init__(self, hdr):
         fakerepo = FakeRepository('installed')
-        YumHeaderPackage.__init__(self, hdr, fakerepo)
+        YumHeaderPackage.__init__(self, fakerepo, hdr)
 
 class YumLocalPackage(YumHeaderPackage):
     """Class to handle an arbitrary package from a file path
@@ -713,7 +713,7 @@
                 'Could not open local rpm file: %s' % self.localpath
         
         fakerepo = FakeRepository(filename)
-        YumHeaderPackage.__init__(self, hdr, fakerepo)
+        YumHeaderPackage.__init__(self, fakerepo, hdr)
         
     def localPkg(self):
         return self.localpath

Index: sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- sqlitesack.py	2 Sep 2006 07:47:27 -0000	1.46
+++ sqlitesack.py	13 Sep 2006 22:37:46 -0000	1.47
@@ -32,7 +32,7 @@
 # Simple subclass of YumAvailablePackage that can load 'simple headers' from
 # the database when they are requested
 class YumAvailablePackageSqlite(YumAvailablePackage):
-    def __init__(self, pkgdict, repo):
+    def __init__(self, repo, pkgdict):
         YumAvailablePackage.__init__(self, repo, pkgdict)
         self.sack = pkgdict.sack
         self.pkgId = pkgdict.pkgId
@@ -228,7 +228,7 @@
                 if (self.excludes[rep].has_key(ob['pkgId'])):
                     continue
                 pkg = self.getPackageDetails(ob['pkgId'])
-                result.append((self.pc(pkg,rep)))
+                result.append((self.pc(rep,pkg)))
 
         for (rep,cache) in self.filelistsdb.items():
             cur = cache.cursor()
@@ -261,7 +261,7 @@
             if (not real):
                 continue
             pkg = self.getPackageDetails(ob['pkgId'])
-            result.append((self.pc(pkg,rep)))
+            result.append((self.pc(rep,pkg)))
         return result     
     
     def returnObsoletes(self):
@@ -326,7 +326,7 @@
                       }
                       ]
                     }
-                    results.append(self.pc(pkg,rep))
+                    results.append(self.pc(rep,pkg))
 
 
         # If it's not a provides or a filename, we are done
@@ -346,7 +346,7 @@
                         continue
                                             
                     pkg.files = {name: res['type']}
-                    results.append(self.pc(pkg,rep))
+                    results.append(self.pc(rep,pkg))
 
         matched = 0
         globs = ['.*bin\/.*', '^\/etc\/.*', '^\/usr\/lib\/sendmail$']
@@ -396,7 +396,7 @@
                 
                 # If it matches we only know the packageId
                 pkg = self.getPackageDetails(res['pkgId'])
-                results.append(self.pc(pkg,rep))
+                results.append(self.pc(rep,pkg))
         
         return results
 
@@ -472,7 +472,7 @@
             for x in cur.fetchall():
                 if (self.excludes[rep].has_key(x.pkgId)):
                     continue                    
-                allpkg.append(self.pc(self.db2class(x,True),rep))
+                allpkg.append(self.pc(rep,self.db2class(x,True)))
         
         # if we've got zilch then raise
         if not allpkg:
@@ -493,7 +493,7 @@
             for x in cur.fetchall():
                 if (self.excludes[rep].has_key(x.pkgId)):
                     continue                    
-                allpkg.append(self.pc(self.db2class(x,True),rep))
+                allpkg.append(self.pc(rep,self.db2class(x,True)))
         
         # if we've got zilch then raise
         if not allpkg:
@@ -509,8 +509,8 @@
                 cur.execute("select pkgId,name,epoch,version,release,arch from packages")
                 for x in cur.fetchall():
                     if (self.excludes[repo].has_key(x.pkgId)):
-                        continue                    
-                    returnList.append(self.pc(self.db2class(x,True),repo))
+                        continue
+                    returnList.append(self.pc(repo,self.db2class(x,True)))
         return returnList
 
     def searchNevra(self, name=None, epoch=None, ver=None, rel=None, arch=None):        
@@ -543,7 +543,7 @@
             for x in cur.fetchall():
                 if (self.excludes[rep].has_key(x.pkgId)):
                     continue
-                returnList.append(self.pc(self.db2class(x),rep))
+                returnList.append(self.pc(rep,self.db2class(x)))
         return returnList
     
     def excludeArchs(self, archlist):
@@ -558,7 +558,7 @@
             cur = cache.cursor()
             cur.execute(querystring)
             for x in cur.fetchall():
-                obj = self.pc(self.db2class(x), rep)
+                obj = self.pc(rep,self.db2class(x))
                 self.delPackage(obj)
 
 # Simple helper functions




More information about the Yum-cvs-commits mailing list