We received a report in Automake about sorting hash keys in Perl (ca.2017).
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25629

The patch included tweaks to gendocs.sh and gitlog-to-changelog, below.
I'm working on the automake parts of the patch, but can someone here
decide about committing them please?

And, where is the latter maintained? The script itself does not say, and
it's copied around everywhere. I could figure it out eventually, but
in the interests of time, thought I'd just ask ... --thanks, karl.

diff --git a/lib/gendocs.sh b/lib/gendocs.sh
index 198f646..fe172b6 100755
--- a/lib/gendocs.sh
+++ b/lib/gendocs.sh
@@ -237,8 +237,8 @@ BEGIN {
 /<img src="(.*?)"/g && ++$need{$1};
 
 END {
-  #print "$me: @{[keys %need]}\n";  # for debugging, show images found.
-  FILE: for my $f (keys %need) {
+  #print "$me: @{[sort keys %need]}\n";  # for debugging, show images found.
+  FILE: for my $f (sort keys %need) {
     for my $d (@dirs) {
       if (-f "$d/$f") {
         use File::Basename;
diff --git a/lib/gitlog-to-changelog b/lib/gitlog-to-changelog
index e18b50b..df79065 100755
--- a/lib/gitlog-to-changelog
+++ b/lib/gitlog-to-changelog
@@ -417,7 +417,7 @@ sub git_dir_option($)
 
   # Complain about any unused entry in the --amend=F specified file.
   my $fail = 0;
-  foreach my $sha (keys %$amend_code)
+  foreach my $sha (sort keys %$amend_code)
     {
       warn "$ME:$amend_file: unused entry: $sha\n";
       $fail = 1;

Reply via email to