FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 08-20-2012, 04:40 PM
Sedat Dilek
 
Default linux-tools: Add xz support

This patch supports xz-compressed upstream (vanilla) tarball source
to generate an xz-compressed linux-tools orig-tarball.

Furthermore, patches are now allowed in xz-format, too.

As suggested by Ben I have replaced all occurences of tar with "-a"
option for compressing/decompressing tarballs.

>From man tar(1):

-a, --auto-compress
use archive suffix to determine the compression program

After applying this patch, follow these instructions (here: Linux-v3.5):

$ cd linux-tools/
$ make -f debian/rules debian/control-real
$ ./debian/bin/genorig.py /path/to/linux-3.5.tar.xz
$ fakeroot debian/rules orig
$ debuild

Tested against linux-tools SVN trunk revision 19348.

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
debian/bin/genorig.py | 18 ++++++++----------
debian/rules | 4 ++--
2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/debian/bin/genorig.py b/debian/bin/genorig.py
index 30a2e75..2465209 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
' % (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
" % input_tar)
- match = re.match(r'(^|.*/)(?P<dir>linux-d+.d+(.d+)?(-S+)?).tar(.(?P<extension>(bz2|gz)))?$', input_tar)
+ match = re.match(r'(^|.*/)(?P<dir>linux-d+.d+(.d+)?(-S+)?).tar(.(?P<extension>(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
" % input_patch)
- match = re.match(r'(^|.*/)patch-d+.d+.d+(-S+?)?(.(?P<extension>(bz2|gz)))?$', input_patch)
+ match = re.match(r'(^|.*/)patch-d+.d+.d+(-S+?)?(.(?P<extension>(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
" % 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/rules b/debian/rules
index 28304f7..3a21ac5 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:
--
1.7.10.4


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1345480843-24447-1-git-send-email-sedat.dilek@gmail.com">http://lists.debian.org/1345480843-24447-1-git-send-email-sedat.dilek@gmail.com
 
Old 08-21-2012, 04:53 AM
Ben Hutchings
 
Default linux-tools: Add xz support

On Mon, 2012-08-20 at 18:40 +0200, Sedat Dilek wrote:
> This patch supports xz-compressed upstream (vanilla) tarball source
> to generate an xz-compressed linux-tools orig-tarball.
>
> Furthermore, patches are now allowed in xz-format, too.
>
> As suggested by Ben I have replaced all occurences of tar with "-a"
> option for compressing/decompressing tarballs.
>
> From man tar(1):
>
> -a, --auto-compress
> use archive suffix to determine the compression program
>
> After applying this patch, follow these instructions (here: Linux-v3.5):
>
> $ cd linux-tools/
> $ make -f debian/rules debian/control-real
> $ ./debian/bin/genorig.py /path/to/linux-3.5.tar.xz
> $ fakeroot debian/rules orig
> $ debuild
>
> Tested against linux-tools SVN trunk revision 19348.
[...]

Applied, thanks. I also enabled xz-compression of the debian directory
tarball. Note that binary packages are still gzip-compressed, though
they're small enough that this doesn't seem particularly worth changing.

genorig in the linux source package is also missing upstream xz support.
The two scripts are really very similar but have diverged a little...

Ben.

--
Ben Hutchings
The most exhausting thing in life is being insincere. - Anne Morrow Lindberg
 

Thread Tools




All times are GMT. The time now is 07:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org