Minor speedup to short circuit depsolving

This commit is contained in:
jkeating@reducto.boston.redhat.com 2007-02-06 22:53:43 -05:00 committed by Jesse Keating
parent 1e7940b760
commit 5749bcd8da
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,7 @@ class Gather(yum.YumBase):
self.pkglist = pkglist
self.polist = []
self.srpmlist = []
self.resolved_deps = {} # list the deps we've already resolved, short circuit.
def _provideToPkg(self, req): #this is stolen from Anaconda
bestlist = None
@ -79,6 +80,8 @@ class Gather(yum.YumBase):
pkgresults = {}
for req in reqs:
if self.resolved_deps.has_key(req):
continue
(r,f,v) = req
if r.startswith('rpmlib(') or r.startswith('config('):
continue
@ -94,6 +97,8 @@ class Gather(yum.YumBase):
if not pkgresults.has_key(dep):
pkgresults[dep] = None
self.tsInfo.addInstall(dep)
self.resolved_deps[req] = None
return pkgresults.keys()