Source: libparse-recdescent-perl
Version: 1.967009+dfsg-2
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi,

While working on the "reproducible builds" effort [1], we have noticed
that libparse-recdescent-perl generates non-reproducible output.

The attached patch removes this randomness. Once applied, (some)
packages that use libparse-recdescent-perl can be built in our
reproducible toolchain (for example, libmodule-extractuse-perl).

 [1]: https://wiki.debian.org/ReproducibleBuilds


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff --git a/lib/Parse/RecDescent.pm b/lib/Parse/RecDescent.pm
index 28149d7..2d22e71 100644
--- a/lib/Parse/RecDescent.pm
+++ b/lib/Parse/RecDescent.pm
@@ -144,6 +144,7 @@ sub Precompile
     print OUT "my ";
 
     require Data::Dumper;
+    $Data::Dumper::Sortkeys = 1;
     $code = Data::Dumper->Dump([$self], [qw(self)]);
     if ($opt{-standalone}) {
         $code =~ s/Parse::RecDescent/$runtime_package/gs;
@@ -3082,7 +3083,7 @@ local \$SIG{__WARN__} = sub {0};
     $self->{"startcode"} = '';
 
     my $rule;
-    foreach $rule ( values %{$self->{"rules"}} )
+    foreach $rule ( sort {$a->{'name'} cmp $b->{'name'}} values 
%{$self->{"rules"}} )
     {
         if ($rule->{"changed"})
         {
_______________________________________________
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