bugfix: conflicts should print out the spec that has the conflict (#11947)
- Fix a bug introdcued by removing parse_anonymous_spec() - Conflicts' when specs are now *actually* anonymous, and the name of the package is implicit, so we need to remember to add it back to error messages.
This commit is contained in:
parent
e8506994b1
commit
51b58f1478
1 changed files with 6 additions and 1 deletions
|
@ -2017,13 +2017,18 @@ def concretize(self, tests=False):
|
||||||
|
|
||||||
# Now that the spec is concrete we should check if
|
# Now that the spec is concrete we should check if
|
||||||
# there are declared conflicts
|
# there are declared conflicts
|
||||||
|
#
|
||||||
|
# TODO: this needs rethinking, as currently we can only express
|
||||||
|
# TODO: internal configuration conflicts within one package.
|
||||||
matches = []
|
matches = []
|
||||||
for x in self.traverse():
|
for x in self.traverse():
|
||||||
for conflict_spec, when_list in x.package_class.conflicts.items():
|
for conflict_spec, when_list in x.package_class.conflicts.items():
|
||||||
if x.satisfies(conflict_spec, strict=True):
|
if x.satisfies(conflict_spec, strict=True):
|
||||||
for when_spec, msg in when_list:
|
for when_spec, msg in when_list:
|
||||||
if x.satisfies(when_spec, strict=True):
|
if x.satisfies(when_spec, strict=True):
|
||||||
matches.append((x, conflict_spec, when_spec, msg))
|
when = when_spec.copy()
|
||||||
|
when.name = x.name
|
||||||
|
matches.append((x, conflict_spec, when, msg))
|
||||||
if matches:
|
if matches:
|
||||||
raise ConflictsInSpecError(self, matches)
|
raise ConflictsInSpecError(self, matches)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue