[debhelper-devel] [debhelper] 03/07: dh_builddeb: Use explicit -Z arg for ddebs to avoid FTBFS

Niels Thykier nthykier at moszumanska.debian.org
Sat May 2 09:51:12 UTC 2015


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

nthykier pushed a commit to annotated tag 9.20150502+ddebs
in repository debhelper.

commit 43a1fdbb42ee7b0b6a539715595c8017babe2486
Author: Niels Thykier <niels at thykier.net>
Date:   Sat Apr 11 05:01:59 2015 +0200

    dh_builddeb: Use explicit -Z arg for ddebs to avoid FTBFS
    
    When maintainer passes (e.g.) -Zgzip to dpkg-deb via dh_builddeb, then
    we cannot pass that AND -Sextreme to dpkg-deb as gzip does not support
    the "extreme" compression strategy.  For now, simply use the
    compression parameters given by the maintainer for the .ddeb as well.
    
    It is not clear to me that this is truly the best long term solution.
    The maintainer probably only wanted the -Z to apply for the actual deb
    and not the ddeb.
    
    Reported-by: Reiner Herrmann <reiner at reiner-h.de>
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_builddeb | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/dh_builddeb b/dh_builddeb
index cf51b19..c827f2f 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -80,6 +80,17 @@ sub reap {
 	}
 }
 
+sub default_compressor_args {
+	my ($default_comp, @args) = @_;
+
+	for my $arg (@args) {
+		# Explicit compressor arg given
+		return @args if $arg =~ m/^-Z/;
+	}
+
+	return (@{$default_comp}, @args);
+}
+
 foreach my $package (@{$dh{DOPACKAGES}}) {
 	my $pid=fork();
 	if (! defined $pid) {
@@ -107,11 +118,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	}
 	if ( -d $ddeb_tmpdir) {
 		my $ddeb_filename = '/' . ddeb_filename($package);
-		doit("dpkg-deb", "-z1", "-Zxz", "-Sextreme",
-			 @{$dh{U_PARAMS}}, "--build", $ddeb_tmpdir, $dh{DESTDIR}.$ddeb_filename);
+		# XXX: Should we blindly overrule the maintainer here?  It is
+		# not apparent that their explicit -z was intended for the
+		# ddeb.
+		my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"],
+										   @{$dh{U_PARAMS}});
+		doit("dpkg-deb", @args,
+			 "--build", $ddeb_tmpdir, $dh{DESTDIR}.$ddeb_filename);
 	}
 	if (! is_udeb($package)) {
-
 		doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
 	}
 	else {

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




More information about the debhelper-devel mailing list