Control: tags -1 patch

On Thu, 26 Oct 2017 16:37:00 +0200 Gaudenz Steinlin <gaud...@debian.org
> wrote:
> Package: pristine-tar
> Version: 1.42
> Followup-For: Bug #869191
> 
> I have the same problem with iproute2:
> 
> gaudenz@moebius:~/tmp$ debcheckout --git-track '*' iproute2
> declared git repository at https://anonscm.debian.org/git/collab-main
t/pkg-iproute.git
> git clone https://anonscm.debian.org/git/collab-maint/pkg-iproute.git
 iproute2 ...
> Cloning into 'iproute2'...
> remote: Counting objects: 19205, done.
> remote: Compressing objects: 100% (5946/5946), done.
> remote: Total 19205 (delta 14280), reused 17772 (delta 12994)
> Receiving objects: 100% (19205/19205), 4.20 MiB | 4.83 MiB/s, done.
> Resolving deltas: 100% (14280/14280), done.
> Branch pristine-tar set up to track remote branch pristine-tar from
origin.
> Branch upstream set up to track remote branch upstream from origin.
> gaudenz@moebius:~/tmp$ cd iproute2/
> gaudenz@moebius:~/tmp/iproute2$ git remote add upstream https://git.k
ernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
> gaudenz@moebius:~/tmp/iproute2$ git fetch upstream
> remote: Counting objects: 1505, done.
> remote: Compressing objects: 100% (707/707), done.
> remote: Total 1505 (delta 965), reused 1144 (delta 787)
> Receiving objects: 100% (1505/1505), 924.28 KiB | 5.96 MiB/s, done.
> Resolving deltas: 100% (965/965), done.
> From https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iprou
te2
>  * [new branch]        flag-names     -> upstream/flag-names
>  * [new branch]        iproute2-4.1.x -> upstream/iproute2-4.1.x
>  * [new branch]        master         -> upstream/master
>  * [new branch]        net-next       -> upstream/net-next
>  * [new tag]           v4.13.0        -> v4.13.0
> gaudenz@moebius:~/tmp/iproute2$ gbp import-orig --uscan
> gbp:info: Launching uscan...
> uscan: Newest version of iproute2 on remote site is 4.13.0, local
version is 4.9.0
> uscan:    => Newer package available from
>       http://kernel.org/pub/linux/utils/net/iproute2/iproute2-4.13.0.
tar.xz
> gpgv: Signature made Die 05 Sep 2017 18:39:32 CEST
> gpgv:                using RSA key
9F6FC345B05BE7E766B83C8F80A77F6095CDE47E
> gpgv: Good signature from "Stephen Hemminger (Microsoft corporate) <s
them...@microsoft.com>"
> gpgv:                 aka "Stephen Hemminger <shemmin...@vyatta.com>"
> gpgv:                 aka "Stephen Hemminger <stephen@networkplumber.
org>"
> gpgv:                 aka "Stephen Hemminger <stephen.hemminger@gmail
.com>"
> gpgv:                 aka "Stephen Hemminger <stephen.hemminger@vyatt
a.com>"
> gpgv:                 aka "Stephen Hemminger (Microsoft open source
server) <sthem...@linuxonhyperv.com>"
> gpgv:                 aka "[invalid image]"
> gbp:info: Using uscan downloaded tarball
../iproute2_4.13.0.orig.tar.xz
> What is the upstream version? [4.13.0] 
> gbp:info: Importing '../iproute2_4.13.0.orig.tar.xz' to branch
'upstream'...
> gbp:info: Source package is iproute2
> gbp:info: Upstream version is 4.13.0
> gbp:error: Import of ../iproute2_4.13.0.orig.tar.xz failed: Couldn't
commit to 'pristine-tar' with upstream
'5ff19684ca409e7f15535de9f9e2688cf2c5d936': pristine-xz failed to
reproduce build of ../iproute2_4.13.0.orig.tar.xz
> (Please file a bug report.)
> pristine-tar: failed to generate delta
> gbp:error: Error detected, Will roll back changes.
> gbp:info: Rolling back branch upstream by resetting it to
22abf4c1e38534ec6ca01a866a9f24f8b13d0e5c
> gbp:info: Rolling back branch pristine-tar by resetting it to
1cfabbd88ca05224e084e384a48080556e1e871c
> gbp:error: Rolled back changes after import error.

So I've asked someone from kernel.org how they generate the xz
tarballs, and the answer is that they use:

pixz -9 -p6 -t

Lo and behold, adding a dirty hack (TM) to pristine-xz to also try -T6
fixes the problem! At least with iproute2 now checking in and out the
tarball reproduces the same hashsum.

The attached patch is very hacky and specific to kernel.org, but at
least it doesn't break other use cases (I hope :-) ). IMHO kernel.org
is important enough to warrant a hacky workaround, unless a better and
safer solution can be found of course. But it's up to the mantainer of
course.

-- 
Kind regards,
Luca Boccassi


From 8df0a3dae10f8c7a2932ccd875a4ebae2d017ffd Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.bocca...@gmail.com>
Date: Sun, 31 Dec 2017 13:28:51 +0100
Subject: [PATCH] Hack: add -T6 to possible_args for kernel.org xz

kernel.org tarballs, such as iproute2, util-linux, the linux kernel and
more, are compressed with the following command:

pixz -9 -p6 -t

pristine-xz is unable to detect and reproduce those tarballs.

Add a hacky workaround, by trying -T6 as one of the possible compression
parameters.
---
 pristine-xz | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pristine-xz b/pristine-xz
index 10b451f..351d90f 100755
--- a/pristine-xz
+++ b/pristine-xz
@@ -237,6 +237,10 @@ sub predict_xz_args {
     }
     push @$possible_args, [ @$common, "-$preset" ];
     push @$possible_args, [ @$common, "-${preset}e" ];
+    # kernel.org hacky workaround - they use pixz -9 -p6 -t to create
+    # the tarballs, see #869191
+    push @$possible_args, [ @$common, "-T6", "-$preset" ];
+    push @$possible_args, [ @$common, "-T6", "-${preset}e" ];
   }
   return $possible_args;
 }
@@ -369,6 +373,7 @@ sub genxz {
     next if $param eq '--check=sha256';
     next if $param =~ /^(--block-list=[0-9,]+)$/;
     next if $param eq '-T2';
+    next if $param eq '-T6';
     die "paranoia check failed on params from delta ($param)";
   }
   @params = split(' ', $delta->{params});
-- 
2.14.2

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to