[Reproducible-commits] [strip-nondeterminism] 01/02: Disable stripping Mono binaries as it is too aggressive re. StrongName, preventing package installs in a systemwide location (Closes: #804600)

Chris Lamb lamby at moszumanska.debian.org
Tue Nov 10 00:06:00 UTC 2015


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

lamby pushed a commit to branch master
in repository strip-nondeterminism.

commit 44a231526a4246cf895a97de0b5480b9383d6ea2
Author: Chris Lamb <lamby at debian.org>
Date:   Tue Nov 10 00:03:22 2015 +0000

    Disable stripping Mono binaries as it is too aggressive re. StrongName, preventing package installs in a systemwide location (Closes: #804600)
---
 lib/File/StripNondeterminism.pm             |  6 ----
 lib/File/StripNondeterminism/handlers/pe.pm | 52 -----------------------------
 2 files changed, 58 deletions(-)

diff --git a/lib/File/StripNondeterminism.pm b/lib/File/StripNondeterminism.pm
index 555f1a7..1ba6cb2 100644
--- a/lib/File/StripNondeterminism.pm
+++ b/lib/File/StripNondeterminism.pm
@@ -25,7 +25,6 @@ use File::StripNondeterminism::handlers::ar;
 use File::StripNondeterminism::handlers::gzip;
 use File::StripNondeterminism::handlers::jar;
 use File::StripNondeterminism::handlers::javadoc;
-use File::StripNondeterminism::handlers::pe;
 use File::StripNondeterminism::handlers::pearregistry;
 use File::StripNondeterminism::handlers::png;
 use File::StripNondeterminism::handlers::javaproperties;
@@ -70,10 +69,6 @@ sub get_normalizer_for_file {
 	if (m/\.reg$/ && File::StripNondeterminism::handlers::pearregistry::is_registry_file($_)) {
 		return \&File::StripNondeterminism::handlers::pearregistry::normalize;
 	}
-	# PE executables
-	if (m/\.(exe|dll|cpl|ocx|sys|scr|drv|efi|fon)/ && _get_file_type($_) =~ m/PE32.? executable/) {
-		return \&File::StripNondeterminism::handlers::pe::normalize;
-	}
 	# PNG
 	if (m/\.png$/ && _get_file_type($_) =~ m/PNG image data/) {
 		return \&File::StripNondeterminism::handlers::png::normalize;
@@ -95,7 +90,6 @@ sub get_normalizer_by_name {
 	return \&File::StripNondeterminism::handlers::gzip::normalize if $_ eq 'gzip';
 	return \&File::StripNondeterminism::handlers::jar::normalize if $_ eq 'jar';
 	return \&File::StripNondeterminism::handlers::javadoc::normalize if $_ eq 'javadoc';
-	return \&File::StripNondeterminism::handlers::pe::normalize if $_ eq 'pe';
 	return \&File::StripNondeterminism::handlers::pearregistry::normalize if $_ eq 'pearregistry';
 	return \&File::StripNondeterminism::handlers::png::normalize if $_ eq 'png';
 	return \&File::StripNondeterminism::handlers::javaproperties::normalize if $_ eq 'javaproperties';
diff --git a/lib/File/StripNondeterminism/handlers/pe.pm b/lib/File/StripNondeterminism/handlers/pe.pm
deleted file mode 100644
index 789c740..0000000
--- a/lib/File/StripNondeterminism/handlers/pe.pm
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright 2014 Chris West (Faux)
-#
-# This file is part of strip-nondeterminism.
-#
-# strip-nondeterminism is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# strip-nondeterminism is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with strip-nondeterminism.  If not, see <http://www.gnu.org/licenses/>.
-#
-package File::StripNondeterminism::handlers::pe;
-
-use strict;
-use warnings;
-
-use Fcntl ":seek";
-
-sub normalize {
-	my ($filename) = @_;
-	open(my $f, "+<", $filename) or die("couldn't open $filename: $!");
-	binmode($f);
-	read($f, my $mx, 2) or die("couldn't try to read initial header: $!");
-	return if ($mx ne 'MZ');
-
-	seek($f, 0x3A, SEEK_CUR) or die("couldn't jump to e_lfanew location: $!");
-	read($f, my $encoded_off, 4) or die("couldn't read e_lfanew field: $!");
-	my $off = unpack("V", $encoded_off);
-	seek($f, $off, SEEK_SET) or die("couldn't seek to start of PE section: $!");
-
-	read($f, my $pe, 2) or die("couldn't read PE header: $!");
-	return if $pe ne 'PE';
-
-	seek($f, 2+2+2, SEEK_CUR) or die("couldn't skip mMachine and mNumberOfSections: $!");
-	read($f, my $encoded_time, 4) or die("couldn't read timestamp: $!");
-	my $time = unpack("V", $encoded_time);
-
-	$encoded_time = pack("V", $File::StripNondeterminism::canonical_time // 0);
-
-	seek($f, -4, SEEK_CUR) or die("impossibly couldn't seek to where we were before: $!");
-	print $f $encoded_time;
-	close($f) or die("couldn't close file: $!");
-}
-
-1;

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



More information about the Reproducible-commits mailing list