diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-02-27 07:45:41 +0000 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-02-27 09:37:13 +0000 |
commit | cafab9ec089e3d9c5a02d41d9809ee42d2ff9af3 (patch) | |
tree | e2f53b84139327da4b4ed1337e6369b13f6a15b3 /ybd/splitting.py | |
parent | 6f0533fa428a27016773c11409c113c5defc4ae2 (diff) | |
download | ybd-cafab9ec089e3d9c5a02d41d9809ee42d2ff9af3.tar.gz |
Only report overlaps once
Diffstat (limited to 'ybd/splitting.py')
-rw-r--r-- | ybd/splitting.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ybd/splitting.py b/ybd/splitting.py index 5eca240..ab14ac2 100644 --- a/ybd/splitting.py +++ b/ybd/splitting.py @@ -93,7 +93,21 @@ def install_stratum_artifacts(defs, component, stratum, artifacts): app.log(stratum, 'WARNING: problem loading ', metafile) +def check_overlaps(defs, component): + if set(app.config['new-overlaps']) <= set(app.config['overlaps']): + app.config['new-overlaps'] = [] + return + + app.config['overlaps'] = list(set(app.config['new-overlaps'] + + app.config['overlaps'])) + app.config['new-overlaps'] = list(set(app.config['new-overlaps'])) + for path in app.config['new-overlaps']: + app.log(component, 'WARNING: Overlapping file: ', path) + app.config['new-overlaps'] = [] + + def write_metadata(defs, component): + check_overlaps(defs, component) kind = component.get('kind', 'chunk') if kind == 'chunk': write_chunk_metafile(defs, component) @@ -151,6 +165,7 @@ def write_chunk_metafile(defs, chunk): 'ref': chunk.get('ref'), 'products': [{'artifact': a, 'files': sorted(splits[a])} for a in unique_artifacts]} + with app.chdir(chunk['install']), open(metafile, "w") as f: yaml.safe_dump(metadata, f, default_flow_style=False) |