summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--lib/Automake/Variable.pm14
-rw-r--r--t/preproc-errmsg.sh4
-rw-r--r--t/test-extensions.sh2
4 files changed, 14 insertions, 10 deletions
diff --git a/NEWS b/NEWS
index 77dcbbcbc..614eba64d 100644
--- a/NEWS
+++ b/NEWS
@@ -117,6 +117,10 @@ New in 1.14.1:
was only relevant when the number of python files was high (which is
unusual in practice).
+ - Automake try to offer a more reproducible output for warning messages,
+ in the face of the newly-introduced randomization for hash keys order
+ in Perl 5.18.
+
- The 'test-driver' script now actually error out with a clear error
message on the most common invalid usages.
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index f1559f58c..4751563a3 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -317,21 +317,21 @@ use vars '%_variable_dict', '%_primary_dict';
sub variables (;$)
{
my ($suffix) = @_;
+ my @vars = ();
if ($suffix)
{
if (exists $_primary_dict{$suffix})
{
- return values %{$_primary_dict{$suffix}};
- }
- else
- {
- return ();
+ @vars = values %{$_primary_dict{$suffix}};
}
}
else
{
- return values %_variable_dict;
+ @vars = values %_variable_dict;
}
+ # The behaviour of the 'sort' built-in is undefined in scalar
+ # context, hence we need an ad-hoc handling for such context.
+ return wantarray ? sort { $a->name cmp $b->name } @vars : scalar @vars;
}
=item C<Automake::Variable::reset>
@@ -1080,7 +1080,7 @@ For debugging.
sub variables_dump ()
{
my $text = "all variables:\n{\n";
- foreach my $var (sort { $a->name cmp $b->name } variables)
+ foreach my $var (variables())
{
$text .= $var->dump;
}
diff --git a/t/preproc-errmsg.sh b/t/preproc-errmsg.sh
index 704562dcd..87bcf8161 100644
--- a/t/preproc-errmsg.sh
+++ b/t/preproc-errmsg.sh
@@ -58,11 +58,11 @@ Makefile.am:2: 'sub/local.mk' included from here
sub/local.mk:3: 'sub-two.a' is not a standard library name
sub/local.mk:3: did you mean 'libsub-two.a'?
Makefile.am:2: 'sub/local.mk' included from here
-Makefile.am:1: variable 'x1_SOURCES' is defined but no program or
-Makefile.am:1: library has 'x1' as canonical name (possible typo)
sub/local.mk:4: variable 'sub_x2_SOURCES' is defined but no program or
sub/local.mk:4: library has 'sub_x2' as canonical name (possible typo)
Makefile.am:2: 'sub/local.mk' included from here
+Makefile.am:1: variable 'x1_SOURCES' is defined but no program or
+Makefile.am:1: library has 'x1' as canonical name (possible typo)
END
# We need to break these substitutions into multiple sed invocations
diff --git a/t/test-extensions.sh b/t/test-extensions.sh
index 070099171..ca7c5eccb 100644
--- a/t/test-extensions.sh
+++ b/t/test-extensions.sh
@@ -39,7 +39,7 @@ $AUTOMAKE -a
grep -i 'log' Makefile.in # For debugging.
for lc in $valid_extensions; do
- uc=$(echo $lc | tr '[a-z]' '[A-Z]')
+ uc=$(echo $lc | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ)
$FGREP "\$(${uc}_LOG_COMPILER)" Makefile.in
grep "^${uc}_LOG_COMPILE =" Makefile.in
grep "^\.${lc}\.log:" Makefile.in