mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 14:41:31 +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:
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user