diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-02-28 14:18:53 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-02-28 14:18:53 +0000 |
commit | 01dabc7668702c6930b90b2136998cb12e1dc1fd (patch) | |
tree | 921494afe02b28e84b87183d2e473b09591c7f7e /morph | |
parent | dadb4f295c51e3fbb29886cccab5a6beceabe60b (diff) | |
download | morph-01dabc7668702c6930b90b2136998cb12e1dc1fd.tar.gz |
Use Tempdir.remove instead of rm, and drop unused Tempdir.clear
If the remove method is insufficient (because it gets run as non-root,
but some of the stuff needs root to remove them), then we need to fix
the method, not replace it with other things.
The Tempdir.clear method was not used anywhere, so YAGNI and removed it.
Diffstat (limited to 'morph')
-rwxr-xr-x | morph | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -145,9 +145,7 @@ class Morph(cliapp.Application): # build things in this order ret.append(builder.build(blobs, order)) - # we may not have permission to tempdir.remove() - ex = morphlib.execute.Execute('.', lambda msg: None) - ex.runv(["rm", "-rf", tempdir.dirname]) + tempdir.remove() if args: raise cliapp.AppException('Extra args on command line: %s' % args) @@ -285,9 +283,7 @@ class Morph(cliapp.Application): self.msg('Building %s' % first_blob) ret.append(builder.build_single(first_blob, blobs, order)) - # we may not have permission to tempdir.remove() - ex = morphlib.execute.Execute('.', lambda msg: None) - ex.runv(["rm", "-rf", tempdir.dirname]) + tempdir.remove() if args: raise cliapp.AppException('Extra args on command line: %s' % args) @@ -355,9 +351,7 @@ class Morph(cliapp.Application): # build the tuple and all its dependencies result.append(controller.build(blobs, order)) - # we may not have permission to tempdir.remove() - ex = morphlib.execute.Execute('.', lambda msg: None) - ex.runv(["rm", "-rf", tempdir.dirname]) + tempdir.remove() if args: raise cliapp.AppException('Extra args on command line: %s' % args) |