]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* autom4te.in (Request::@request): Declare with `vars', not `my',
authorAkim Demaille <akim@epita.fr>
Sat, 2 Jun 2001 13:00:34 +0000 (13:00 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 2 Jun 2001 13:00:34 +0000 (13:00 +0000)
as it prevents updates via `do FILENAME'.

ChangeLog
autom4te.in
bin/autom4te.in

index 9b6693b4a18f9f6fc4dfbc78008d5dce0f69376a..5e05f8a4a4548e61bc045d582a84622500d67185 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-02  Akim Demaille  <akim@epita.fr>
+
+       * autom4te.in (Request::@request): Declare with `vars', not `my',
+       as it prevents updates via `do FILENAME'.
+
 2001-06-02  Akim Demaille  <akim@epita.fr>
 
        * configure.in (standards_texi): Remove, dead code.
index 7abf31375cbf4e71c08029f7d057378560c00848..a89e0dc5844f42bdfeb58cff4815023a1e98a14f 100644 (file)
@@ -49,8 +49,12 @@ use Getopt::Long;
 use IO::File;
 use strict;
 
-# List of requests
-my @request;
+# List of requests.
+# We can't declare it `my' as the loading, performed via `do',
+# would refer to another scope, and @request would not be updated.
+# It used to work with `my' vars, and I don't know whether the current
+# behavior (5.6) is wanted or not.
+use vars qw(@request);
 
 struct
   (
@@ -200,8 +204,11 @@ sub load
   croak "$me: cannot load a single request\n"
     if ref ($self);
 
-  do "$filename"
-    or croak "$me: cannot source $filename: $!\n";
+  (my $return) = do "$filename";
+
+  croak "$me: cannot parse $filename: $@\n" if $@;
+  croak "$me: cannot do $filename: $!\n"    if $!;
+  croak "$me: cannot run $filename\n"       unless $return;
 }
 
 
@@ -919,6 +926,12 @@ my $req = Request->request ('source' => \@ARGV,
                            'path' => \@include,
                            'macro' => [keys %trace, @required_trace]);
 
+if ($verbose)
+  {
+    print STDERR "$me: the trace request object is:\n";
+    print STDERR $req->marshall;
+  }
+
 # We need to run M4 if
 # - for traces
 #   + there is no cache, or
index 7abf31375cbf4e71c08029f7d057378560c00848..a89e0dc5844f42bdfeb58cff4815023a1e98a14f 100644 (file)
@@ -49,8 +49,12 @@ use Getopt::Long;
 use IO::File;
 use strict;
 
-# List of requests
-my @request;
+# List of requests.
+# We can't declare it `my' as the loading, performed via `do',
+# would refer to another scope, and @request would not be updated.
+# It used to work with `my' vars, and I don't know whether the current
+# behavior (5.6) is wanted or not.
+use vars qw(@request);
 
 struct
   (
@@ -200,8 +204,11 @@ sub load
   croak "$me: cannot load a single request\n"
     if ref ($self);
 
-  do "$filename"
-    or croak "$me: cannot source $filename: $!\n";
+  (my $return) = do "$filename";
+
+  croak "$me: cannot parse $filename: $@\n" if $@;
+  croak "$me: cannot do $filename: $!\n"    if $!;
+  croak "$me: cannot run $filename\n"       unless $return;
 }
 
 
@@ -919,6 +926,12 @@ my $req = Request->request ('source' => \@ARGV,
                            'path' => \@include,
                            'macro' => [keys %trace, @required_trace]);
 
+if ($verbose)
+  {
+    print STDERR "$me: the trace request object is:\n";
+    print STDERR $req->marshall;
+  }
+
 # We need to run M4 if
 # - for traces
 #   + there is no cache, or