diff options
-rw-r--r-- | morphlib/buildcommand.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 95f3812e..cd7cbc26 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -102,8 +102,14 @@ class BuildCommand(object): return order def _validate_cross_morphology_references(self, srcpool): + '''Perform validation across all morphologies involved in the build''' + + stratum_names = [] + for src in srcpool: kind = src.morphology['kind'] + + # Verify that chunks pointed to by strata really are chunks, etc. method_name = '_validate_cross_refs_for_%s' % kind if hasattr(self, method_name): logging.debug('Calling %s' % method_name) @@ -111,6 +117,19 @@ class BuildCommand(object): else: logging.warning('No %s' % method_name) + # Verify stratum build-depends agree with the system's contents. + # It's not an error to build-depend on a stratum that isn't + # included in the target system, but if it is included, the repo + # and ref fields must match. + if src.morphology['kind'] == 'stratum': + name = src.morphology['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) + def _validate_cross_refs_for_system(self, src, srcpool): self._validate_cross_refs_for_xxx( src, srcpool, src.morphology['strata'], 'stratum') |