[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [PATCH 03/15] [ng] vars: get rid of VAR_SILENT type
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [PATCH 03/15] [ng] vars: get rid of VAR_SILENT type |
Date: |
Fri, 25 May 2012 13:38:25 +0200 |
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 <address@hidden>
---
automake.in | 4 ++--
lib/Automake/VarDef.pm | 14 ++++----------
lib/Automake/Variable.pm | 12 ++++--------
3 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/automake.in b/automake.in
index 8b48cdf..94a728d 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 = @address@hidden when address@hidden@`
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 0ad705f..ba48d85 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<VAR_ASIS>, C<VAR_PRETTY>, C<VAR_SILENT>
+=item C<VAR_ASIS>, C<VAR_PRETTY>
Possible print styles. C<VAR_ASIS> variables should be output as-is.
C<VAR_PRETTY> variables are wrapped on multiple lines if they cannot
-fit on one. C<VAR_SILENT> variables are not output at all.
-
-C<VAR_SILENT> 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<VAR_AUTOMAKE>, C<VAR_CONFIGURE>, or C<VAR_MAKEFILE> (see
these
definitions).
Finally, C<$pretty> tells how the variable should be output, and can
-be one of C<VAR_ASIS>, C<VAR_PRETTY>, or C<VAR_SILENT>.
+be one of C<VAR_ASIS>, C<VAR_PRETTY>.
=cut
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index f4f0db6..1e227c3 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<Location> of the assignment.
-C<$pretty>: whether C<$value> should be pretty printed (one of C<VAR_ASIS>,
-C<VAR_PRETTY>, or C<VAR_SILENT>, defined by L<Automake::VarDef>).
+C<$pretty>: whether C<$value> should be pretty printed (one of C<VAR_ASIS>
+or C<VAR_PRETTY> defined by L<Automake::VarDef>).
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)
--
1.7.9.5
- Re: [Automake-NG] [PATCH 02/15] [ng] vars: get rid of VAR_SORTED type, (continued)
[Automake-NG] [PATCH 04/15] [ng] tests: spy behaviour of '+=' with GNU make, Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 05/15] [ng] tests: Automake should let us append to undefined variables (someday), Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 07/15] [ng] VarDef: store comments and values as a perl array, Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 03/15] [ng] vars: get rid of VAR_SILENT type,
Stefano Lattarini <=
[Automake-NG] [PATCH 08/15] [ng] vars: simplify logic for appending conditionally, Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 06/15] [ng] refactor: support comments only for VarDef, not for ItemDef too, Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 09/15] [ng] vars: keep track of conditionals in appended values and comments, Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 11/15] [ng] refactor: change signature of 'define_variable()', Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 13/15] [ng] rename: define_pretty_variable -> define_cond_variable(), Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 10/15] [ng] vars: get rid of VAR_ASIS / VAR_PRETTY distinction, Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 15/15] [ng] vars: remove some safety checks in Automake::Variable::define, Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 12/15] [ng] cleanup: prefer 'define_variable' over 'define_pretty_variable', Stefano Lattarini, 2012/05/25
[Automake-NG] [PATCH 14/15] [ng] cosmetics: avoid redundant use of '&' in subroutine calls, Stefano Lattarini, 2012/05/25