As it currently stands in HEAD, we end up downloading the filelists on
essentially every upgrade. This adds about 6 MB to what needs to be
downloaded (to the 3 for primary) which is going to really hurt for
people on lower speed connections.
Previously, we had switched to lazily grabbing it but it came at a
significant cost on depsolving speed (400% of time). This patch still
has a little hit (it's running at 120% of the time without the change),
but that seems to be a bit better of a trade-off to avoid downloading
the 6 meg filelists in most cases.
The basic idea is that we have a lot of file information stored in
primary.xml (and sqlite); so add a way to get at that information and
use it rather than the full filelist when doing the quick checks.
Tested with a current rawhide update[1] with only the above impact.
Jeremy
[1] Minus the things which pull in filelists. grr. A few bugs are
being filed to cut down on the common things that are going to trigger
this
Index: yum/depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.163
diff -u -u -r1.163 depsolve.py
--- yum/depsolve.py 24 Apr 2007 21:02:50 -0000 1.163
+++ yum/depsolve.py 15 May 2007 20:08:57 -0000
@@ -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: yum/packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.101
diff -u -u -r1.101 packages.py
--- yum/packages.py 25 Apr 2007 20:19:19 -0000 1.101
+++ yum/packages.py 15 May 2007 20:08:57 -0000
@@ -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: yum/sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.97
diff -u -u -r1.97 sqlitesack.py
--- yum/sqlitesack.py 25 Apr 2007 18:28:31 -0000 1.97
+++ yum/sqlitesack.py 15 May 2007 20:08:57 -0000
@@ -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]
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel