[yum-cvs] yum/yum depsolve.py, 1.163, 1.164 packages.py, 1.101, 1.102 sqlitesack.py, 1.97, 1.98

Jeremy Katz katzj at linux.duke.edu
Tue May 29 15:39:48 UTC 2007


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

Modified Files:
	depsolve.py packages.py sqlitesack.py 
Log Message:
Much of the file information that we ever need is stored in the primary
info in addition to filelists; add a simple way to get at that information
and use that instead of the full filelists to see if something has gone away;
this avoids having to download the (large) filelists file.  If we end up
having a requirement on something outside of this step, we then later get
the filelists



Index: depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -r1.163 -r1.164
--- depsolve.py	24 Apr 2007 21:02:50 -0000	1.163
+++ depsolve.py	29 May 2007 15:39:45 -0000	1.164
@@ -1000,7 +1000,7 @@
         for newpo in txmbr.updated_by:
             for p in newpo.provides:
                 newpoprovs[p] = 1
-            for f in newpo.filelist:
+            for f in newpo.simpleFiles(): # newpo.filelist:
                 newpoprovs[(f, None, (None, None, None))] = 1
 
         ret = []

Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- packages.py	25 Apr 2007 20:19:19 -0000	1.101
+++ packages.py	29 May 2007 15:39:45 -0000	1.102
@@ -177,7 +177,6 @@
             if csumid:
                 return (csumtype, csum)
 
-                
 class RpmBase(object):
     """return functions and storage for rpm-specific data"""
 
@@ -364,6 +363,11 @@
                       Errors.YumDeprecationWarning, stacklevel=2)
         return self.provides_names
 
+    def simpleFiles(self, ftype='files'):
+        if self.files and self.files.has_key(ftype):
+            return self.files[ftype]
+        return []
+    
     filelist = property(fget=lambda self: self.returnFileEntries(ftype='file'))
     dirlist = property(fget=lambda self: self.returnFileEntries(ftype='dir'))
     ghostlist = property(fget=lambda self: self.returnFileEntries(ftype='ghost'))
@@ -551,7 +555,6 @@
         """return a list of requires in normal rpm format"""
         return self.requires_print
 
-    
     def importFromDict(self, pkgdict):
         """handles an mdCache package dictionary item to populate out 
            the package information"""

Index: sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- sqlitesack.py	25 Apr 2007 18:28:31 -0000	1.97
+++ sqlitesack.py	29 May 2007 15:39:45 -0000	1.98
@@ -175,6 +175,12 @@
         self._loadFiles()
         return RpmBase.returnFileTypes(self)
 
+    def simpleFiles(self, ftype='file'):
+        cache = self.sack.primarydb[self.repo]
+        cur = cache.cursor()
+        executeSQL(cur, "select files.name as fname from files where files.pkgKey = ? and files.type= ?", (self.pkgKey, ftype))
+        return map(lambda x: x['fname'], cur)
+
     def returnPrco(self, prcotype, printable=False):
         if not self.prco[prcotype]:
             cache = self.sack.primarydb[self.repo]




More information about the Yum-cvs-commits mailing list