summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2016-05-04 13:39:11 +0100
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2016-05-04 13:49:52 +0100
commit38c5347f8024da13b2e9940366ed26209df080ee (patch)
treecf47fc1e0ee1c523f4e8d45effdc856e01ad599d
parent9fb0a8e965b83695aef7205768b232646b5e1f18 (diff)
downloadybd-remove-strata-chunks-data.tar.gz
Use 'contents' in all cases, not 'strata'remove-strata-chunks-data
We were accidentally keeping the 'strata' and 'chunks' data around, and using it in assembly.py. This fixes that...
-rw-r--r--ybd/assembly.py7
-rw-r--r--ybd/definitions.py9
2 files changed, 7 insertions, 9 deletions
diff --git a/ybd/assembly.py b/ybd/assembly.py
index 02efda1..f5a8d59 100644
--- a/ybd/assembly.py
+++ b/ybd/assembly.py
@@ -178,9 +178,10 @@ def install_contents(defs, component):
if component.get('kind', 'chunk') == 'system':
artifacts = None
- for stratum in component['strata']:
- if stratum['path'] == content['path']:
- artifacts = stratum.get('artifacts')
+ for s in component['contents']:
+ subcomponent = defs.get(s)
+ if subcomponent['path'] == content['path']:
+ artifacts = subcomponent.get('artifacts')
break
if artifacts:
diff --git a/ybd/definitions.py b/ybd/definitions.py
index e4daf87..6b6345e 100644
--- a/ybd/definitions.py
+++ b/ybd/definitions.py
@@ -135,8 +135,7 @@ class Definitions(object):
# 'chunks' field in a stratum .morph file, or the 'strata' field in a
# system .morph file.
item['contents'] = item.get('contents', [])
- for component in item.get('chunks', []) + item.get('strata', []):
- item['contents'] += [component]
+ item['contents'] += item.pop('chunks', []) + item.pop('strata', [])
lookup = {}
for index, component in enumerate(item.get('contents', [])):
@@ -148,10 +147,8 @@ class Definitions(object):
for x, it in enumerate(component.get('build-depends', [])):
component['build-depends'][x] = lookup.get(it, it)
- component['build-depends'] = (
- item.get('build-depends', []) +
- component.get('build-depends', [])
- )
+ component['build-depends'] = (item.get('build-depends', []) +
+ component.get('build-depends', []))
item['contents'][index] = self._insert(component)
return self._insert(item)