autoconf-patches
[Top][All Lists]
Advanced

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

FYI: Re: Setup Automake as master for XFile.pm and Struct.pm


From: Alexandre Duret-Lutz
Subject: FYI: Re: Setup Automake as master for XFile.pm and Struct.pm
Date: Sun, 14 Sep 2003 00:02:06 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:
>>> "Akim" == Akim Demaille <address@hidden> writes:
 >>>> Who is the master of this file?  We need to update the `make
 >>>> fetch' or similar for the other one.  I think FileUtils belongs
 >>>> to Autom4te because this file is less used in Automake.
 >>>> Probably we need a general policy for all these files.

 Akim> Honestly, I was considering having all the generic ones in Automake,

 adl> That's fine with me.  Actually it might be better since
 adl> Automake's repository uses branches.  (If the files were in
 adl> Autoconf, it would be more difficult to use `make fetch' on the
 adl> stable branch of Automake.)

 adl> We discussed the case of XFile and Struct yesterday, and decided
 adl> to move them into Automake like the other files.

 adl> I'm installing this on HEAD.

 adl> 2003-09-13  Alexandre Duret-Lutz  <address@hidden>

 adl> * Makefile.am (FETCHFILES, fetch): Do not fetch lib/Automake/XFile.pm
 adl> and lib/Automake/Struct.pm from Autoconf.
 adl> * lib/Automake/XFile.pm: Update comment, Automake is now
 adl> the master for this file.  Cosmetic changes.

I'm also installing the following on autoconf.

2003-09-13  Alexandre Duret-Lutz  <address@hidden>

        * Makefile.am (autom4te-update, autom4te_files): Fetch Struct.pm
        and XFile.pm from Automake.
        * lib/Autom4te/XFile.pm: Update from Automake.

Index: Makefile.am
===================================================================
RCS file: /cvsroot/autoconf/autoconf/Makefile.am,v
retrieving revision 1.91
diff -u -r1.91 Makefile.am
--- Makefile.am 22 Aug 2003 15:33:47 -0000      1.91
+++ Makefile.am 13 Sep 2003 21:57:27 -0000
@@ -68,7 +68,9 @@
 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 @@
        $(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: lib/Autom4te/XFile.pm
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/Autom4te/XFile.pm,v
retrieving revision 1.7
diff -u -r1.7 XFile.pm
--- lib/Autom4te/XFile.pm       7 May 2003 06:51:25 -0000       1.7
+++ lib/Autom4te/XFile.pm       13 Sep 2003 21:57:27 -0000
@@ -18,8 +18,8 @@
 # Written by Akim Demaille <address@hidden>.
 
 ###############################################################
-# The main copy of this file is in Autoconf's CVS repository. #
-# Updates should be sent to address@hidden         #
+# The main copy of this file is in Automake's CVS repository. #
+# Updates should be sent to address@hidden         #
 ###############################################################
 
 package Autom4te::XFile;
@@ -33,7 +33,7 @@
     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 @@
     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 Carp;
 use IO::File;
 use File::Basename;
+use Autom4te::ChannelDefs;
+use Autom4te::FileUtils;
 
 require Exporter;
 require DynaLoader;
@@ -117,7 +119,7 @@
 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 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 @@
 
   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 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 name
 {
-  my ($fh) = shift;
+  my $fh = shift;
   return ${*$fh}{'autom4te_xfile_file'};
 }
 
@@ -215,7 +219,7 @@
   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 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 @@
   if (!truncate ($fh, $len))
     {
       my $file = $fh->name;
-      croak "$me: cannot truncate $file at $len: $!\n";
+      fatal "cannot truncate $file at $len: $!";
     }
 }
 
-- 
Alexandre Duret-Lutz





reply via email to

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