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

View File

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