On Tue, Oct 09, 2012 at 11:20:32AM +0100, Daniel Silverstone wrote:
This corrects make-patch to decompress system images as they're
now compressed. Longer-term this should cope with tarball
system images etc.
morphlib/plugins/trebuchet_plugin.py | 90 +++++++++++++++++++++-------------
1 files changed, 56 insertions(+), 34 deletions(-)
diff --git a/morphlib/plugins/trebuchet_plugin.py b/morphlib/plugins/trebuchet_plugin.py
index 6aa0bc1..6976c29 100644
@@ -17,9 +17,60 @@
I like the api of this class, it looks nice to use, but it may be worth
documenting that it's also effectively read-only, since it doesn't write
back any changes made to the mounted disk.
+ '''Mountable image (deals with
+ def __init__(self, app, artifact_path):
+ self.app = app
+ self.artifact_path = artifact_path
+ def setup(self, path):
+ self.app.status(msg='Preparing image %(path)s', path=path)
+ self.app.status(msg=' Decompressing...', chatty=True)
I think if we're going to add indentation to messages, it should be
something systematic across the codebase, but it looks good.
+ (tempfd, self.temp_path) = \
+ outfh = None
I think this definition here isn't needed, outfh isn't used anywhere
except inside the try block.
+ with os.fdopen(tempfd, "wb") as outfh:
+ with gzip.open(path, "rb") as infh:
+ morphlib.util.copyfileobj(infh, outfh)