From: Stefano Lattarini Date: Thu, 3 May 2012 13:49:06 +0000 (+0200) Subject: [ng] vars: get rid of VAR_SILENT type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0972c83ad04845009bc19323c15db34e1ce5926a;p=thirdparty%2Fautomake.git [ng] vars: get rid of VAR_SILENT type It's not truly needed by the current code base. * automake.in (define_configure_variable): in an AC_SUBST'd variable is to be "ignored" (likely because the user has called 'AM_SUBST_NOTMAKE' on it), return early without even defining the variable, rather than defining it with type VAR_SILENT (which would have prevented its definition from being output in the generated Makefile anyway). * lib/Automake/VarDef.pm (VAR_SILENT): Delete. (@EXPORT, Pod documentation): Adjust accordingly. * lib/Automake/Variable.pm (_check_ambiguous_condition): Don't ignore variables of type VAR_SILENT: there are no more of them. (output): Don't skip variables of type VAR_SILENT: there are no more of them. (define): The value of the '$pretty' parameter can't be VAR_SILENT anymore. Adjust internal checks and Pod documentation accordingly. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index 8b48cdfa9..94a728dcd 100644 --- a/automake.in +++ b/automake.in @@ -5953,9 +5953,9 @@ sub define_configure_variable ($) # Some variables we do not want to output. For instance it # would be a bad idea to output `U = @U@` when `@U@` can be # substituted as `\`. - my $pretty = exists $ignored_configure_vars{$var} ? VAR_SILENT : VAR_ASIS; + return if exists $ignored_configure_vars{$var}; Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst $var, - '', $configure_vars{$var}, $pretty); + '', $configure_vars{$var}, VAR_ASIS); } diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm index 0ad705fb7..ba48d8532 100644 --- a/lib/Automake/VarDef.pm +++ b/lib/Automake/VarDef.pm @@ -25,7 +25,7 @@ require Exporter; use vars '@ISA', '@EXPORT'; @ISA = qw/Automake::ItemDef Exporter/; @EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE - &VAR_ASIS &VAR_PRETTY &VAR_SILENT); + &VAR_ASIS &VAR_PRETTY); =head1 NAME @@ -91,23 +91,17 @@ use constant VAR_AUTOMAKE => 0; # Variable defined by Automake. use constant VAR_CONFIGURE => 1;# Variable defined in configure.ac. use constant VAR_MAKEFILE => 2; # Variable defined in Makefile.am. -=item C, C, C +=item C, C Possible print styles. C variables should be output as-is. C variables are wrapped on multiple lines if they cannot -fit on one. C variables are not output at all. - -C variables can also be overridden silently (unlike the -other kinds of variables whose overriding may sometimes produce -warnings). +fit on one. =cut # Possible values for pretty. use constant VAR_ASIS => 0; # Output as-is. use constant VAR_PRETTY => 1; # Pretty printed on output. -use constant VAR_SILENT => 2; # Not output. (Can also be - # overridden silently.) =back @@ -138,7 +132,7 @@ C, C, or C (see these definitions). Finally, C<$pretty> tells how the variable should be output, and can -be one of C, C, or C. +be one of C, C. =cut diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index f4f0db6ae..1e227c32e 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -447,7 +447,7 @@ sub _check_ambiguous_condition ($$$) # We allow silent variables to be overridden silently, # by either silent or non-silent variables. my $def = $self->def ($ambig_cond); - if ($message && $def->pretty != VAR_SILENT) + if ($message) { msg 'syntax', $where, "$message ...", partial => 1; msg_var ('syntax', $var, "... '$var' previously defined here"); @@ -508,9 +508,6 @@ sub output ($@) . $self->name . "'") unless $def; - next - if $def->pretty == VAR_SILENT; - $res .= $def->comment; my $val = $def->raw_value; @@ -723,8 +720,8 @@ assignment. C<$where>: the C of the assignment. -C<$pretty>: whether C<$value> should be pretty printed (one of C, -C, or C, defined by L). +C<$pretty>: whether C<$value> should be pretty printed (one of C +or C defined by L). C<$pretty> applies only to real assignments. I.e., it does not apply to a C<+=> assignment (except when part of it is being done as a conditional C<=> assignment). @@ -743,8 +740,7 @@ sub define ($$$$$$$$) prog_error "pretty argument missing" unless defined $pretty && ($pretty == VAR_ASIS - || $pretty == VAR_PRETTY - || $pretty == VAR_SILENT); + || $pretty == VAR_PRETTY); # If there's a comment, make sure it is \n-terminated. if ($comment)