summaryrefslogtreecommitdiff
path: root/lib/Automake
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-05-11 00:28:15 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-05-11 00:42:51 +0200
commit9f21b55d38e8983090ce169969a2f8f1f6645583 (patch)
treeaf34a307483dfbf4a47006a0c79397596a52ca3d /lib/Automake
parent421f0ad97b4344e7ed35321850df1ae896ed7298 (diff)
downloadautomake-9f21b55d38e8983090ce169969a2f8f1f6645583.tar.gz
options: try to report as much errors as possible
For example, if two invalid options are used in AUTOMAKE_OPTIONS, don't report just the first one, but both of them. * lib/Automake/Options.pm (_process_option_list): Do so by avoiding early returns in here. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/Automake')
-rw-r--r--lib/Automake/Options.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index f745d3a49..db5661cec 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -307,6 +307,7 @@ sub _process_option_list (\%@)
{
my ($options, @list) = @_;
my @warnings = ();
+ my $ret = 1;
foreach my $h (@list)
{
@@ -323,20 +324,20 @@ sub _process_option_list (\%@)
# Obsolete (and now removed) de-ANSI-fication support.
error ($where,
"automatic de-ANSI-fication support has been removed");
- return 0;
+ $ret = 0;
}
# TODO: Remove this special check in Automake 3.0.
elsif ($_ eq 'cygnus')
{
error $where, "support for Cygnus-style trees has been removed";
- return 0;
+ $ret = 0;
}
# TODO: Remove this special check in Automake 3.0.
elsif ($_ eq 'dist-lzma')
{
error ($where, "support for lzma-compressed distribution " .
"archives has been removed");
- return 0;
+ $ret = 0;
}
# TODO: Make this a fatal error in Automake 2.0.
elsif ($_ eq 'dist-shar')
@@ -362,7 +363,7 @@ sub _process_option_list (\%@)
{
if (not _option_is_from_configure ($_, $where))
{
- return 0;
+ $ret = 0;
}
for my $opt ('tar-v7', 'tar-ustar', 'tar-pax')
{
@@ -370,7 +371,7 @@ sub _process_option_list (\%@)
if $opt eq $_ or ! exists $options->{$opt};
error ($where,
"options '$_' and '$opt' are mutually exclusive");
- return 0;
+ $ret = 0;
}
}
elsif (/^\d+\.\d+(?:\.\d+)?[a-z]?(?:-[A-Za-z0-9]+)?$/)
@@ -380,7 +381,7 @@ sub _process_option_list (\%@)
{
error ($where, "require Automake $_, but have $VERSION",
uniq_scope => US_GLOBAL);
- return 0;
+ $ret = 0;
}
}
elsif (/^(?:--warnings=|-W)(.*)$/)
@@ -391,9 +392,10 @@ sub _process_option_list (\%@)
elsif (! _is_valid_easy_option $_)
{
error ($where, "option '$_' not recognized");
- return 0;
+ $ret = 0;
}
}
+
# We process warnings here, so that any explicitly-given warning setting
# will take precedence over warning settings defined implicitly by the
# strictness.
@@ -403,7 +405,8 @@ sub _process_option_list (\%@)
"unknown warning category '$w->{'cat'}'"
if switch_warning $w->{cat};
}
- return 1;
+
+ return $ret;
}
sub process_option_list (@)