diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-04-09 21:16:32 +0100 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-04-09 21:16:32 +0100 |
commit | b46abb313f258975b76eaea9c524e5c049ba0e74 (patch) | |
tree | c9fe77a8b4990d78b28b406076656bddfb5145ca | |
parent | a91c67e48ebf51a3af125fdca25f836df2d1418d (diff) | |
download | ybd-b46abb313f258975b76eaea9c524e5c049ba0e74.tar.gz |
Partial fix for #202 - add cache-key to .meta
-rw-r--r-- | ybd/splitting.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ybd/splitting.py b/ybd/splitting.py index 72bb1aa..e1e5493 100644 --- a/ybd/splitting.py +++ b/ybd/splitting.py @@ -71,7 +71,8 @@ def install_stratum_artifacts(defs, component, stratum, artifacts): with open(metafile, "r") as f: filelist = [] metadata = yaml.safe_load(f) - split_metadata = {'ref': metadata['ref'], + split_metadata = {'cache': metadata['cache'], + 'ref': metadata['ref'], 'repo': metadata['repo'], 'products': []} for element in metadata['products']: @@ -193,7 +194,8 @@ def write_stratum_metafiles(defs, stratum): continue metadata = get_metadata(defs, chunk) - split_metadata = {'ref': metadata['ref'], + split_metadata = {'cache': metadata['cache'], + 'ref': metadata['ref'], 'repo': metadata['repo'], 'products': []} @@ -218,13 +220,15 @@ def write_stratum_metafiles(defs, stratum): def write_metafile(rules, splits, component): - metadata = {'products': [{'artifact': a, + metadata = {'cache': component.get('cache'), + 'products': [{'artifact': a, 'components': sorted(set(splits[a]))} for a, r in rules]} if component.get('kind', 'chunk') == 'chunk': unique_artifacts = sorted(set([a for a, r in rules])) - metadata = {'repo': component.get('repo'), + metadata = {'cache': component.get('cache'), + 'repo': component.get('repo'), 'ref': component.get('ref'), 'products': [{'artifact': a, 'files': sorted(splits[a])} for a in unique_artifacts]} |