[dpkg] 106/187: Dpkg::Compression: Only use gzip --rsyncable on Debian and derivatives

Reiner Herrmann reiner at reiner-h.de
Sun Nov 6 12:46:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch master
in repository dpkg.

commit 33e6fcb5cd9b478e1646b50d247c233edcbd0088
Author: Guillem Jover <guillem at debian.org>
Date:   Thu Aug 25 00:20:52 2016 +0200

    Dpkg::Compression: Only use gzip --rsyncable on Debian and derivatives
    
    The gzip package in Debian at some point acquired a Debian-specific
    --rsyncable option via a vendor patch. Which is not present in most
    of the major distributions, dpkg downstream systems, nor gzip upstream,
    who have stated they will most probably not accept it because people
    should be using pigz instead.
    
    This option should have never been accepted in dpkg, ever. But removing
    it now would probably cause demands for tarring and feathering. In
    addition we cannot use the Dpkg::Vendor logic because that would cause
    circular module dependencies. The whole affair is pretty disgusting
    really.
    
    Check the perl Config to discern Debian and hopefully derivatives too.
---
 debian/changelog            |  4 ++++
 scripts/Dpkg/Compression.pm | 21 ++++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index bceb093..cdd61a4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -47,6 +47,10 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     - Port start-stop-daemon process handling to AIX.
     - Fix lookup by name on update-alternatives --config. The code was wrong
       and not working at least on Mac OS X, making the test suite to fail.
+    - Only use gzip --rsyncable in Dpkg::Compression on Debian and hopefully
+      derivatives, by using perl's $Config{cf_by} variable to key on. The
+      Debian-specific --rsyncable option should have never been accepted for
+      use in dpkg to begin with.
   * Perl modules:
     - Obsolete Source-Version substvar in Dpkg::Substvars by emitting errors.
     - Rework keyring hooks in Dpkg::Vendor. Deprecate the keyrings hook, and
diff --git a/scripts/Dpkg/Compression.pm b/scripts/Dpkg/Compression.pm
index 31f5ad8..3dbc4ad 100644
--- a/scripts/Dpkg/Compression.pm
+++ b/scripts/Dpkg/Compression.pm
@@ -35,6 +35,7 @@ our @EXPORT = qw(
 );
 
 use Exporter qw(import);
+use Config;
 
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
@@ -55,7 +56,7 @@ interact with the set of supported compression methods.
 my $COMP = {
     gzip => {
 	file_ext => 'gz',
-	comp_prog => [ 'gzip', '--no-name', '--rsyncable' ],
+	comp_prog => [ 'gzip', '--no-name' ],
 	decomp_prog => [ 'gunzip' ],
 	default_level => 9,
     },
@@ -79,6 +80,24 @@ my $COMP = {
     },
 };
 
+#
+# XXX: The gzip package in Debian at some point acquired a Debian-specific
+# --rsyncable option via a vendor patch. Which is not present in most of the
+# major distributions, dpkg downstream systems, nor gzip upstream, who have
+# stated they will most probably not accept it because people should be using
+# pigz instead.
+#
+# This option should have never been accepted in dpkg, ever. But removing it
+# now would probably cause demands for tarring and feathering. In addition
+# we cannot use the Dpkg::Vendor logic because that would cause circular
+# module dependencies. The whole affair is pretty disgusting really.
+#
+# Check the perl Config to discern Debian and hopefully derivatives too.
+#
+if ($Config{cf_by} eq 'Debian Project') {
+    push @{$COMP->{gzip}->{comp_prog}}, '--rsyncable';
+}
+
 # XXX: Backwards compatibility, stop exporting on VERSION 2.00.
 ## no critic (Variables::ProhibitPackageVars)
 our $default_compression = 'xz';

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list