concretizer: add a rule to avoid cycles in the graph of dependencies
This commit is contained in:
parent
522be6cadf
commit
2231dfc898
@ -111,6 +111,11 @@ needed(Dependency) :- needed(Package), depends_on(Package, Dependency).
|
|||||||
% real dependencies imply new nodes.
|
% real dependencies imply new nodes.
|
||||||
node(Dependency) :- node(Package), depends_on(Package, Dependency).
|
node(Dependency) :- node(Package), depends_on(Package, Dependency).
|
||||||
|
|
||||||
|
% Avoid cycles in the DAG
|
||||||
|
path(Parent, Child) :- depends_on(Parent, Child).
|
||||||
|
path(Parent, Descendant) :- path(Parent, A), depends_on(A, Descendant).
|
||||||
|
:- path(A, B), path(B, A).
|
||||||
|
|
||||||
% do not warn if generated program contains none of these.
|
% do not warn if generated program contains none of these.
|
||||||
#defined depends_on/3.
|
#defined depends_on/3.
|
||||||
#defined declared_dependency/3.
|
#defined declared_dependency/3.
|
||||||
|
@ -2372,11 +2372,10 @@ def inject_patches_variant(root):
|
|||||||
|
|
||||||
patches = []
|
patches = []
|
||||||
for cond, dependency in pkg_deps[dspec.spec.name].items():
|
for cond, dependency in pkg_deps[dspec.spec.name].items():
|
||||||
if dspec.parent.satisfies(cond, strict=True):
|
for pcond, patch_list in dependency.patches.items():
|
||||||
for pcond, patch_list in dependency.patches.items():
|
if (dspec.parent.satisfies(cond, strict=True)
|
||||||
if dspec.spec.satisfies(pcond):
|
and dspec.spec.satisfies(pcond)):
|
||||||
for patch in patch_list:
|
patches.extend(patch_list)
|
||||||
patches.append(patch)
|
|
||||||
if patches:
|
if patches:
|
||||||
all_patches = spec_to_patches.setdefault(id(dspec.spec), [])
|
all_patches = spec_to_patches.setdefault(id(dspec.spec), [])
|
||||||
all_patches.extend(patches)
|
all_patches.extend(patches)
|
||||||
|
Loading…
Reference in New Issue
Block a user