Package: libxray-absorption-perl
Version: 3.0.1-2
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

This package doesn't build reproducibly because the generated Storable
databases contain hashes with random key ordering.

See 
https://reproducible.debian.net/rb-pkg/unstable/amd64/libxray-absorption-perl.html

Patch attached.
-- 
Niko Tyni   nt...@debian.org
>From f823201b1cba130bd52f917b1fa3c46439f26abb Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Wed, 19 Aug 2015 23:07:54 +0300
Subject: [PATCH] Make the Storable databases reproducible

We set $Storable::canonical to make sure the hash keys are
ordered in the Storable structures, and sort the keys
when creating lists.
---
 data/chantler2st.PL  | 3 ++-
 data/cl2st.PL        | 3 ++-
 data/dat2st.PL       | 1 +
 data/elam2st.PL      | 5 +++--
 data/henke2st.PL     | 3 ++-
 data/hubbell_g2st.PL | 1 +
 data/shalt2st.PL     | 1 +
 7 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/data/chantler2st.PL b/data/chantler2st.PL
index 4572084..149fd7b 100755
--- a/data/chantler2st.PL
+++ b/data/chantler2st.PL
@@ -35,6 +35,7 @@
 
 use strict;
 use Storable qw/nstore/;
+$Storable::canonical = 1;
 ## use Data::Dumper;
 use File::Spec;
 use Chemistry::Elements qw(get_symbol);
@@ -136,7 +137,7 @@ print $/;
 
 print "  Getting energy list keys ... ";
 my @energy_list = ();
-foreach my $key (keys %chantler) {
+foreach my $key (sort keys %chantler) {
   next if ($key eq "version");
   next if ($key eq "nu");
   foreach my $s ("k" , "l1", "l2", "l3", "m1", "m2", "m3", "m4", "m5",
diff --git a/data/cl2st.PL b/data/cl2st.PL
index 520c5f3..34fb13c 100755
--- a/data/cl2st.PL
+++ b/data/cl2st.PL
@@ -40,6 +40,7 @@
 
 use strict;
 use Storable qw/nstore/;
+$Storable::canonical = 1;
 ## use Data::Dumper;
 use File::Spec;
 use Chemistry::Elements qw(get_symbol);
@@ -124,7 +125,7 @@ while (<CL>) {
 
 print "$/  Getting energy list keys ... ";
 my @energy_list = ();
-foreach my $key (keys %cl) {
+foreach my $key (sort keys %cl) {
   next if ($key eq "version");
   next if ($key eq "nu");
   foreach my $s ("k" , "l1", "l2", "l3", "m1", "m2", "m3", "m4", "m5",
diff --git a/data/dat2st.PL b/data/dat2st.PL
index f3fa364..0f52e20 100755
--- a/data/dat2st.PL
+++ b/data/dat2st.PL
@@ -27,6 +27,7 @@
 
 use strict;
 use Storable qw/nstore/;
+$Storable::canonical = 1;
 use File::Spec;
 
 my $cvs_info = '$Id: dat2st.PL,v 1.1 1999/05/20 17:47:43 bruce Exp $ ';
diff --git a/data/elam2st.PL b/data/elam2st.PL
index 7a407da..c6bed3d 100755
--- a/data/elam2st.PL
+++ b/data/elam2st.PL
@@ -189,6 +189,7 @@
 
 use strict;
 use Storable qw/nstore/;
+$Storable::canonical = 1;
 ## use Data::Dumper;
 use File::Spec;
 
@@ -329,7 +330,7 @@ close ELAM;
 
 print "  Getting energy list keys ... ";
 my @energy_list = ();
-foreach my $key (keys %elam) {
+foreach my $key (sort keys %elam) {
   next if ($key eq "version");
   next if ($key eq "date");
   next if ($key eq "nu");
@@ -368,7 +369,7 @@ while (@energy_list) {
 
 print "  Getting line list keys ... ";
 my @line_list = ();
-foreach my $key (keys %elam) {
+foreach my $key (sort keys %elam) {
   next if ($key eq "version");
   next if ($key eq "date");
   next if ($key eq "nu");
diff --git a/data/henke2st.PL b/data/henke2st.PL
index 13959da..bda1743 100755
--- a/data/henke2st.PL
+++ b/data/henke2st.PL
@@ -32,6 +32,7 @@
 
 use strict;
 use Storable qw/nstore/;
+$Storable::canonical = 1;
 ## use Data::Dumper;
 use File::Spec;
 use Chemistry::Elements qw(get_symbol);
@@ -111,7 +112,7 @@ print $/;
 
 print "  Getting energy list keys ... ";
 my @energy_list = ();
-foreach my $key (keys %henke) {
+foreach my $key (sort keys %henke) {
   next if ($key eq "version");
   next if ($key eq "nu");
   foreach my $s ("k" , "l1", "l2", "l3", "m1", "m2", "m3", "m4", "m5",
diff --git a/data/hubbell_g2st.PL b/data/hubbell_g2st.PL
index e4050dc..d1803d7 100755
--- a/data/hubbell_g2st.PL
+++ b/data/hubbell_g2st.PL
@@ -16,6 +16,7 @@ use version;
 use Chemistry::Elements qw(get_symbol);
 use File::Spec;
 use Storable qw/nstore/;
+$Storable::canonical = 1;
 #use Data::Dumper;
 
 my $version = qv("0.2.0");
diff --git a/data/shalt2st.PL b/data/shalt2st.PL
index 6595a80..239c617 100755
--- a/data/shalt2st.PL
+++ b/data/shalt2st.PL
@@ -27,6 +27,7 @@
 use strict;
 use Chemistry::Elements qw(get_symbol);
 use Storable qw(nstore);
+$Storable::canonical = 1;
 use Fatal qw(open close);
 use File::Spec;
 
-- 
2.1.4

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to