diff --git a/debian/bin/genorig.py b/debian/bin/genorig.py index 30a2e75dd..246520940 100755 --- a/debian/bin/genorig.py +++ b/debian/bin/genorig.py @@ -66,7 +66,7 @@ class Main(object): self.log('Using source name %s, version %s, dfsg %s\n' % (source, version.upstream, self.version_dfsg)) self.orig = '%s-%s' % (source, version.upstream) - self.orig_tar = '%s_%s.orig.tar.gz' % (source, version.upstream) + self.orig_tar = '%s_%s.orig.tar.xz' % (source, version.upstream) self.tag = 'v' + re.sub(r"^(\d+\.\d+)\.0", r"\1", version.upstream.replace('~', '-')) @@ -92,7 +92,7 @@ class Main(object): '--prefix=temp/', self.tag], cwd=input_repo, stdout=subprocess.PIPE) - extract_proc = subprocess.Popen(['tar', '-xf', '-'], cwd=self.dir, + extract_proc = subprocess.Popen(['tar', '-xaf', '-'], cwd=self.dir, stdin=archive_proc.stdout) ret1 = archive_proc.wait() @@ -102,15 +102,11 @@ class Main(object): def upstream_extract(self, input_tar): self.log("Extracting tarball %s\n" % input_tar) - match = re.match(r'(^|.*/)(?Plinux-\d+\.\d+(\.\d+)?(-\S+)?)\.tar(\.(?P(bz2|gz)))?$', input_tar) + match = re.match(r'(^|.*/)(?Plinux-\d+\.\d+(\.\d+)?(-\S+)?)\.tar(\.(?P(bz2|gz|xz)))?$', input_tar) if not match: raise RuntimeError("Can't identify name of tarball") - cmdline = ['tar', '-xf', input_tar, '-C', self.dir] - if match.group('extension') == 'bz2': - cmdline.append('-j') - elif match.group('extension') == 'gz': - cmdline.append('-z') + cmdline = ['tar', '-xaf', input_tar, '-C', self.dir] if subprocess.Popen(cmdline).wait(): raise RuntimeError("Can't extract tarball") @@ -119,7 +115,7 @@ class Main(object): def upstream_patch(self, input_patch): self.log("Patching source with %s\n" % input_patch) - match = re.match(r'(^|.*/)patch-\d+\.\d+\.\d+(-\S+?)?(\.(?P(bz2|gz)))?$', input_patch) + match = re.match(r'(^|.*/)patch-\d+\.\d+\.\d+(-\S+?)?(\.(?P(bz2|gz|xz)))?$', input_patch) if not match: raise RuntimeError("Can't identify name of patch") cmdline = [] @@ -127,6 +123,8 @@ class Main(object): cmdline.append('bzcat') elif match.group('extension') == 'gz': cmdline.append('zcat') + elif match.group('extension') == 'xz': + cmdline.append('xzcat') else: cmdline.append('cat') cmdline.append(input_patch) @@ -177,7 +175,7 @@ class Main(object): except OSError: pass self.log("Generate tarball %s\n" % out) - cmdline = ['tar -czf', out, '-C', self.dir, self.orig] + cmdline = ['tar -caf', out, '-C', self.dir, self.orig] try: if os.spawnv(os.P_WAIT, '/bin/sh', ['sh', '-c', ' '.join(cmdline)]): raise RuntimeError("Can't patch source") diff --git a/debian/changelog b/debian/changelog index b2415f384..812cb5699 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +linux-tools (3.5-1~experimental.2) UNRELEASED; urgency=low + + * genorig: Accept xz-compressed upstream tarballs and patches, and + generate an xz-compressed orig tarball, thanks to Sedat Dilek + * source: Enable xz-compression for debian directory tarball + + -- Ben Hutchings Tue, 21 Aug 2012 05:05:42 +0100 + linux-tools (3.5-1~experimental.1) experimental; urgency=low * New upstream release diff --git a/debian/rules b/debian/rules index 28304f75f..3a21ac59f 100755 --- a/debian/rules +++ b/debian/rules @@ -20,7 +20,7 @@ $(STAMPS_DIR): @[ -d $@ ] || mkdir $@ DIR_ORIG = ../orig/$(SOURCE)-$(VERSION) -TAR_ORIG_NAME = $(SOURCE)_$(VERSION).orig.tar.gz +TAR_ORIG_NAME = $(SOURCE)_$(VERSION).orig.tar.xz TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME))) orig: $(DIR_ORIG) @@ -31,7 +31,7 @@ ifeq ($(TAR_ORIG),) $(error Cannot find orig tarball $(TAR_ORIG_NAME)) else mkdir -p ../orig - tar -C ../orig -xzf $(TAR_ORIG) + tar -C ../orig -xaf $(TAR_ORIG) endif maintainerclean: diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 000000000..b7bc1f2b7 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +compression = "xz"