From: Dirk Mueller Date: Sat, 27 Feb 2021 17:14:47 +0000 (-0800) Subject: automake: sort hash keys needed for reproducible output. X-Git-Tag: v1.16.4~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a12201292d9f114549911cf5aaad15e1e5dce3c;p=thirdparty%2Fautomake.git automake: sort hash keys needed for reproducible output. 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. --- diff --git a/NEWS b/NEWS index 8821376f6..e692d9742 100644 --- 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/bin/automake.in b/bin/automake.in index 8edd0c7a3..19ea9538f 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -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); }