1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
Description: Fix reproducible build
Replaced all occurence of 'keys %foo' with 'sort keys %foo' in Build.PL and lib used by Build.PL (in inc)
Forwarded: NA
Author: dod
--- a/inc/My/Builder.pm
+++ b/inc/My/Builder.pm
@@ -329,7 +329,7 @@
};
$cfg->{ld_shared_libs} = [ @shlibs ];
- $cfg->{ld_paths} = [ keys %tmp ];
+ $cfg->{ld_paths} = [ sort keys %tmp ];
$cfg->{ld_shlib_map} = \%shlib_map;
my $have_libs = $self->notes('have_libs');
--- a/inc/My/Builder/Unix.pm
+++ b/inc/My/Builder/Unix.pm
@@ -18,7 +18,7 @@
my $self = shift;
my @list = ();
### any platform specific -L/path/to/libs shoud go here
- for (keys %$inc_lib_candidates) {
+ for (sort keys %$inc_lib_candidates) {
push @list, "-I$_" if (-d $_);
}
return join(' ', @list);
@@ -29,14 +29,14 @@
### any platform specific -L/path/to/libs shoud go here
my @list = ();
my %rv; # putting detected dir into hash to avoid duplicates
- for (keys %$inc_lib_candidates) {
+ for (sort keys %$inc_lib_candidates) {
my $ld = $inc_lib_candidates->{$_};
if( -d $_ && -d $ld ) {
$rv{"-L$ld"} = 1;
#$rv{"-Wl,-rpath,$ld"} = 1 if $^O =~ /^linux|dragonfly|.+bsd$/;
}
}
- push @list, (keys %rv);
+ push @list, (sort keys %rv);
if ($^O eq 'openbsd') {
my $osver = `uname -r 2>/dev/null`;
if ($self->notes('perl_libs')->{pthread} || ($osver && $osver < 5.0)) {
--- a/inc/My/Utility.pm
+++ b/inc/My/Utility.pm
@@ -390,7 +390,7 @@
my $header = (defined $header_map->{$lib}) ? $header_map->{$lib} : $lib;
my $dlext = get_dlext();
- foreach (keys %$inc_lib_candidates) {
+ foreach (sort keys %$inc_lib_candidates) {
my $ld = $inc_lib_candidates->{$_};
next unless -d $_ && -d $ld;
($found_dll) = find_file($ld, qr/[\/\\]lib\Q$lib\E[\-\d\.]*\.($dlext[\d\.]*|so|dll)$/);
--- a/Build.PL
+++ b/Build.PL
@@ -127,7 +127,7 @@
my @set = `\@vcvars32 & set`;
chomp @set;
my %set = map /(\w+)=(.+)/, @set;
- for( keys %set ) {
+ for( sort keys %set ) {
if( /^INCLUDE|LIB$/ ) {
$ENV{$_} = $set{$_};
}
|