Codebase list libencode-jis2k-perl / c7c0495
Make the XS code reproducible by sorting hash keys. Niko Tyni 8 years ago
2 changed file(s) with 61 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 From 490886f85f22c84268702fad88163e7e6392fe6f Mon Sep 17 00:00:00 2001
1 From: Niko Tyni <ntyni@debian.org>
2 Date: Mon, 1 Jun 2015 20:32:04 +0300
3 Subject: [PATCH] Make the XS code reproducible by sorting hash keys.
4
5 ---
6 Makefile.PL | 10 +++++-----
7 1 file changed, 5 insertions(+), 5 deletions(-)
8
9 diff --git a/Makefile.PL b/Makefile.PL
10 index bd7e649..3f494d8 100644
11 --- a/Makefile.PL
12 +++ b/Makefile.PL
13 @@ -74,7 +74,7 @@ sub post_initialize
14 $self->{'C'} = ["$name.c"];
15 # $self->{'H'} = [$self->catfile($self->updir,'encode.h')];
16 my %xs;
17 - foreach my $table (keys %tables) {
18 + foreach my $table (sort keys %tables) {
19 push (@{$self->{'C'}},"$table.c");
20 # Do NOT add $table.h etc. to H_FILES unless we own up as to how they
21 # get built.
22 @@ -92,7 +92,7 @@ sub post_initialize
23 #define U8 U8
24 #include "encode.h"
25 END
26 - foreach my $table (keys %tables) {
27 + foreach my $table (sort keys %tables) {
28 print XS qq[#include "${table}.h"\n];
29 }
30 print XS <<"END";
31 @@ -121,7 +121,7 @@ PROTOTYPES: DISABLE
32 BOOT:
33 {
34 END
35 - foreach my $table (keys %tables) {
36 + foreach my $table (sort keys %tables) {
37 print XS qq[#include "${table}.exh"\n];
38 }
39 print XS "}\n";
40 @@ -135,14 +135,14 @@ sub postamble
41 my $dir = "."; # $self->catdir('Encode');
42 my $str = "# $name\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
43 $str .= "$name.c : $name.xs ";
44 - foreach my $table (keys %tables)
45 + foreach my $table (sort keys %tables)
46 {
47 $str .= " $table.c";
48 }
49 $str .= "\n\n";
50 $str .= "$name\$(OBJ_EXT) : $name.c\n\n";
51
52 - foreach my $table (keys %tables)
53 + foreach my $table (sort keys %tables)
54 {
55 my $numlines = 1;
56 my $lengthsofar = length($str);
57 --
58 2.1.4
59
0 0001-Make-the-XS-code-reproducible-by-sorting-hash-keys.patch