Fix infinite recursion in PrebuiltsReady when graph is cyclic.

Our package graph is cyclic, so parallel_emerge needs to handle cycles
correctly in all cases. PrebuiltsReady should only need to check each package
once, so we should set cache[pkg] to True if we found the package in the cache.

TEST=Ran build_packages --fast
BUG=none

Review URL: http://codereview.chromium.org/3047009
This commit is contained in:
David James 2010-07-21 14:17:05 -07:00
parent 9926ee2879
commit 2be3f829e9

View File

@ -819,11 +819,12 @@ class DepGraphGenerator(object):
if pkg not in pkg_db:
cache[pkg] = False
else:
cache[pkg] = True
for dep in deps_map[pkg]["needs"]:
if not PrebuiltsReady(dep, pkg_db, cache):
cache[pkg] = False
break
return cache.setdefault(pkg, True)
return cache[pkg]
def LastModifiedWithDeps(pkg, pkg_db, cache):
"""Calculate the last modified time of a package and its dependencies.