summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-16 14:22:44 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-16 14:22:44 +0000
commit422653c3e599932b8d9f7ad6c7f10479d437468c (patch)
tree6d26d3576c32bff4a51bce31861734b36063f85c
parent747ee61134d66b50360cc30f85e38e0b82eff731 (diff)
downloadmorph-422653c3e599932b8d9f7ad6c7f10479d437468c.tar.gz
Give clearer error when the same 'name' is used by two strata
-rw-r--r--morphlib/buildcommand.py9
1 files 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(