diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-11-29 14:33:30 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-11-29 14:41:53 +0000 |
commit | 92e3d9d415bf180982046f647230493bdf2b86b5 (patch) | |
tree | 55ba6b9dd51c45689707e795a3e7a29b4907e72e /morphlib/stagingarea.py | |
parent | c58c9cb5de2c24ee8d92e1e711d3a741dd785459 (diff) | |
download | morph-92e3d9d415bf180982046f647230493bdf2b86b5.tar.gz |
Refactor and fix to make it pass (more of) the test suite
Diffstat (limited to 'morphlib/stagingarea.py')
-rw-r--r-- | morphlib/stagingarea.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py index 31fb8410..c8b53bd3 100644 --- a/morphlib/stagingarea.py +++ b/morphlib/stagingarea.py @@ -93,16 +93,20 @@ class StagingArea(object): logging.debug('Installing artifact %s' % getattr(handle, 'name', 'unknown name')) - decompressed_artifact = os.path.join(self._app.settings['cachedir'],'artifacts',os.path.basename(handle.name) + '.d') - if not os.path.exists(decompressed_artifact): - self._mkdir(decompressed_artifact) - morphlib.bins.unpack_binary_from_file(handle, decompressed_artifact + "/") + unpacked_artifact = os.path.join( + self._app.settings['cachedir'], + 'artifacts', + os.path.basename(handle.name) + '.d') + if not os.path.exists(unpacked_artifact): + self._mkdir(unpacked_artifact) + morphlib.bins.unpack_binary_from_file( + handle, unpacked_artifact + '/') if not os.path.exists(self.dirname): self._mkdir(self.dirname) - self._app.runcmd(["cp -al " + decompressed_artifact+"/* " + self.dirname+"/"],shell=True) - + self._app.runcmd( + ['cp', '-al', unpacked_artifact + '/.', self.dirname + '/.']) def remove(self): '''Remove the entire staging area. @@ -115,7 +119,7 @@ class StagingArea(object): shutil.rmtree(self.dirname) - def chroot_open(self, source): + def chroot_open(self, source): # pragma: no cover # After setup, and before it's use as a chroot assert self.builddirname == None and self.destdirname == None @@ -132,7 +136,7 @@ class StagingArea(object): return builddir, destdir - def chroot_close(self): + def chroot_close(self): # pragma: no cover # After it's use as a chroot is complete. pass |