[yum-cvs] yum/yum packageSack.py,1.18.2.8,1.18.2.9
Seth Vidal
skvidal at linux.duke.edu
Thu Jan 4 22:24:32 UTC 2007
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv20364/yum
Modified Files:
Tag: yum-3_0_X
packageSack.py
Log Message:
try to speed up MetaSack returnObsoletes()
Index: packageSack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packageSack.py,v
retrieving revision 1.18.2.8
retrieving revision 1.18.2.9
diff -u -r1.18.2.8 -r1.18.2.9
--- packageSack.py 4 Jan 2007 20:00:55 -0000 1.18.2.8
+++ packageSack.py 4 Jan 2007 22:24:30 -0000 1.18.2.9
@@ -255,14 +255,16 @@
obsdict = self._computeAggregateDictResult("returnObsoletes")
# get a sack of the newest pkgs
obstups = obsdict.keys()
+ newest_tup_dict = {}
+ for pkg in self.returnNewestByName():
+ if not newest_tup_dict.has_key(pkg.pkgtup):
+ newest_tup_dict[pkg.pkgtup] = 1
+
# go through each of the keys of the obs dict and see if it is in the
# sack of newest pkgs - if it is not - remove the entry
- for pkgtup in obstups:
- (n,a,e,v,r) = pkgtup
- tuplist = [ pkg.pkgtup
- for pkg in self.returnNewestByName(name=n) ]
- if pkgtup not in tuplist:
- del obsdict[pkgtup]
+ for obstup in obstups:
+ if not newest_tup_dict.has_key(obstup):
+ del obsdict[obstup]
return obsdict
More information about the Yum-cvs-commits
mailing list