From: Alexandre Duret-Lutz Date: Sat, 13 Sep 2003 22:00:36 +0000 (+0000) Subject: * Makefile.am (autom4te-update, autom4te_files): Fetch Struct.pm X-Git-Tag: AUTOCONF-2.57d~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=033b8cecbdc453dddd1c06f542a4f4281668dacf;p=thirdparty%2Fautoconf.git * Makefile.am (autom4te-update, autom4te_files): Fetch Struct.pm and XFile.pm from Automake. * lib/Autom4te/XFile.pm: Update from Automake. --- diff --git a/ChangeLog b/ChangeLog index b1528da0..39f98970 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-09-13 Alexandre Duret-Lutz + + * 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 Version 2.57c. diff --git a/Makefile.am b/Makefile.am index b24b06df..fb30c00e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/Makefile.in b/Makefile.in index a5d2a259..40ec909c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 \ diff --git a/lib/Autom4te/XFile.pm b/lib/Autom4te/XFile.pm index 1009ee6d..6be641d6 100644 --- a/lib/Autom4te/XFile.pm +++ b/lib/Autom4te/XFile.pm @@ -18,8 +18,8 @@ # Written by Akim Demaille . ############################################################### -# 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: $!"; } }