[Reproducible-commits] [debhelper] 25/61: dh_strip: Test for --enable-deterministic-archives before using it

Mattia Rizzolo mattia at mapreri.org
Sat Apr 4 18:37:30 UTC 2015


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

mapreri-guest pushed a commit to branch pu/reproducible_builds
in repository debhelper.

commit 16ec72ff6879009208eef8bfded08ed9be587515
Author: Niels Thykier <niels at thykier.net>
Date:   Mon Jan 5 21:45:27 2015 +0100

    dh_strip: Test for --enable-deterministic-archives before using it
    
    Wheezy does not support it, so a lot of derivatives probably do not
    support it either.  While it is questionable that debhelper will be
    backported, it has happened before.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog |  4 ++++
 dh_strip         | 13 +++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8e23034..584197a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -47,6 +47,10 @@ debhelper (9.20150101.1) UNRELEASED; urgency=medium
     symlinks).  Thanks to Joss Mouette for the suggestion.
     (Closes: #549990)
   * autoscripts/post{inst,rm}-makeshlibs-c10: New files.
+  * dh_strip: Pass the --enable-deterministic-archives option to strip
+    when it is stripping static libaries.  This avoids some
+    unnecessary non-determinism in builds.  Based on patch by
+    Andrew Ayer.
 
   [ Bernhard R. Link ]
   * Dh_lib: apply patch from Guillem Jover to support case-insensitive
diff --git a/dh_strip b/dh_strip
index 5d86e04..01bea81 100755
--- a/dh_strip
+++ b/dh_strip
@@ -235,8 +235,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
  		attach_debug($_, $debug_path) if defined $debug_path;
 	}
 
-	foreach (@static_libs) {
-		doit($strip,"--enable-deterministic-archives","--strip-debug",$_);
+	if (@static_libs) {
+		my $strip_help = qx{$strip};
+		my @opts = ('--strip-debug');
+		if (index($strip_help, '--enable-deterministic-archives') > -1) {
+			# NB: The short variant (-D) is broken in Jessie
+			# (binutils/2.25-3)
+			push(@opts, '--enable-deterministic-archives');
+		}
+		foreach (@static_libs) {
+			doit($strip, @opts, $_);
+		}
 	}
 }
 

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



More information about the Reproducible-commits mailing list