automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: simplify bits of am_install_var


From: Alexandre Duret-Lutz
Subject: FYI: simplify bits of am_install_var
Date: Wed, 05 Feb 2003 20:21:19 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

I've installed this.

variable_loc_and_value_as_list_recursive used to return
a list of [$loc, @values] items, but I recently changed
it to output [$loc, $value] pairs.  Hence no need to
loop over @values.

2003-02-05  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (am_install_var): Simplify filtering of
        variable_loc_and_value_as_list_recursive's output.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1428
diff -u -r1.1428 automake.in
--- automake.in 2 Feb 2003 23:40:51 -0000       1.1428
+++ automake.in 5 Feb 2003 19:17:38 -0000
@@ -8212,36 +8212,33 @@
       my $where = $var_location{$one_name}{$tmpcond}->clone;
 
       # Append actual contents of where_PRIMARY variable to
-      # result.
+      # @result, skipping @address@hidden
       foreach my $locvals (&variable_loc_and_value_as_list_recursive
                           ($one_name, 'all'))
        {
-         my ($loc, @values) = @$locvals;
-         my @nosubst = (); # @values without substitutions.
-         for my $rcurs (@values)
+         my ($loc, $value) = @$locvals;
+         # Skip configure substitutions.
+         if ($value =~ /address@hidden@$/)
            {
-             # Skip configure substitutions.  Possibly bogus.
-             if ($rcurs =~ /address@hidden@$/)
+             if ($nodir_name eq 'EXTRA')
                {
-                 if ($nodir_name eq 'EXTRA')
-                   {
-                     error ($where,
-                            "`$one_name' contains configure substitution, "
-                            . "but shouldn't");
-                   }
-                 # Check here to make sure variables defined in
-                 # configure.ac do not imply that EXTRA_PRIMARY
-                 # must be defined.
-                 elsif (! defined $configure_vars{$one_name})
-                   {
-                     $require_extra = $one_name
-                       if $do_require;
-                   }
-                 next;
+                 error ($where,
+                        "`$one_name' contains configure substitution, "
+                        . "but shouldn't");
                }
-             push @nosubst, $rcurs;
+             # Check here to make sure variables defined in
+             # configure.ac do not imply that EXTRA_PRIMARY
+             # must be defined.
+             elsif (! defined $configure_vars{$one_name})
+               {
+                 $require_extra = $one_name
+                   if $do_require;
+               }
+           }
+         else
+           {
+             push (@result, $locvals);
            }
-         push (@result, [$loc, @nosubst]) if @nosubst;
        }
       # A blatant hack: we rewrite each _PROGRAMS primary to include
       # EXEEXT.
@@ -8318,11 +8315,8 @@
   my %result = ();
   for my $pair (@result)
     {
-      my ($loc, @values) = @$pair;
-      for my $val (@values)
-       {
-         $result{$val} = $loc;
-       }
+      my ($loc, $val) = @$pair;
+      $result{$val} = $loc;
     }
   my @l = sort keys %result;
   return map { [$result{$_}->clone, $_] } @l;

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]