diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-07-23 17:48:03 +0100 |
---|---|---|
committer | Baserock Gerrit <gerrit@baserock.org> | 2015-09-18 15:50:19 +0000 |
commit | 81ebe71089d802061c2c3cb03bfd548388d04cb8 (patch) | |
tree | 207ec00ee9ca045825dc52560d6ab6ee36e81e7b /morphlib/morphloader.py | |
parent | a4d8098b229592db40565747b0444b518bf8a6eb (diff) | |
download | morph-81ebe71089d802061c2c3cb03bfd548388d04cb8.tar.gz |
Remove support for Baserock definitions format versions 3, 4 and 5
Change-Id: Iad95af65bd5c528d2e72f5b2ffa80a01152f50ff
Diffstat (limited to 'morphlib/morphloader.py')
-rw-r--r-- | morphlib/morphloader.py | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py index 479bc8fb..f85c5d4d 100644 --- a/morphlib/morphloader.py +++ b/morphlib/morphloader.py @@ -16,8 +16,6 @@ import collections -import copy -import logging import warnings import yaml @@ -378,6 +376,9 @@ class MorphologyLoader(object): 'pre-install-commands': None, 'install-commands': None, 'post-install-commands': None, + 'pre-strip-commands': None, + 'strip-commands': None, + 'post-strip-commands': None, 'devices': [], 'products': [], 'max-jobs': None, @@ -402,16 +403,8 @@ class MorphologyLoader(object): }, } - def __init__(self, definitions_version=0, + def __init__(self, lookup_build_system=morphlib.buildsystem.lookup_build_system): - if definitions_version >= 5: # pragma: no cover - self._static_defaults = copy.deepcopy(self._static_defaults) - self._static_defaults['chunk'].update({ - 'pre-strip-commands': None, - 'strip-commands': None, - 'post-strip-commands': None}) - - self._definitions_version = definitions_version self._lookup_build_system = lookup_build_system def parse_morphology_text(self, text, morph_filename): @@ -609,15 +602,13 @@ class MorphologyLoader(object): '%s.build-depends' % chunk_name, list, type(spec['build-depends']), morph['name']) - if self._definitions_version >= 6: - # Either 'morph' or 'build-system' must be specified. - if 'morph' in spec and 'build-system' in spec: - raise ChunkSpecConflictingFieldsError( - ['morph', 'build-system'], chunk_name, morph.filename) - if 'morph' not in spec and 'build-system' not in spec: - raise ChunkSpecNoBuildInstructionsError( - chunk_name, morph.filename) - + # Either 'morph' or 'build-system' must be specified. + if 'morph' in spec and 'build-system' in spec: + raise ChunkSpecConflictingFieldsError( + ['morph', 'build-system'], chunk_name, morph.filename) + if 'morph' not in spec and 'build-system' not in spec: + raise ChunkSpecNoBuildInstructionsError( + chunk_name, morph.filename) @classmethod def _validate_chunk(cls, morphology): |