[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/10] Cleanup in module Automake::Options.
From: |
stefano . lattarini |
Subject: |
[PATCH 06/10] Cleanup in module Automake::Options. |
Date: |
Thu, 23 Dec 2010 12:27:42 +0100 |
From: Stefano Lattarini <address@hidden>
The previous change (v1.11-547-g4e4b85c) has left some loose ends
in the Automake::Options module, which can thus still profit from
a further simplification.
* lib/Automake/Options.pm (_process_option_list): Internal
subroutine removed, merged into ...
(process_option_list): ... this public subroutine.
---
ChangeLog | 10 ++++++++++
lib/Automake/Options.pm | 27 ++++++++-------------------
2 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0788270..c095001 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2010-12-20 Stefano Lattarini <address@hidden>
+ Cleanup in module Automake::Options.
+ The previous change (v1.11-547-g4e4b85c) has left some loose ends
+ in the Automake::Options module, which can thus still profit from
+ a further simplification.
+ * lib/Automake/Options.pm (_process_option_list): Internal
+ subroutine removed, merged into ...
+ (process_option_list): ... this public subroutine.
+
+2010-12-20 Stefano Lattarini <address@hidden>
+
Remove global/local distinction for automake options.
After the previous change (v1.11-546-g243a0a6), the distinction
between global-level (from command line and AM_INIT_AUTOMAKE)
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index ccd940c..1461a38 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -182,24 +182,19 @@ sub unset_option ($)
Process Automake's option lists. C<@options> should be a list of
words, as they occur in C<AUTOMAKE_OPTIONS> or C<AM_INIT_AUTOMAKE>.
+C<$where> is the location where @OPTIONS occurred.
Return 1 on error, 0 otherwise.
=cut
-# $BOOL
-# _process_option_list (\%OPTIONS, $WHERE, @OPTIONS)
-# --------------------------------------------------
-# Process a list of options. Return 1 on error, 0 otherwise.
-# \%OPTIONS is the hash to fill with options data, $WHERE is
-# the location where @OPTIONS occurred.
-sub _process_option_list (\%$@)
+sub process_option_list ($@)
{
- my ($options, $where, @list) = @_;
+ my ($where, @list) = @_;
foreach (@list)
{
- $options->{$_} = $where;
+ $_options{$_} = $where;
if ($_ eq 'gnits' || $_ eq 'gnu' || $_ eq 'foreign')
{
set_strictness ($_);
@@ -209,7 +204,7 @@ sub _process_option_list (\%$@)
# An option like "../lib/ansi2knr" is allowed. With no
# path prefix, we assume the required programs are in this
# directory. We save the actual option for later.
- $options->{'ansi2knr'} = [$_, $where];
+ $_options{'ansi2knr'} = [$_, $where];
}
elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
|| $_ eq 'dist-shar' || $_ eq 'dist-zip'
@@ -228,8 +223,8 @@ sub _process_option_list (\%$@)
}
elsif ($_ =~ /^filename-length-max=(\d+)$/)
{
- delete $options->{$_};
- $options->{'filename-length-max'} = [$_, $1];
+ delete $_options{$_};
+ $_options{'filename-length-max'} = [$_, $1];
}
elsif ($_ eq 'silent-rules')
{
@@ -247,7 +242,7 @@ sub _process_option_list (\%$@)
for my $opt ('tar-v7', 'tar-ustar', 'tar-pax')
{
next if $opt eq $_;
- if (exists $options->{$opt})
+ if (exists $_options{$opt})
{
error ($where,
"options `$_' and `$opt' are mutually exclusive");
@@ -283,12 +278,6 @@ sub _process_option_list (\%$@)
return 0;
}
-sub process_option_list ($@)
-{
- my ($where, @list) = @_;
- return _process_option_list (%_options, $where, @list);
-}
-
=item C<set_strictness ($name)>
Set the current strictness level.
--
1.7.2.3
- [PATCH 0/10] Explicit warning levels must always take precedence over those implied by the strictness, stefano . lattarini, 2010/12/23
- [PATCH 02/10] New test on silent-rules mode and portability warnings., stefano . lattarini, 2010/12/23
- [PATCH 03/10] Warnings win over strictness on command line., stefano . lattarini, 2010/12/23
- [PATCH 01/10] Add new tests on strictness and warnings precedence and overriding., stefano . lattarini, 2010/12/23
- [PATCH 05/10] Remove global/local distinction for automake options., stefano . lattarini, 2010/12/23
- [PATCH 04/10] Refactoring: new $automake_remake_options global variable., stefano . lattarini, 2010/12/23
- [PATCH 06/10] Cleanup in module Automake::Options.,
stefano . lattarini <=
- [PATCH 07/10] Warnings win over strictness in AM_INIT_AUTOMAKE., stefano . lattarini, 2010/12/23
- [PATCH 08/10] Add more tests about AUTOMAKE_OPTIONS., stefano . lattarini, 2010/12/23
- [PATCH 09/10] Change signature of 'Automake::Options::process_option_list()'., stefano . lattarini, 2010/12/23
- [PATCH 10/10] Warnings win over strictness in AUTOMAKE_OPTIONS., stefano . lattarini, 2010/12/23
- [PATCH 11/10] Update NEWS about the warnings-over-strictness precedence., Stefano Lattarini, 2010/12/24
- [PATCH 12/10] More checks on warnings/strictness in precedence ("metawarnings")., Stefano Lattarini, 2010/12/24