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
$(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 \
autom4te_files = \
Autom4te/Configure_ac.pm \
Autom4te/Channels.pm \
- Autom4te/FileUtils.pm
+ Autom4te/FileUtils.pm \
+ Autom4te/Struct.pm \
+ Autom4te/XFile.pm
all: all-recursive
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
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
$(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 \
# 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;
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;
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.
use Carp;
use IO::File;
use File::Basename;
+use Autom4te::ChannelDefs;
+use Autom4te::FileUtils;
require Exporter;
require DynaLoader;
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 (@_)
{
sub open
{
- my ($fh) = shift;
+ my $fh = shift;
my ($file) = @_;
# WARNING: Gross hack: $FH is a typeglob: use its hash slot to store
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.
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: $!";
}
}
sub name
{
- my ($fh) = shift;
+ my $fh = shift;
return ${*$fh}{'autom4te_xfile_file'};
}
if (!flock ($fh, $mode))
{
my $file = $fh->name;
- croak "$me: cannot lock $file with mode $mode: $!\n";
+ fatal "cannot lock $file with mode $mode: $!";
}
}
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 @_: $!";
}
}
if (!truncate ($fh, $len))
{
my $file = $fh->name;
- croak "$me: cannot truncate $file at $len: $!\n";
+ fatal "cannot truncate $file at $len: $!";
}
}