]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
port to new Autom4te::XFile API
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Feb 2016 20:56:55 +0000 (12:56 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 7 Feb 2016 01:17:49 +0000 (17:17 -0800)
bin/autoheader.in
bin/autom4te.in
bin/autoreconf.in
bin/autoscan.in
bin/autoupdate.in
bin/ifnames.in

index 8c70663dacb94954cf4a548e32f8919d67ba3874..5e8b128ea28c4ff2768c7a984338965f173e6984 100644 (file)
@@ -201,7 +201,7 @@ $config_h_in ||= "$config_h.in";
 # 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.
@@ -210,7 +210,7 @@ print $out "/* $config_h_in.  Generated from $ARGV[0] by autoheader.  */\n";
 # 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 $_;
@@ -220,7 +220,7 @@ if ($config_h_top)
 # 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\@/;
@@ -238,7 +238,7 @@ foreach (sort keys %verbatim)
 # 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)
       {
@@ -250,7 +250,7 @@ if ($acconfig_h)
 # 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 $_;
@@ -261,7 +261,7 @@ $out->close;
 
 # 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)
     {
index 798013a584a5b9099f6a032441cbb1cfc1a7d89c..a459e520addd2bb1f050d035cdc16126dfa42a5b 100644 (file)
@@ -258,7 +258,7 @@ sub load_configuration ($)
   my ($file) = @_;
   use Text::ParseWords;
 
-  my $cfg = new Autom4te::XFile ("< " . open_quote ($file));
+  my $cfg = new Autom4te::XFile ($file, "<");
   my $lang;
   while ($_ = $cfg->getline)
     {
@@ -527,7 +527,7 @@ sub handle_output ($$)
   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;
@@ -554,7 +554,7 @@ sub handle_output ($$)
     }
   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;
@@ -599,7 +599,7 @@ sub handle_output ($$)
   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)
        {
@@ -717,7 +717,7 @@ sub handle_traces ($$%)
   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)
@@ -818,7 +818,7 @@ EOF
   #
   # 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
@@ -834,7 +834,7 @@ EOF
   $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
@@ -896,7 +896,7 @@ sub up_to_date ($)
   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;
index 9f353b09c3d161df65e219084451b1264eea4747..84e327b9ec7e81e07ab0549c5f9e5fbc3e4f6a90 100644 (file)
@@ -257,7 +257,7 @@ sub autoreconf_current_directory ()
   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/#.*//;
index 5a3344dceaeeda44ba55724b2177a7609d2bef43..e47c2130381b79119e1fcaef5dc7c4cb241fef3a 100644 (file)
@@ -169,7 +169,7 @@ sub init_tables ()
   # 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)
@@ -244,7 +244,7 @@ sub scan_c_file ($)
   # 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)
     {
@@ -310,7 +310,7 @@ sub scan_makefile ($)
   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)
     {
@@ -352,7 +352,7 @@ sub scan_sh_file ($)
   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)
     {
@@ -521,7 +521,7 @@ sub output ($)
   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" .
@@ -639,7 +639,7 @@ sub check_configure_ac ($)
 ## -------------- ##
 
 parse_args;
-$log = new Autom4te::XFile "> " . open_quote ("$me.log");
+$log = new Autom4te::XFile ("$me.log", ">");
 
 $autoconf .= " --debug" if $debug;
 $autoconf .= " --verbose" if $verbose;
index 75397a9856127353a5046c02acf80ef6afd1857e..e9833bab7b86b5796d959d8c7529fbaef59c43ba 100644 (file)
@@ -130,7 +130,7 @@ sub handle_autoconf_macros ()
 {
   # 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
@@ -186,9 +186,9 @@ sub handle_autoconf_macros ()
 
   # 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)
     {
@@ -199,11 +199,11 @@ sub handle_autoconf_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)
     {
@@ -381,9 +381,9 @@ EOF
     $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>)
index 2910370a06108b79a61c80943a94dc40cee16596..00f29fd6b4b8f42a66a5ada6c19219283e8c9722 100644 (file)
@@ -96,7 +96,7 @@ my %occurrence;
 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.