diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-05-07 16:08:22 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-05-08 09:28:39 +0000 |
commit | 4cef8436cf3f38e2927950c495fc860175bb724a (patch) | |
tree | 9932fa9fd631b75d8420eceb4f5cd3d936cbfd2d | |
parent | 8a52526219c4ba07eec0ba83566fa8e5a5debd88 (diff) | |
download | morph-4cef8436cf3f38e2927950c495fc860175bb724a.tar.gz |
Bring code path for system artifact creation to join with that for chunk artifacts
-rw-r--r-- | morphlib/bins.py | 10 |
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. |