From 797e4c6e2a2d2e1d2441b300be81d90f649d2dfe Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Sat, 2 Aug 2003 04:27:03 +0000 Subject: * lib/Automake/Variables.pm (variables): Return a list of Automake::Variable instances, not a list of strings. (dump): Remove support for being invoked with a string. (variables_dump): Adapt to these changes. * automake.in (check_typos): Likewise. (am_primary_prefixes): Likewise. --- lib/Automake/Variable.pm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'lib/Automake/Variable.pm') diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 3e9cb4c16..500dc0c67 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -299,7 +299,7 @@ variables defined so far.) use vars '%_variable_dict'; sub variables () { - return keys %_variable_dict; + return values %_variable_dict; } =item C @@ -812,9 +812,7 @@ sub has_conditional_contents ($) =item C<$string = $var-Edump> -=item C<$string = Automake::Variable::dump ($varname)> - -Return a string describing all we know about C<$var> (or C<$varname>). +Return a string describing all we know about C<$var>. For debugging. =cut @@ -823,15 +821,10 @@ sub dump ($) { my ($self) = @_; - my $v = ref $self ? $self : var $self; - - return "$self does not exist\n" - unless $v; - - my $text = $v->name . ": \n {\n"; - foreach my $vcond ($v->conditions->conds) + my $text = $self->name . ": \n {\n"; + foreach my $vcond ($self->conditions->conds) { - $text .= " " . $vcond->human . " => " . $v->rdef ($vcond)->dump; + $text .= " " . $vcond->human . " => " . $self->rdef ($vcond)->dump; } $text .= " }\n"; return $text; @@ -1158,7 +1151,7 @@ sub define ($$$$$$$$) "... overrides Automake variable `$var' defined here"); } verb ("refusing to override the user definition of:\n" - . Automake::Variable::dump $var + . $self->dump ."with `" . $cond->human . "' => `$value'"); } else @@ -1236,9 +1229,9 @@ sub variables_dump () my ($var) = @_; my $text = "All variables:\n{\n"; - foreach my $var (sort variables) + foreach my $var (sort { $a->name cmp $b->name } variables) { - $text .= Automake::Variable::dump $var; + $text .= $var->dump; } $text .= "}\n"; return $text; -- cgit v1.2.1