summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-05-07 16:08:22 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-05-08 09:28:39 +0000
commit4cef8436cf3f38e2927950c495fc860175bb724a (patch)
tree9932fa9fd631b75d8420eceb4f5cd3d936cbfd2d
parent8a52526219c4ba07eec0ba83566fa8e5a5debd88 (diff)
downloadmorph-4cef8436cf3f38e2927950c495fc860175bb724a.tar.gz
Bring code path for system artifact creation to join with that for chunk artifacts
-rw-r--r--morphlib/bins.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/morphlib/bins.py b/morphlib/bins.py
index 23e3b812..d1a90657 100644
--- a/morphlib/bins.py
+++ b/morphlib/bins.py
@@ -91,6 +91,16 @@ def create_chunk(rootdir, f, include, dump_memory_profile=None):
dump_memory_profile('after removing in create_chunks')
+def create_system(rootdir, f, name=None, filter=None):
+ '''Create a system artifact from the contents of a directory.
+
+ '''
+
+ tar = tarfile.open(fileobj=f, mode="w", name=name)
+ tar.add(rootdir, recursive=True, filter=filter)
+ tar.close()
+
+
def unpack_binary_from_file(f, dirname): # pragma: no cover
'''Unpack a binary into a directory.