aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2007-05-13 18:31:35 +0200
committerGuido Guenther <agx@bogon.sigxcpu.org>2007-05-13 18:31:35 +0200
commita786091d4b1d8140013348c43e295d61929e5566 (patch)
treea7ea4b9b7c53bf73cb8a7b5528997392303ea67b /gbp
parent3aeb7de285db15d3fdd804e5e3599e06e9d75983 (diff)
support import of tar.bz2 in git-import-orig
Diffstat (limited to 'gbp')
-rw-r--r--gbp/command_wrappers.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py
index b1fbfdfb..a08470a8 100644
--- a/gbp/command_wrappers.py
+++ b/gbp/command_wrappers.py
@@ -52,13 +52,17 @@ class Command(object):
raise CommandExecFailed
-class UnpackTGZ(Command):
+class UnpackTarArchive(Command):
"""Wrap tar to Unpack a gzipped tar archive"""
- def __init__(self, tgz, dir):
- self.tgz = tgz
+ def __init__(self, archive, dir):
+ self.archive = archive
self.dir = dir
- Command.__init__(self, 'tar', [ '-C', dir, '-zxf', tgz ])
- self.run_error = "Couldn't unpack %s" % self.tgz
+ if archive.lower().endswith(".bz2"):
+ decompress = "--bzip2"
+ else:
+ decompress = "--gzip"
+ Command.__init__(self, 'tar', [ '-C', dir, decompress, '-xf', archive ])
+ self.run_error = "Couldn't unpack %s" % self.archive
class RemoveTree(Command):