summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/builder.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py
index 06b4198b..4f6f2194 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -608,11 +608,15 @@ class SystemBuilder(BuilderBase): # pragma: no cover
with cache.get(chunk) as chunk_file:
morphlib.bins.unpack_binary_from_file(chunk_file, target)
+ target_metadata_dir = os.path.join(target, 'baserock')
+ if not os.path.exists(target_metadata_dir):
+ os.mkdir(target_metadata_dir)
+
target_metadata = os.path.join(
- target, 'baserock', '%s.meta' % stratum_artifact.name)
- with cache.get_artifact_metadata(stratum_artifact, 'meta') as meta_src:
- with morphlib.savefile.SaveFile(target_metadata, 'w') as meta_dst:
- shutil.copyfileobj(meta_src, meta_dst)
+ target_metadata_dir, '%s.meta' % stratum_artifact.name)
+ with cache.get_artifact_metadata(stratum_artifact, 'meta') as src_meta:
+ with morphlib.savefile.SaveFile(target_metadata, 'w') as dst_meta:
+ shutil.copyfileobj(src_meta, dst_meta)
def unpack_strata(self, path):
'''Unpack strata into a directory.'''