# only the name of the macro.
%symbol = map { s/\(.*//; $_ => 1 } keys %symbol;
-my $out = new Autom4te::XFile ("> " . open_quote ("$tmp/config.hin"));
+my $out = new Autom4te::XFile ("$tmp/config.hin", ">");
# Don't write "do not edit" -- it will get copied into the
# config.h, which it's ok to edit.
# Dump the top.
if ($config_h_top)
{
- my $in = new Autom4te::XFile ("< " . open_quote ($config_h_top));
+ my $in = new Autom4te::XFile ($config_h_top, "<");
while ($_ = $in->getline)
{
print $out $_;
# Dump 'acconfig.h', except for its bottom portion.
if ($acconfig_h)
{
- my $in = new Autom4te::XFile ("< " . open_quote ($acconfig_h));
+ my $in = new Autom4te::XFile ($acconfig_h, "<");
while ($_ = $in->getline)
{
last if /\@BOTTOM\@/;
# Dump bottom portion of 'acconfig.h'.
if ($acconfig_h)
{
- my $in = new Autom4te::XFile ("< " . open_quote ($acconfig_h));
+ my $in = new Autom4te::XFile ($acconfig_h, "<");
my $dump = 0;
while ($_ = $in->getline)
{
# Dump the bottom.
if ($config_h_bot)
{
- my $in = new Autom4te::XFile ("< " . open_quote ($config_h_bot));
+ my $in = new Autom4te::XFile ($config_h_bot, "<");
while ($_ = $in->getline)
{
print $out $_;
# Check that all the symbols have a template.
{
- my $in = new Autom4te::XFile ("< " . open_quote ("$tmp/config.hin"));
+ my $in = new Autom4te::XFile ("$tmp/config.hin", "<");
my $suggest_ac_define = 1;
while ($_ = $in->getline)
{
my ($file) = @_;
use Text::ParseWords;
- my $cfg = new Autom4te::XFile ("< " . open_quote ($file));
+ my $cfg = new Autom4te::XFile ($file, "<");
my $lang;
while ($_ = $cfg->getline)
{
handle_traces ($req, "$tmp/patterns",
('m4_pattern_forbid' => 'forbid:$1:$2',
'm4_pattern_allow' => 'allow:$1'));
- my @patterns = new Autom4te::XFile ("< " . open_quote ("$tmp/patterns"))->getlines;
+ my @patterns = new Autom4te::XFile ("$tmp/patterns", "<")->getlines;
chomp @patterns;
my %forbidden =
map { /^forbid:([^:]+):.+$/ => /^forbid:[^:]+:(.+)$/ } @patterns;
}
fatal "cannot create $output: $!"
unless $out;
- my $in = new Autom4te::XFile ("< " . open_quote ($ocache . $req->id));
+ my $in = new Autom4te::XFile ($ocache . $req->id, "<");
my %prohibited;
my $res;
if ($ARGV[$#ARGV] ne '-')
{
my $prohibited = '\b(' . join ('|', keys %prohibited) . ')\b';
- my $file = new Autom4te::XFile ("< " . open_quote ($ARGV[$#ARGV]));
+ my $file = new Autom4te::XFile ($ARGV[$#ARGV], "<");
while ($_ = $file->getline)
{
verb "formatting traces for '$output': " . join (', ', sort keys %trace);
# Processing the traces.
- my $trace_m4 = new Autom4te::XFile ("> " . open_quote ("$tmp/traces.m4"));
+ my $trace_m4 = new Autom4te::XFile ("$tmp/traces.m4", ">");
$_ = <<'EOF';
divert(-1)
#
# Pay attention that the file name might include colons, if under DOS
# for instance, so we don't use '[^:]+'.
- my $traces = new Autom4te::XFile ("< " . open_quote ($tcache . $req->id));
+ my $traces = new Autom4te::XFile ($tcache . $req->id, "<");
while ($_ = $traces->getline)
{
# Trace with arguments, as the example above. We don't try
$trace_m4->close;
my $in = new Autom4te::XFile ("$m4 " . shell_quote ("$tmp/traces.m4") . " |");
- my $out = new Autom4te::XFile ("> " . open_quote ($output));
+ my $out = new Autom4te::XFile ($output, ">");
# This is dubious: should we really transform the quadrigraphs in
# traces? It might break balanced [ ] etc. in the output. The
handle_traces ($req, "$tmp/dependencies",
('include' => '$1',
'm4_include' => '$1'));
- my $deps = new Autom4te::XFile ("< " . open_quote ("$tmp/dependencies"));
+ my $deps = new Autom4te::XFile ("$tmp/dependencies", "<");
while ($_ = $deps->getline)
{
chomp;
my $uses_gettext;
if (-f $configure_ac)
{
- my $configure_ac_file = new Autom4te::XFile "< $configure_ac";
+ my $configure_ac_file = new Autom4te::XFile ("$configure_ac", "<");
while ($_ = $configure_ac_file->getline)
{
s/#.*//;
# instead of duplicating the code in lots of configure.ac files.
my $file = find_file ("autoscan/autoscan.list",
reverse (@prepend_include), @include);
- my $table = new Autom4te::XFile "< " . open_quote ($file);
+ my $table = new Autom4te::XFile ($file, "<");
my $tables_are_consistent = 1;
while ($_ = $table->getline)
# Nonzero if in a multiline comment.
my $in_comment = 0;
- my $file = new Autom4te::XFile "< " . open_quote ($file_name);
+ my $file = new Autom4te::XFile ($file_name, "<");
while ($_ = $file->getline)
{
my ($file_name) = @_;
push @makefiles, $File::Find::name;
- my $file = new Autom4te::XFile "< " . open_quote ($file_name);
+ my $file = new Autom4te::XFile ($file_name, "<");
while ($_ = $file->getline)
{
my ($file_name) = @_;
push @shfiles, $File::Find::name;
- my $file = new Autom4te::XFile "< " . open_quote ($file_name);
+ my $file = new Autom4te::XFile ($file_name, "<");
while ($_ = $file->getline)
{
my $configure_scan = shift;
my %unique_makefiles;
- my $file = new Autom4te::XFile "> " . open_quote ($configure_scan);
+ my $file = new Autom4te::XFile ($configure_scan, ">");
print $file
("# -*- Autoconf -*-\n" .
## -------------- ##
parse_args;
-$log = new Autom4te::XFile "> " . open_quote ("$me.log");
+$log = new Autom4te::XFile ("$me.log", ">");
$autoconf .= " --debug" if $debug;
$autoconf .= " --verbose" if $verbose;
{
# Get the builtins.
xsystem ("echo dumpdef | $m4 2>" . shell_quote ("$tmp/m4.defs") . " >/dev/null");
- my $m4_defs = new Autom4te::XFile "< " . open_quote ("$tmp/m4.defs");
+ my $m4_defs = new Autom4te::XFile ("$tmp/m4.defs", "<");
while ($_ = $m4_defs->getline)
{
$m4_builtins{$1} = 1
# ac.m4 -- autoquoting definitions of the AC macros (M4sugar excluded).
# unac.m4 -- undefine the AC macros.
- my $ac_m4 = new Autom4te::XFile "> " . open_quote ("$tmp/ac.m4");
+ my $ac_m4 = new Autom4te::XFile ("$tmp/ac.m4", ">");
print $ac_m4 "# ac.m4 -- autoquoting definitions of the AC macros.\n";
- my $unac_m4 = new Autom4te::XFile "> " . open_quote ("$tmp/unac.m4");
+ my $unac_m4 = new Autom4te::XFile ("$tmp/unac.m4", ">");
print $unac_m4 "# unac.m4 -- undefine the AC macros.\n";
foreach (sort keys %ac_macros)
{
# m4save.m4 -- save the m4 builtins.
# unm4.m4 -- disable the m4 builtins.
# m4.m4 -- enable the m4 builtins.
- my $m4save_m4 = new Autom4te::XFile "> " . open_quote ("$tmp/m4save.m4");
+ my $m4save_m4 = new Autom4te::XFile ("$tmp/m4save.m4", ">");
print $m4save_m4 "# m4save.m4 -- save the m4 builtins.\n";
- my $unm4_m4 = new Autom4te::XFile "> " . open_quote ("$tmp/unm4.m4");
+ my $unm4_m4 = new Autom4te::XFile ("$tmp/unm4.m4", ">");
print $unm4_m4 "# unm4.m4 -- disable the m4 builtins.\n";
- my $m4_m4 = new Autom4te::XFile "> " . open_quote ("$tmp/m4.m4");
+ my $m4_m4 = new Autom4te::XFile ("$tmp/m4.m4", ">");
print $m4_m4 "# m4.m4 -- enable the m4 builtins.\n";
foreach (sort keys %m4_builtins)
{
$input_m4 =~ s/\$file/$file/g;
# prepared input -- input, but reenables the quote before each AU macro.
- open INPUT_M4, "> " . open_quote ("$tmp/input.m4")
+ open INPUT_M4, ">", "$tmp/input.m4"
or error "cannot open: $!";
- open FILE, "< " . open_quote ($file)
+ open FILE, "<", $file
or error "cannot open: $!";
print INPUT_M4 "$input_m4";
while (<FILE>)
sub scan_file ($)
{
my ($file_name) = @_;
- my $file = new Autom4te::XFile ("< " . open_quote ($file_name));
+ my $file = new Autom4te::XFile ($file_name, "<");
while ($_ = $file->getline)
{
# Continuation lines.