summaryrefslogtreecommitdiff
path: root/morphlib/builder.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-14 17:50:34 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-14 17:50:34 +0000
commit4afa01f6711ec07f8f4030d457aff93db73d1f1a (patch)
tree0af5348ecb4d723bcd998f100aa39815c8363f9e /morphlib/builder.py
parent75e12a03d9e623d233656d83764c67bb43ff0f58 (diff)
downloadmorph-4afa01f6711ec07f8f4030d457aff93db73d1f1a.tar.gz
Make morph unpack a stratum's chunks in the right order
This matters when symlinks exist, for example.
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r--morphlib/builder.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py
index 0f2d728e..6f785b49 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -233,7 +233,7 @@ class Stratum(BinaryBlob):
def build(self):
os.mkdir(self.destdir)
- for chunk_name, filename in self.built.iteritems():
+ for chunk_name, filename in self.built:
self.msg('Unpacking chunk %s' % chunk_name)
morphlib.bins.unpack_binary(filename, self.destdir)
self.prepare_binary_metadata(self.morph.name)
@@ -290,7 +290,7 @@ class System(BinaryBlob):
self.ex.runv(['mount', partition, mount_point], as_root=True)
# Unpack all strata into filesystem.
- for name, filename in self.built.iteritems():
+ for name, filename in self.built:
self.msg('unpack %s from %s' % (name, filename))
self.ex.runv(['tar', '-C', mount_point, '-xf', filename],
as_root=True)
@@ -421,12 +421,12 @@ class Builder(object):
return built
def build_needed(self, blob):
- blob.built = {}
+ blob.built = []
for repo, ref, morph_name, blob_names in blob.needs_built():
morph_filename = '%s.morph' % morph_name
cached = self.build(repo, ref, morph_filename)
for blob_name in blob_names:
- blob.built[blob_name] = cached[blob_name]
+ blob.built.append((blob_name, cached[blob_name]))
for blob_name in cached:
morphlib.bins.unpack_binary(cached[blob_name], blob.staging)