diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-09-29 11:59:59 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-09-29 11:59:59 +0100 |
commit | 036533d4c0ed3549b3b34af052709c840603ea9a (patch) | |
tree | ff29cd7b5024e7f20cd21227c182bdc76fa9744a /morphlib/morphology.py | |
parent | 8e76dabb40404874560b1f32a32b22e41d156598 (diff) | |
download | morph-036533d4c0ed3549b3b34af052709c840603ea9a.tar.gz |
Remove "source" field from chunk morphologies.
Diffstat (limited to 'morphlib/morphology.py')
-rw-r--r-- | morphlib/morphology.py | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/morphlib/morphology.py b/morphlib/morphology.py index d31a000c..86658fb8 100644 --- a/morphlib/morphology.py +++ b/morphlib/morphology.py @@ -47,7 +47,6 @@ class Morphology(object): if self.kind == 'chunk': self._validate_chunk() - self.source['repo'] = self._join_with_baseurl(self.source['repo']) elif self.kind == 'stratum': self._validate_stratum() for source in self.sources.itervalues(): @@ -59,35 +58,10 @@ class Morphology(object): self.filename = self._fp.name def _validate_chunk(self): - valid_toplevel_keys = ['name', 'kind', 'source', 'configure-commands', + valid_toplevel_keys = ['name', 'kind', 'configure-commands', 'build-commands', 'test-commands', 'install-commands'] - if 'source' not in self._dict: - raise self._error('chunks must have "source" field') - - if type(self.source) != dict: - raise self._error('"source" must be a dictionary') - - if len(self.source) == 0: - raise self._error('"source" must not be empty') - - if 'repo' not in self.source: - raise self._error('"source" must contain "repo"') - - if not self.source['repo']: - raise self._error('"source" must contain non-empty "repo"') - - if 'ref' not in self.source: - raise self._error('"source" must contain "ref"') - - if not self.source['ref']: - raise self._error('"source" must contain non-empty "ref"') - - for key in self.source.keys(): - if key not in ('repo', 'ref'): - raise self._error('unknown key "%s" in "source"' % key) - cmdlists = [ (self.configure_commands, 'configure-commands'), (self.build_commands, 'build-commands'), @@ -149,10 +123,6 @@ class Morphology(object): return self._dict['kind'] @property - def source(self): - return self._dict['source'] - - @property def sources(self): return self._dict['sources'] @@ -172,14 +142,6 @@ class Morphology(object): def install_commands(self): return self._dict.get('install-commands', []) - @property - def manifest(self): - if self.kind == 'chunk': - return [(self.source['repo'], self.source['ref'])] - else: - return [(source['repo'], source['ref']) - for source in self.sources.itervalues()] - def _join_with_baseurl(self, url): is_relative = (':' not in url or '/' not in url or |