Bug#1065751: Incomplete fix for xz -T1
Hello! I took a look at the patch and attached a small patch fix for it. I hope this helps! Jia Tan From 0f03dce25f174725e80dcd78bfa6ddd640b3714a Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Sun, 10 Mar 2024 22:16:20 +0800 Subject: [PATCH] pristine-xz: Fix -T1 fallback if threads not specified. --- pristine-xz | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pristine-xz b/pristine-xz index 2046578..f3a8eab 100755 --- a/pristine-xz +++ b/pristine-xz @@ -403,7 +403,14 @@ sub genxz { } my @params = split(' ', $delta->{params}); + + # Flag indicating if the threads were set in the params file. If + # the threads were not set, then default back to single threaded + # mode. This is necessary for backwards compatibility with .xz files + # created before XZ Utils 5.6.0, when the default threading mode was + # changed to multi-threading (which produces different output). my $threads_set = 0; + while (@params) { my $param = shift @params; @@ -416,11 +423,12 @@ sub genxz { next if $param eq '--check=crc64'; next if $param eq '--check=sha256'; next if $param =~ /^(--block-list=[0-9,]+)$/; - next if $param =~ /^-T[0-9]+$/; + + # Set $threads_set before checking next argument. if ($param =~ /^-T[0-9]+$/) { - $threads_set = 1; - next; - } +$threads_set = 1; +next; + } } elsif ($delta->{program} eq 'pixz') { next if $param eq '-t'; } -- 2.34.1
Bug#1065751: Incomplete fix for xz -T1
This issue also affects being able to use git-buildpackage to generate pristine-tar tarballs for tarballs that were already committed before the recent changes to pristine-tar. For instance I experienced it today with `gbp buildpackage` with gtk4 but the original tarball was committed in January. Ideally, we would not need to attempt to reconstruct old pristine-tar git branches since that sounds like a very large amount of work and it's disruptive to everyone who has local copies of the git repos. Thank you, Jeremy Bícha
Bug#1065751: Incomplete fix for xz -T1
On Sun, Mar 10, 2024 at 12:34:00AM +0500, Andrey Rahmatullin wrote: > It looks like #1063252 was not enough to support tar.xz files created by new > xz-utils. I've created a tarball, committed it into my gbp repo, checked it > out > and xz -lvv doesn't show the cu flags for it (and so it's not identical to the > original one). A workaround for this is to reset the pristine-tar branch, deleting the committed cu flags tarball and commit the -- flags one (that you just checked out) manually. -- WBR, wRAR signature.asc Description: PGP signature
Bug#1065751: Incomplete fix for xz -T1
Package: pristine-tar Version: 1.50+nmu1 Severity: serious X-Debbugs-Cc: Sebastian Andrzej Siewior It looks like #1063252 was not enough to support tar.xz files created by new xz-utils. I've created a tarball, committed it into my gbp repo, checked it out and xz -lvv doesn't show the cu flags for it (and so it's not identical to the original one). As making a minimal example involving git sounds too complicated I tried to make a minimal example with raw commands, hopefully I did that correctly: $ mkdir 1 $ echo foo > 1/bar $ tar cJf 1.tar.xz 1 $ xz -lvv 1.tar.xz [...] Flags cu [...] $ pristine-tar gendelta 1.tar.xz 1.tar.xz.delta $ cd 1 $ pristine-tar gentar ../1.tar.xz.delta ../2.tar.xz $ xz -lvv ../2.tar.xz [...] Flags -- [...] -- System Information: Debian Release: trixie/sid APT prefers unstable-debug APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'unstable'), (500, 'testing'), (101, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 6.7.7-amd64 (SMP w/4 CPU threads; PREEMPT) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages pristine-tar depends on: ii bzip21.0.8-5+b2 ii libbz2-1.0 1.0.8-5+b2 ii libc62.37-15.1 ii libsys-cpuaffinity-perl 1.13~03-2+b3 ii pbzip2 1.1.13-1 ii perl 5.38.2-3.2 ii pixz 1.0.7-2 ii tar 1.35+dfsg-3 ii xdelta 1.1.3-10.6 ii xdelta3 3.0.11-dfsg-1.2 ii xz-utils 5.6.0-0.2 ii zlib1g 1:1.3.dfsg-3.1 pristine-tar recommends no packages. pristine-tar suggests no packages. -- debconf-show failed