diff options
author | Ana <ana.huelamo@codethink.co.uk> | 2016-11-15 12:54:46 +0000 |
---|---|---|
committer | Ana <ana.huelamo@codethink.co.uk> | 2016-11-15 12:54:46 +0000 |
commit | 1556ae96714e564346a3c250334bc8d87181113d (patch) | |
tree | 8d8afdde009265658b10dc72c80128ba579e5844 | |
parent | 9f74c90cf038610d67f428d7f27643270f2d0f4f (diff) | |
parent | e554dca527db45d144bb7c01f963973636277745 (diff) | |
download | ybd-1556ae96714e564346a3c250334bc8d87181113d.tar.gz |
Merge branch 'jjardon/tacgomes/artifact-splitting' into 'master'
Include all artifacts if not explicitly given
Include all the stratum artifacts if no one was explicitly given using
the `artifact` field when building a system.
This fixes a problem where the non-minimal systems in definitions were
not including the artifacts on build-essential-minimal.
See merge request !264
-rw-r--r-- | ybd/splitting.py | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/ybd/splitting.py b/ybd/splitting.py index ec81402..38ead98 100644 --- a/ybd/splitting.py +++ b/ybd/splitting.py @@ -31,20 +31,6 @@ def install_split_artifacts(dn): sandbox to the dn['install'] ''' - all_splits = [] - for i in app.defs.defaults.get_split_rules('stratum'): - all_splits += [i['artifact']] - for index, content in enumerate(dn['contents']): - for stratum, artifacts in content.items(): - if artifacts == []: - if config.get('default-splits', []) != []: - for split in config.get('default-splits'): - artifacts += [app.defs.get(stratum)['name'] + split] - else: - for split in all_splits: - artifacts += [os.path.basename(stratum) + split] - - dn['contents'][index] = {stratum: artifacts} for content in dn['contents']: key = content.keys()[0] @@ -53,19 +39,25 @@ def install_split_artifacts(dn): def move_required_files(dn, stratum, artifacts): - log(dn, 'Installing %s artifacts' % stratum['name'], artifacts) stratum_metadata = get_metadata(stratum) split_stratum_metadata = {} - split_stratum_metadata['products'] = [] - to_keep = [] - for product in stratum_metadata['products']: - for artifact in artifacts: - if artifact == product['artifact']: - to_keep += product['components'] - split_stratum_metadata['products'].append(product) - - log(dn, 'Splitting artifacts:', artifacts, verbose=True) - log(dn, 'Splitting components:', to_keep, verbose=True) + if not artifacts: + # Include all artifacts if no ones were explicitly given for an + # included stratum on a system. + artifacts = [p['artifact'] for p in stratum_metadata['products']] + + to_keep = [component + for product in stratum_metadata['products'] + for component in product['components'] + if product['artifact'] in artifacts] + + split_stratum_metadata['products'] = ( + [product + for product in stratum_metadata['products'] + if product['artifact'] in artifacts]) + + log(dn, 'Installing %s artifacts' % stratum['name'], artifacts) + log(dn, 'Installing components:', to_keep, verbose=True) baserockpath = os.path.join(dn['install'], 'baserock') if not os.path.isdir(baserockpath): |