]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* Makefile.am (autom4te-update, autom4te_files): Fetch Struct.pm
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 13 Sep 2003 22:00:36 +0000 (22:00 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 13 Sep 2003 22:00:36 +0000 (22:00 +0000)
and XFile.pm from Automake.
* lib/Autom4te/XFile.pm: Update from Automake.

ChangeLog
Makefile.am
Makefile.in
lib/Autom4te/XFile.pm

index b1528da0b457784b6cd874258fafc886f359b8a7..39f989705681388b93ea36fcc09ecb6c8b013c7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-13  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * Makefile.am (autom4te-update, autom4te_files): Fetch Struct.pm
+       and XFile.pm from Automake.
+       * lib/Autom4te/XFile.pm: Update from Automake.
+
 2003-09-12  Akim Demaille  <akim@epita.fr>
 
        Version 2.57c.
index b24b06df7220f942226a16a09e5a87eaf55c9f04..fb30c00e1f6274ee1658c64f731e2b73842d4fec 100644 (file)
@@ -68,7 +68,9 @@ automake_cvsargs = \
 autom4te_files = \
   Autom4te/Configure_ac.pm \
   Autom4te/Channels.pm \
-  Autom4te/FileUtils.pm
+  Autom4te/FileUtils.pm \
+  Autom4te/Struct.pm \
+  Autom4te/XFile.pm
 
 autom4te-update:
        rm -rf Fetchdir > /dev/null 2>&1
@@ -78,6 +80,8 @@ autom4te-update:
        $(WGET) $(automake_cvsweb)/lib/Automake/Configure_ac.pm?$(automake_cvsargs) -O Autom4te/Configure_ac.pm; \
        $(WGET) $(automake_cvsweb)/lib/Automake/Channels.pm?$(automake_cvsargs) -O Autom4te/Channels.pm; \
        $(WGET) $(automake_cvsweb)/lib/Automake/FileUtils.pm?$(automake_cvsargs) -O Autom4te/FileUtils.pm; \
+       $(WGET) $(automake_cvsweb)/lib/Automake/Struct.pm?$(automake_cvsargs) -O Autom4te/Struct.pm; \
+       $(WGET) $(automake_cvsweb)/lib/Automake/XFile.pm?$(automake_cvsargs) -O Autom4te/XFile.pm; \
        :)
        perl -pi -e 's/Automake::/Autom4te::/g' Fetchdir/Autom4te/*.pm
        for file in $(autom4te_files); do \
index a5d2a259851c4d596dea574edb6265e70562fe86..40ec909cf4c199a60da4e1af197de4fc194f3fd4 100644 (file)
@@ -151,7 +151,9 @@ automake_cvsargs = \
 autom4te_files = \
   Autom4te/Configure_ac.pm \
   Autom4te/Channels.pm \
-  Autom4te/FileUtils.pm
+  Autom4te/FileUtils.pm \
+  Autom4te/Struct.pm \
+  Autom4te/XFile.pm
 
 all: all-recursive
 
@@ -508,7 +510,6 @@ clean-am: clean-generic mostlyclean-am
 
 distclean: distclean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-
        -rm -f Makefile
 distclean-am: clean-am distclean-generic distclean-tags
 
@@ -533,7 +534,6 @@ installcheck-am:
 maintainer-clean: maintainer-clean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
        -rm -rf $(top_srcdir)/autom4te.cache
-
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -588,6 +588,8 @@ autom4te-update:
        $(WGET) $(automake_cvsweb)/lib/Automake/Configure_ac.pm?$(automake_cvsargs) -O Autom4te/Configure_ac.pm; \
        $(WGET) $(automake_cvsweb)/lib/Automake/Channels.pm?$(automake_cvsargs) -O Autom4te/Channels.pm; \
        $(WGET) $(automake_cvsweb)/lib/Automake/FileUtils.pm?$(automake_cvsargs) -O Autom4te/FileUtils.pm; \
+       $(WGET) $(automake_cvsweb)/lib/Automake/Struct.pm?$(automake_cvsargs) -O Autom4te/Struct.pm; \
+       $(WGET) $(automake_cvsweb)/lib/Automake/XFile.pm?$(automake_cvsargs) -O Autom4te/XFile.pm; \
        :)
        perl -pi -e 's/Automake::/Autom4te::/g' Fetchdir/Autom4te/*.pm
        for file in $(autom4te_files); do \
index 1009ee6d96e63bc8ef006bcd9fe609d3fb3372d5..6be641d673fdaac5ef912e5905e0b2e83f26cab3 100644 (file)
@@ -18,8 +18,8 @@
 # Written by Akim Demaille <akim@freefriends.org>.
 
 ###############################################################
-# The main copy of this file is in Autoconf's CVS repository. #
-# Updates should be sent to autoconf-patches@gnu.org.         #
+# The main copy of this file is in Automake's CVS repository. #
+# Updates should be sent to automake-patches@gnu.org.         #
 ###############################################################
 
 package Autom4te::XFile;
@@ -33,7 +33,7 @@ Autom4te::XFile - supply object methods for filehandles with error handling
     use Autom4te::XFile;
 
     $fh = new Autom4te::XFile;
-    $fh->open("< file"))
+    $fh->open ("< file");
     # No need to check $FH: we died if open failed.
     print <$fh>;
     $fh->close;
@@ -50,12 +50,12 @@ Autom4te::XFile - supply object methods for filehandles with error handling
     print <$fh>;
     undef $fh;   # automatically closes the file and checks for errors.
 
-    $fh = new Autom4te::XFile "file", O_WRONLY|O_APPEND;
+    $fh = new Autom4te::XFile "file", O_WRONLY | O_APPEND;
     # No need to check $FH: we died if new failed.
     print $fh "corge\n";
 
     $pos = $fh->getpos;
-    $fh->setpos($pos);
+    $fh->setpos ($pos);
 
     undef $fh;   # automatically closes the file and checks for errors.
 
@@ -89,6 +89,8 @@ use vars qw($VERSION @EXPORT @EXPORT_OK $AUTOLOAD @ISA);
 use Carp;
 use IO::File;
 use File::Basename;
+use Autom4te::ChannelDefs;
+use Autom4te::FileUtils;
 
 require Exporter;
 require DynaLoader;
@@ -117,7 +119,7 @@ my $me = basename ($0);
 sub new
 {
   my $type = shift;
-  my $class = ref($type) || $type || "Autom4te::XFile";
+  my $class = ref $type || $type || "Autom4te::XFile";
   my $fh = $class->SUPER::new ();
   if (@_)
     {
@@ -132,7 +134,7 @@ sub new
 
 sub open
 {
-  my ($fh) = shift;
+  my $fh = shift;
   my ($file) = @_;
 
   # WARNING: Gross hack: $FH is a typeglob: use its hash slot to store
@@ -143,7 +145,7 @@ sub open
 
   if (!$fh->SUPER::open (@_))
     {
-      croak "$me: cannot open $file: $!\n";
+      fatal "cannot open $file: $!";
     }
 
   # In case we're running under MSWindows, don't write with CRLF.
@@ -159,11 +161,13 @@ sub open
 
 sub close
 {
-  my ($fh) = shift;
+  my $fh = shift;
   if (!$fh->SUPER::close (@_))
     {
       my $file = $fh->name;
-      croak "$me: cannot close $file: $!\n";
+      Autom4te::FileUtils::handle_exec_errors $file
+       unless $!;
+      fatal "cannot close $file: $!";
     }
 }
 
@@ -200,7 +204,7 @@ sub getlines
 
 sub name
 {
-  my ($fh) = shift;
+  my $fh = shift;
   return ${*$fh}{'autom4te_xfile_file'};
 }
 
@@ -215,7 +219,7 @@ sub lock
   if (!flock ($fh, $mode))
     {
       my $file = $fh->name;
-      croak "$me: cannot lock $file with mode $mode: $!\n";
+      fatal "cannot lock $file with mode $mode: $!";
     }
 }
 
@@ -225,12 +229,12 @@ sub lock
 
 sub seek
 {
-  my ($fh) = shift;
+  my $fh = shift;
   # Cannot use @_ here.
   if (!seek ($fh, $_[0], $_[1]))
     {
       my $file = $fh->name;
-      croak "$me: cannot rewind $file with @_: $!\n";
+      fatal "$me: cannot rewind $file with @_: $!";
     }
 }
 
@@ -244,7 +248,7 @@ sub truncate
   if (!truncate ($fh, $len))
     {
       my $file = $fh->name;
-      croak "$me: cannot truncate $file at $len: $!\n";
+      fatal "cannot truncate $file at $len: $!";
     }
 }