summaryrefslogtreecommitdiff
path: root/morphlib/morphloader.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/morphloader.py')
-rw-r--r--morphlib/morphloader.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py
index 21e10827..0249bbae 100644
--- a/morphlib/morphloader.py
+++ b/morphlib/morphloader.py
@@ -354,6 +354,8 @@ class MorphologyLoader(object):
'products': [],
'max-jobs': None,
'build-system': 'manual',
+ 'build-mode': 'staging',
+ 'prefix': '/usr',
},
'stratum': {
'chunks': [],
@@ -438,9 +440,6 @@ class MorphologyLoader(object):
self._require_field('kind', morph)
# The rest of the validation is dependent on the kind.
-
- # FIXME: move validation of clusters from morph2 to
- # here, and use morphload to load the morphology
kind = morph['kind']
if kind not in ('system', 'stratum', 'chunk', 'cluster'):
raise UnknownKindError(morph['kind'], morph.filename)
@@ -731,16 +730,24 @@ class MorphologyLoader(object):
for spec in morph['chunks']:
if 'repo' not in spec:
spec['repo'] = spec['name']
- if 'morph' not in spec:
- spec['morph'] = spec['name']
+ if 'build-mode' not in spec:
+ spec['build-mode'] = \
+ self._static_defaults['chunk']['build-mode']
+ if 'prefix' not in spec:
+ spec['prefix'] = \
+ self._static_defaults['chunk']['prefix']
self._set_stratum_specs_defaults(morph, 'build-depends')
def _unset_stratum_defaults(self, morph):
for spec in morph['chunks']:
if 'repo' in spec and spec['repo'] == spec['name']:
del spec['repo']
- if 'morph' in spec and spec['morph'] == spec['name']:
- del spec['morph']
+ if 'build-mode' in spec and spec['build-mode'] == \
+ self._static_defaults['chunk']['build-mode']:
+ del spec['build-mode']
+ if 'prefix' in spec and spec['prefix'] == \
+ self._static_defaults['chunk']['prefix']:
+ del spec['prefix']
self._unset_stratum_specs_defaults(morph, 'strata')
def _set_chunk_defaults(self, morph):