summaryrefslogtreecommitdiff
path: root/morphlib/bins.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-03 18:50:23 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-03 18:50:23 +0000
commit32eeb200e24676ec111d62fb7457d486a673e905 (patch)
tree9cedbde73716fc4a74d59e328d40a0c10dec28ad /morphlib/bins.py
parentf971aa9158fb9b076c0cdcc21ffa591c5d7d0074 (diff)
downloadmorph-32eeb200e24676ec111d62fb7457d486a673e905.tar.gz
Combine unpack_chunk and unpack_stratum into unpack_binary
Diffstat (limited to 'morphlib/bins.py')
-rw-r--r--morphlib/bins.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/morphlib/bins.py b/morphlib/bins.py
index 3381bc28..24a8b1f0 100644
--- a/morphlib/bins.py
+++ b/morphlib/bins.py
@@ -85,19 +85,6 @@ def create_chunk(rootdir, chunk_filename, regexps):
os.remove(filename)
-def unpack_chunk(chunk_filename, dirname):
- '''Unpack a chunk into a directory.
-
- The directory must exist already.
-
- '''
-
- logging.debug('Unpacking chunk %s into %s' % (chunk_filename, dirname))
- tar = tarfile.open(name=chunk_filename)
- tar.extractall(path=dirname)
- tar.close()
-
-
def create_stratum(rootdir, stratum_filename):
'''Create a stratum from the contents of a directory.'''
logging.debug('Creating stratum file %s from %s' %
@@ -107,15 +94,15 @@ def create_stratum(rootdir, stratum_filename):
tar.close()
-def unpack_stratum(stratum_filename, dirname):
- '''Unpack a stratum into a directory.
+def unpack_binary(filename, dirname):
+ '''Unpack a binary into a directory.
The directory must exist already.
'''
- logging.debug('Unpacking stratum %s into %s' % (stratum_filename, dirname))
- tar = tarfile.open(name=stratum_filename)
+ logging.debug('Unpacking %s into %s' % (filename, dirname))
+ tar = tarfile.open(name=filename)
tar.extractall(path=dirname)
tar.close()