Subject: | make Class-MethodMaker build reproducibly |
When building packages (e.g. for openSUSE Linux) in disposable VMs
cmmg.pl outputs hash value content in undeterministic order
thus producing different array.pm files from constant array.m input.
See https://reproducible-builds.org/ for why this matters.
Subject: | reproducible.patch |
When building packages (e.g. for openSUSE Linux) in disposable VMs
cmmg.pl outputs hash value content in undeterministic order
This patch fixes this by sorting hash keys
See https://reproducible-builds.org/ for why this matters.
Index: Class-MethodMaker-2.24/cmmg.pl
===================================================================
--- Class-MethodMaker-2.24.orig/cmmg.pl
+++ Class-MethodMaker-2.24/cmmg.pl
@@ -99,7 +99,8 @@ my @storage_names = Class::MethodMaker::
my %import;
-while ( my ($meth, $value) = each %methods ) {
+foreach my $meth ( sort keys %methods ) {
+ my $value = $methods{$meth};
print "package Class::MethodMaker::", basename($ARGV[0], '.m'), ";\n";
print <<'END';
Index: Class-MethodMaker-2.24/lib/Class/MethodMaker/OptExt.pm
===================================================================
--- Class-MethodMaker-2.24.orig/lib/Class/MethodMaker/OptExt.pm
+++ Class-MethodMaker-2.24/lib/Class/MethodMaker/OptExt.pm
@@ -357,7 +357,7 @@ sub encode {
# -------------------------------------
-sub option_names { grep $_ ne 'DEFAULT', keys %{OPTEXT()} }
+sub option_names { grep $_ ne 'DEFAULT', sort keys %{OPTEXT()} }
sub optcode {
my $class = shift;