concretizer: fix failing unit tests

This commit is contained in:
Massimiliano Culpo 2020-12-17 22:50:13 +01:00 committed by Tamara Dahlgren
parent ab3f53d781
commit cb76c5a90d
2 changed files with 18 additions and 4 deletions

View file

@ -1031,7 +1031,11 @@ class Body(object):
# add all clauses from dependencies # add all clauses from dependencies
if transitive: if transitive:
for dep in spec.traverse(root=False): for dep in spec.traverse(root=False):
clauses.extend(self.spec_clauses(dep, body, transitive=False)) if dep.virtual:
clauses.extend(self.virtual_spec_clauses(dep))
else:
clauses.extend(
self.spec_clauses(dep, body, transitive=False))
return clauses return clauses

View file

@ -62,7 +62,15 @@ dependency_conditions(P, D, T) :-
#defined dependency_type/2. #defined dependency_type/2.
% collect all the dependency conditions into a single conditional rule % collect all the dependency conditions into a single conditional rule
dependency_conditions_hold(Package, Dependency, ID) :- % distinguishing between Parent and Package is needed to account for
% conditions like:
%
% depends_on('patchelf@0.9', when='@1.0:1.1 ^python@:2')
%
% that include dependencies
dependency_conditions_hold(Parent, Dependency, ID) :-
node(Package)
: required_dependency_condition(ID, "node", Package);
version(Package, Version) version(Package, Version)
: required_dependency_condition(ID, "version", Package, Version); : required_dependency_condition(ID, "version", Package, Version);
version_satisfies(Package, Constraint) version_satisfies(Package, Constraint)
@ -79,10 +87,12 @@ dependency_conditions_hold(Package, Dependency, ID) :-
: required_dependency_condition(ID, "node_compiler", Package, Compiler); : required_dependency_condition(ID, "node_compiler", Package, Compiler);
node_compiler_version(Package, Compiler, Version) node_compiler_version(Package, Compiler, Version)
: required_dependency_condition(ID, "node_compiler_version", Package, Compiler, Version); : required_dependency_condition(ID, "node_compiler_version", Package, Compiler, Version);
node_compiler_version_satisfies(Package, Compiler, Version)
: required_dependency_condition(ID, "node_compiler_version_satisfies", Package, Compiler, Version);
node_flag(Package, FlagType, Flag) node_flag(Package, FlagType, Flag)
: required_dependency_condition(ID, "node_flag", Package, FlagType, Flag); : required_dependency_condition(ID, "node_flag", Package, FlagType, Flag);
dependency_condition(Package, Dependency, ID); dependency_condition(Parent, Dependency, ID);
node(Package). node(Parent).
#defined dependency_condition/3. #defined dependency_condition/3.
#defined required_dependency_condition/3. #defined required_dependency_condition/3.