From 7bd0212869917b0aa32455764b9b763f8e0d64e1 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 14 Jun 2012 10:31:12 +0000 Subject: morphlib.bins: remove create_stratum create_stratum is no longer used, since strata are now chunk lists --- morphlib/bins.py | 8 -------- morphlib/bins_tests.py | 27 --------------------------- 2 files changed, 35 deletions(-) diff --git a/morphlib/bins.py b/morphlib/bins.py index 93aa7b15..0c9ecadf 100644 --- a/morphlib/bins.py +++ b/morphlib/bins.py @@ -95,14 +95,6 @@ def create_chunk(rootdir, f, regexps, dump_memory_profile=None): dump_memory_profile('after removing in create_chunks') -def create_stratum(rootdir, f): - '''Create a stratum from the contents of a directory.''' - logging.debug('Creating stratum file %s from %s' % (f.name, rootdir)) - tar = tarfile.open(fileobj=f, mode='w:gz') - tar.add(rootdir, arcname='.') - tar.close() - - def unpack_binary_from_file(f, dirname): # pragma: no cover '''Unpack a binary into a directory. diff --git a/morphlib/bins_tests.py b/morphlib/bins_tests.py index 2da5d047..544e9013 100644 --- a/morphlib/bins_tests.py +++ b/morphlib/bins_tests.py @@ -132,30 +132,3 @@ class ChunkTests(BinsTest): self.assertEqual([x for x,y in self.recursive_lstat(self.instdir)], ['.', 'lib', 'lib/libfoo.so']) - -class StratumTests(BinsTest): - - def setUp(self): - self.tempdir = tempfile.mkdtemp() - self.instdir = os.path.join(self.tempdir, 'inst') - self.stratum_file = os.path.join(self.tempdir, 'stratum') - self.stratum_f = open(self.stratum_file, 'wb') - self.unpacked = os.path.join(self.tempdir, 'unpacked') - - def tearDown(self): - self.stratum_f.close() - shutil.rmtree(self.tempdir) - - def populate_instdir(self): - os.mkdir(self.instdir) - os.mkdir(os.path.join(self.instdir, 'bin')) - - def test_creates_and_unpacks_stratum_exactly(self): - self.populate_instdir() - morphlib.bins.create_stratum(self.instdir, self.stratum_f) - self.stratum_f.flush() - os.mkdir(self.unpacked) - morphlib.bins.unpack_binary(self.stratum_file, self.unpacked) - self.assertEqual(self.recursive_lstat(self.instdir), - self.recursive_lstat(self.unpacked)) - -- cgit v1.2.1