[Reproducible-commits] [debhelper] 05/07: dh_strip: make stripping static libraries deterministic

Andrew Ayer agwa at andrewayer.name
Thu Sep 25 17:52:11 UTC 2014


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

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

commit e1e64ce2bd25b1a78d013ac7a99edbb65b165f19
Author: Andrew Ayer <agwa at andrewayer.name>
Date:   Thu Sep 25 10:07:41 2014 -0700

    dh_strip: make stripping static libraries deterministic
    
    Previously, calling strip on a static library would reset the timestamp
    of every file in the archive to the current time, and reset the permissions
    of every file based on the umask.
    
    Now, existing timestamps are preserved by passing --preserve-dates to
    strip, and permissions are kept deterministic by setting a umask of 0022
    when calling strip.
---
 dh_strip | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dh_strip b/dh_strip
index 516b6f2..9e84aa8 100755
--- a/dh_strip
+++ b/dh_strip
@@ -234,9 +234,13 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
  		attach_debug($_, $debug_path) if defined $debug_path;
 	}
 
+	# strip uses the umask to determine permissions of files inside the .a file.
+	# Set a umask of 0022 so builds are deterministic.
+	my $orig_umask=umask 0022;
 	foreach (@static_libs) {
-		doit($strip,"--strip-debug",$_);
+		doit($strip,"--preserve-dates","--strip-debug",$_);
 	}
+	umask $orig_umask;
 }
 
 =head1 SEE ALSO

-- 
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