From: Stefano Lattarini <stefano.lattar...@gmail.com> 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 <stefano.lattar...@gmail.com> + 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 <stefano.lattar...@gmail.com> + 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