]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
automake: sort hash keys needed for reproducible output.
authorDirk Mueller <josef.moellers@suse.com>
Sat, 27 Feb 2021 17:14:47 +0000 (09:14 -0800)
committerKarl Berry <karl@freefriends.org>
Sat, 27 Feb 2021 17:14:47 +0000 (09:14 -0800)
This change fixes https://bugs.gnu.org/46744.

* bin/automake.in: sort keys, in: handle_LIBOBJS, handle_clean,
 handle_factored_dependencies, scan_autoconf_traces,
 lang_vala_finish.
* NEWS: mention this.

NEWS
bin/automake.in

diff --git a/NEWS b/NEWS
index 8821376f63463fa5f48d4f8bd964c070ee2a91af..e692d97427872267aa74bfaed7645c6f741effd2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -70,6 +70,7 @@ New in ?.?.?:
 
 * Bugs fixed
 
+  - automake output reproducible.
   - test-driver less likely to clash with tests writing to the same file.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 8edd0c7a385a29db8180f51b6d42a9a7e1a392aa..19ea9538fc52924e082aa2ea92d8b11f81ceec46 100644 (file)
@@ -2393,7 +2393,7 @@ sub handle_LIBOBJS
   $var->requires_variables ("\@${lt}LIBOBJS\@ used", $lt . 'LIBOBJS')
     if ! keys %libsources;
 
-  foreach my $iter (keys %libsources)
+  foreach my $iter (sort keys %libsources)
     {
       my $dir = '';
       if ($iter =~ /^(.*)(\.[cly])$/)
@@ -4697,7 +4697,7 @@ sub handle_clean
             DIST_CLEAN, [],
             MAINTAINER_CLEAN, []);
 
-  foreach my $file (keys %clean_files)
+  foreach my $file (sort keys %clean_files)
     {
       my $when = $clean_files{$file};
       prog_error 'invalid entry in %clean_files'
@@ -4767,7 +4767,7 @@ sub handle_factored_dependencies ()
               . "not 'install-hook'");
 
   # Install the -local hooks.
-  foreach (keys %dependencies)
+  foreach (sort keys %dependencies)
     {
       # Hooks are installed on the -am targets.
       s/-am$// or next;
@@ -4789,7 +4789,7 @@ sub handle_factored_dependencies ()
     }
 
   # All the required targets are phony.
-  depend ('.PHONY', keys %required_targets);
+  depend ('.PHONY', sort keys %required_targets);
 
   # Actually output gathered targets.
   foreach (sort target_cmp keys %dependencies)
@@ -5265,7 +5265,7 @@ sub scan_autoconf_traces
   # has a precise meaning for AC_CONFIG_FILES and so on.
   $traces .= join (' ',
                   map { "--trace=$_" . ':\$f:\$l::\$d::\$n::\${::}%' }
-                  (keys %traced));
+                  (sort keys %traced));
 
   verb "running WARNINGS=$ENV{WARNINGS} $traces";
   my $tracefh = new Automake::XFile ("$traces $filename |");
@@ -5842,7 +5842,7 @@ sub lang_vala_finish ()
 {
   my ($self) = @_;
 
-  foreach my $prog (keys %known_programs)
+  foreach my $prog (sort keys %known_programs)
     {
       lang_vala_finish_target ($self, $prog);
     }