From 422653c3e599932b8d9f7ad6c7f10479d437468c Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 16 Oct 2014 14:22:44 +0000 Subject: Give clearer error when the same 'name' is used by two strata --- morphlib/buildcommand.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 799b85d4..7eb6c0ab 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -184,7 +184,7 @@ class BuildCommand(object): def _validate_cross_morphology_references(self, srcpool): '''Perform validation across all morphologies involved in the build''' - stratum_names = [] + stratum_names = {} for src in srcpool: kind = src.morphology['kind'] @@ -210,10 +210,9 @@ class BuildCommand(object): name = src.name if name in stratum_names: raise morphlib.Error( - "Conflicting versions of stratum '%s' appear in the " - "build. Check the contents of the system against the " - "build-depends of the strata." % name) - stratum_names.append(name) + "Multiple strata produce a '%s' artifact: %s and %s" % + (name, stratum_names[name].filename, src.filename)) + stratum_names[name] = src def _validate_cross_refs_for_system(self, src, srcpool): self._validate_cross_refs_for_xxx( -- cgit v1.2.1