[libfile-scan-perl] 01/11: Add patches from Niko Tyno to make build reproducible.

gregor herrmann gregoa at debian.org
Mon Jun 15 20:02:57 UTC 2015


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

gregoa pushed a commit to branch master
in repository libfile-scan-perl.

commit bd81bfeb803ea179945a8e0b576634e597909f2a
Author: gregor herrmann <gregoa at debian.org>
Date:   Mon Jun 15 21:20:36 2015 +0200

    Add patches from Niko Tyno to make build reproducible.
    
    Closes: #788122
---
 ...on-t-put-a-timestamp-in-generated-Scan.pm.patch | 32 ++++++++
 ...an.pm-generation-reproducible-by-sorting-.patch | 93 ++++++++++++++++++++++
 debian/patches/series                              |  2 +
 3 files changed, 127 insertions(+)

diff --git a/debian/patches/0001-Don-t-put-a-timestamp-in-generated-Scan.pm.patch b/debian/patches/0001-Don-t-put-a-timestamp-in-generated-Scan.pm.patch
new file mode 100644
index 0000000..a0ef77e
--- /dev/null
+++ b/debian/patches/0001-Don-t-put-a-timestamp-in-generated-Scan.pm.patch
@@ -0,0 +1,32 @@
+From 7a16ea0eef83cfee6db7cdeee2ca0afdec6effe7 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at debian.org>
+Date: Mon, 8 Jun 2015 22:55:27 +0300
+Subject: [PATCH 1/2] Don't put a timestamp in generated Scan.pm
+
+This is done to make the build reproducible.
+
+Bug-Debian: https://bugs.debian.org/788122
+Bug: https://rt.cpan.org/Ticket/Display.html?id=105248
+Forwarded: https://rt.cpan.org/Ticket/Display.html?id=105248
+---
+ Makefile.PL | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index dadcfd6..a8cc8b5 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -164,9 +164,8 @@ sub make_module {
+ sub get_code {
+ 	my $patterns = shift;
+ 
+-	my $today = &string_date();
+ 	my $code = <<ENDOFCODE1;
+-# generated in: $today
++# generated data follows
+ 
+ sub get_app_sign {
+ 	\$_ = pop;
+-- 
+2.1.4
+
diff --git a/debian/patches/0002-Make-the-Scan.pm-generation-reproducible-by-sorting-.patch b/debian/patches/0002-Make-the-Scan.pm-generation-reproducible-by-sorting-.patch
new file mode 100644
index 0000000..f2a1464
--- /dev/null
+++ b/debian/patches/0002-Make-the-Scan.pm-generation-reproducible-by-sorting-.patch
@@ -0,0 +1,93 @@
+From eab4aff7f62428d05f8b4243dfd4e6f0ceaab3b8 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at debian.org>
+Date: Mon, 8 Jun 2015 22:55:36 +0300
+Subject: [PATCH 2/2] Make the Scan.pm generation reproducible by sorting hash
+ keys
+
+Bug-Debian: https://bugs.debian.org/788122
+Bug: https://rt.cpan.org/Ticket/Display.html?id=105248
+Forwarded: https://rt.cpan.org/Ticket/Display.html?id=105248
+
+---
+ Makefile.PL | 24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index a8cc8b5..8a3db0d 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -171,7 +171,7 @@ sub get_app_sign {
+ 	\$_ = pop;
+ ENDOFCODE1
+ 	my $c = 0;
+-	for my $key (keys(%{$app_signatures})) {
++	for my $key (sort keys(%{$app_signatures})) {
+ 		$c++;
+ 		$conversion{$key} = $c;
+ 		my $n = length($key)/2;
+@@ -235,10 +235,11 @@ ENDOFCODE3
+ 		$code .= "\t\t\t\t/" . $script_lang->{'in'}->{$sl} . "/os and \$script = \"$sl\", last TEST;\n";
+ 	}
+ 	$code .= "\t\t\t}\n\t\t}\n\t\tif(\$script) {\n";
+-	for my $sl (keys(%{$script_lang->{'in'}})) {
++	for my $sl (sort keys(%{$script_lang->{'in'}})) {
+ 		if(scalar(keys(%{$patterns->{$sl}->{'0'}}))) {
+ 			$code .= "\t\t\tif(\$script eq \"$sl\") {\n";
+-			while(my($key, $value) = each(%{$patterns->{$sl}->{'0'}})) {
++			for my $key (sort keys %{$patterns->{$sl}->{'0'}}) {
++				my $value = $patterns->{$sl}->{'0'}{$key};
+ 				$code .= "\t\t\t\t/$value/s and \$virus = \"$key\", last LINE;\n";
+ 			}
+ 			$code .= "\t\t\t}\n";
+@@ -249,16 +250,18 @@ ENDOFCODE3
+ 			/<\\/script[^>]*>/s and \$script = "";
+ 		} else {
+ ENDOFCODE4
+-	for my $sl (keys(%{$script_lang->{'out'}})) {
+-		while(my($key, $value) = each(%{$patterns->{$sl}->{'0'}})) {
++	for my $sl (sort keys(%{$script_lang->{'out'}})) {
++		for my $key (sort keys %{$patterns->{$sl}->{'0'}}) {
++			my $value = $patterns->{$sl}->{'0'}{$key};
+ 			$code .= "\t\t\t/$value/s and \$virus = \"$key\", last LINE;\n";
+ 		}
+ 	}
+ 	$code .= "\t\t}\n";
+ 	if(scalar(keys(%{$script_lang->{'mix'}}))) {
+ 		$code .= "\t\tunless(\$script eq \"HTMLJS\") {\n";
+-		for my $sl (keys(%{$script_lang->{'mix'}})) {
+-			while(my($key, $value) = each(%{$patterns->{$sl}->{'0'}})) {
++		for my $sl (sort keys(%{$script_lang->{'mix'}})) {
++			for my $key (sort keys %{$patterns->{$sl}->{'0'}}) {
++				my $value = $patterns->{$sl}->{'0'}{$key};
+ 				$code .= "\t\t\t/$value/s and \$virus = \"$key\", last LINE;\n";
+ 			}
+ 		}
+@@ -312,7 +315,7 @@ ENDOFCODE6
+ 		}
+ ENDOFCODE7
+ 	my $lcode = "";
+-	for my $key (keys(%{$app_signatures})) {
++	for my $key (sort keys(%{$app_signatures})) {
+ 		my $c = $conversion{$key};
+ 		$lcode .= ($lcode) ? "\t\t} els" : "\t\t";
+ 		$lcode .= "if(\$type == $c) {\n";
+@@ -349,13 +352,14 @@ sub subgene {
+ 	my $tab = shift;
+ 
+ 	my $code = "";
+-	for my $limit (keys(%{$pat})) {
++	for my $limit (sort keys(%{$pat})) {
+ 		my $tabs = $tab;
+ 		if($limit) {
+ 			$code .= $tabs . "if($limit) \{\n";
+ 			$tabs .= "\t";
+ 		}
+-		while(my($key, $value) = each(%{$pat->{$limit}})) {
++		for my $key (sort keys %{$pat->{$limit}}) {
++			my $value = $pat->{$limit}{$key};
+ 			$code .= $tabs . "/$value/s and \$virus = \"$key\", last LINE;\n";
+ 		}
+ 		$code .= "$tab\}\n" if($limit);
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index d14af50..f04f2c8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
 10Makefile.PL.patch
 20Scan.base.patch
+0001-Don-t-put-a-timestamp-in-generated-Scan.pm.patch
+0002-Make-the-Scan.pm-generation-reproducible-by-sorting-.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libfile-scan-perl.git



More information about the Pkg-perl-cvs-commits mailing list