From 32eeb200e24676ec111d62fb7457d486a673e905 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 3 Nov 2011 18:50:23 +0000 Subject: Combine unpack_chunk and unpack_stratum into unpack_binary --- morphlib/bins.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'morphlib/bins.py') 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() -- cgit v1.2.1