summaryrefslogtreecommitdiff
path: root/morphlib/morphologyfactory.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/morphologyfactory.py')
-rw-r--r--morphlib/morphologyfactory.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/morphlib/morphologyfactory.py b/morphlib/morphologyfactory.py
index fa71e820..ae5a4332 100644
--- a/morphlib/morphologyfactory.py
+++ b/morphlib/morphologyfactory.py
@@ -54,6 +54,13 @@ class EmptyStratumError(StratumError):
"Stratum %s is empty (has no dependencies)" % stratum)
+class NoStratumBuildDependsError(StratumError):
+ def __init__(self, stratum):
+ StratumError.__init__(
+ self, 'Stratum %s has no build-dependencies listed '
+ 'and has no bootstrap chunks.' % stratum)
+
+
class MorphologyFactory(object):
'''An way of creating morphologies which will provide a default'''
@@ -162,6 +169,11 @@ class MorphologyFactory(object):
name = source.get('name', source.get('repo', 'unknown'))
raise NoChunkBuildDependsError(filename, name)
+ if (len(morphology['build-depends'] or []) == 0 and
+ not any(c.get('build-mode') in ('bootstrap', 'test')
+ for c in morphology['chunks'])):
+ raise NoStratumBuildDependsError(filename)
+
morphology.builds_artifacts = [morphology['name']]
morphology.needs_artifact_metadata_cached = True