mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
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:
parent
9926ee2879
commit
2be3f829e9
@ -819,11 +819,12 @@ class DepGraphGenerator(object):
|
|||||||
if pkg not in pkg_db:
|
if pkg not in pkg_db:
|
||||||
cache[pkg] = False
|
cache[pkg] = False
|
||||||
else:
|
else:
|
||||||
|
cache[pkg] = True
|
||||||
for dep in deps_map[pkg]["needs"]:
|
for dep in deps_map[pkg]["needs"]:
|
||||||
if not PrebuiltsReady(dep, pkg_db, cache):
|
if not PrebuiltsReady(dep, pkg_db, cache):
|
||||||
cache[pkg] = False
|
cache[pkg] = False
|
||||||
break
|
break
|
||||||
return cache.setdefault(pkg, True)
|
return cache[pkg]
|
||||||
|
|
||||||
def LastModifiedWithDeps(pkg, pkg_db, cache):
|
def LastModifiedWithDeps(pkg, pkg_db, cache):
|
||||||
"""Calculate the last modified time of a package and its dependencies.
|
"""Calculate the last modified time of a package and its dependencies.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user