From: Stefano Lattarini Date: Wed, 2 May 2012 22:46:30 +0000 (+0200) Subject: [ng] vars: get rid of VAR_SORTED type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4efbfa15dda63d276bbef26ba652a673e7d9a4cb;p=thirdparty%2Fautomake.git [ng] vars: get rid of VAR_SORTED type It's basically unused, and the tiny cosmetic enhancements it offers are not worth the complication of having yet another variable type. * automake.in (handle_subdirs): Force RECURSIVE_TARGETS to be of type "VAR_PRETTY" rather than "VAR_SORTED". This removes the only actual use of the VAR_SORTED constant. * lib/Automake/VarDef.pm (VAR_SORTED): Delete. (@EXPORT, Pod documentation): Adjust accordingly. * lib/Automake/Variable.pm (output): Don't handle variables of type VAR_SORTED anymore. (define): The value of the '$pretty' parameter cannot be VAR_SORTED anymore. Adjust internal checks and Pod documentation accordingly. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index d2d155190..8b48cdfa9 100644 --- a/automake.in +++ b/automake.in @@ -3767,7 +3767,7 @@ sub handle_subdirs () if $dsubdirs; $output_rules .= &file_contents ('subdirs', new Automake::Location); - rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_SORTED; # Gross! + rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_PRETTY; # Gross! } diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm index dde99ac38..0ad705fb7 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_SORTED); + &VAR_ASIS &VAR_PRETTY &VAR_SILENT); =head1 NAME @@ -91,13 +91,11 @@ 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, C +=item C, 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. Finally, -C variables should be sorted and then handled as -C variables. +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 @@ -110,7 +108,6 @@ 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.) -use constant VAR_SORTED => 3; # Sorted and pretty-printed. =back @@ -141,8 +138,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, or -C (see these definitions). +be one of C, C, or C. =cut diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 7f1643db4..f4f0db6ae 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -542,13 +542,9 @@ sub output ($@) $res .= $wrap; } - else # ($def->pretty == VAR_SORTED) + else { - # Suppress escaped new lines. &makefile_wrap will - # add them back, maybe at other places. - $val =~ s/\\$//mg; - $res .= makefile_wrap ("$str$name $equals", "$str\t", - sort (split (' ' , $val))); + prog_error ("unknonw variable type '$def->pretty'"); } } return $res; @@ -727,11 +723,11 @@ assignment. C<$where>: the C of the assignment. -C<$pretty>: whether C<$value> should be pretty printed (one of -C, C, C, or C, defined -by 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). +C<$pretty>: whether C<$value> should be pretty printed (one of C, +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). =cut @@ -748,8 +744,7 @@ sub define ($$$$$$$$) prog_error "pretty argument missing" unless defined $pretty && ($pretty == VAR_ASIS || $pretty == VAR_PRETTY - || $pretty == VAR_SILENT - || $pretty == VAR_SORTED); + || $pretty == VAR_SILENT); # If there's a comment, make sure it is \n-terminated. if ($comment)