]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (variable_defined): Thinko.
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 14 Nov 2002 22:37:30 +0000 (22:37 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 14 Nov 2002 22:37:30 +0000 (22:37 +0000)
* lib/Automake/ConditionalSet.pm (true): Simplify.
(permutations): Fix documentation.
(new): Don't simplify conditional sets that contain TRUE.
Reported by Raja R Harinath.

ChangeLog
automake.in
lib/Automake/ConditionalSet.pm

index 06bfa58f294d48106436d772fcfc5a66d593c684..519b1b8932b625ed970f2a260cbc74399be45d7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2002-11-14  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.in (variable_defined): Thinko.
+       * lib/Automake/ConditionalSet.pm (true): Simplify.
+       (permutations): Fix documentation.
+       (new): Don't simplify conditional sets that contain TRUE.
+       Reported by Raja R Harinath.
+
 2002-11-14  Eric Blake  <ebb9@email.byu.edu>
 
        * lib/am/depend2.am: Add missing fi in c.obj rules.
index fd8119d3337fc70d0ecddf76bc522bc569d529d2..ebc29f0e5b9c08f81b59a806785d5df96575c0e0 100755 (executable)
@@ -6531,7 +6531,7 @@ sub variable_defined ($;$)
        if (exists $targets{$var}
            && (! defined $cond || exists $targets{$var}{$cond}))
          {
-           for my $tcond ($cond || ! target_conditions ($var)->false)
+           for my $tcond ($cond || target_conditions ($var)->conds)
              {
                prog_error ("\$targets{$var}{$tcond} exists but "
                            . "\$target_owner doesn't")
index 91a93e7d510bf2f924d5d6e24d2dc7ab96a460c7..c002096139c472ce00a55dd1782d0624681deebc 100644 (file)
@@ -99,8 +99,7 @@ false.
 
 As explained previously, the reference (object) returned is unique
 with respect to C<@conds>.  For this purpose, duplicate elements are
-ignored, and C<@conds> is rewriten as C<("TRUE")> if it contains
-C<"TRUE">.
+ignored.
 
 =cut
 
@@ -128,12 +127,6 @@ sub new ($;@)
       # ConditionalSet as false for this reason.
       next if $cond->false;
 
-      # If we see true, then the whole set is true!
-      if ($cond->true && $#conds > 0)
-       {
-         return new Automake::ConditionalSet $cond;
-       }
-
       # Store conditions as keys AND as values, because blessed
       # objects are converted to string when used as keys (so
       # at least we still have the value when we need to call
@@ -218,10 +211,7 @@ conditions). Return 0 otherwise.
 sub true ($ )
 {
   my ($self) = @_;
-  # To know whether a ConditionalSet covers all
-  # we invert it.  invert() will set $self->{'true'}.
-  $self->invert unless exists $self->{'true'};
-  return $self->{'true'};
+  return $self->invert->false;
 }
 
 =item C<$str = $set-E<gt>string>
@@ -292,14 +282,14 @@ For instance consider this initial C<ConditionalSet>.
 Calling $<$set-E<gt>permutations> will return the following Conditional set.
 
   new Automake::ConditionalSet
-    (new Automake::Conditional ("COND1_TRUE", "COND2_TRUE", "COND2_TRUE"),
-     new Automake::Conditional ("COND1_FALSE","COND2_TRUE", "COND2_TRUE"),
-     new Automake::Conditional ("COND1_TRUE", "COND2_FALSE","COND2_TRUE"),
-     new Automake::Conditional ("COND1_FALSE","COND2_FALSE","COND2_TRUE"),
-     new Automake::Conditional ("COND1_TRUE", "COND2_TRUE", "COND2_FALSE"),
-     new Automake::Conditional ("COND1_FALSE","COND2_TRUE", "COND2_FALSE"),
-     new Automake::Conditional ("COND1_TRUE", "COND2_FALSE","COND2_FALSE"),
-     new Automake::Conditional ("COND1_FALSE","COND2_FALSE","COND2_FALSE"));
+    (new Automake::Conditional ("COND1_TRUE", "COND2_TRUE", "COND3_TRUE"),
+     new Automake::Conditional ("COND1_FALSE","COND2_TRUE", "COND3_TRUE"),
+     new Automake::Conditional ("COND1_TRUE", "COND2_FALSE","COND3_TRUE"),
+     new Automake::Conditional ("COND1_FALSE","COND2_FALSE","COND3_TRUE"),
+     new Automake::Conditional ("COND1_TRUE", "COND2_TRUE", "COND3_FALSE"),
+     new Automake::Conditional ("COND1_FALSE","COND2_TRUE", "COND3_FALSE"),
+     new Automake::Conditional ("COND1_TRUE", "COND2_FALSE","COND3_FALSE"),
+     new Automake::Conditional ("COND1_FALSE","COND2_FALSE","COND3_FALSE"));
 
 =cut
 
@@ -372,11 +362,6 @@ sub invert($ )
   # It's tempting to also set $res->{'invert'} to $self, but that
   # isn't a bad idea as $self hasn't been normalized in any way.
   # (Different inputs can produce the same inverted set.)
-
-  # If $res is false, then $self covers all cases.  The true()
-  # method relies on this function to figure that.
-  $self->{'true'} = $res->false;
-
   return $res;
 }