]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
`autoconf --trace' dies on filenames with `:'.
authorAkim Demaille <akim@epita.fr>
Fri, 9 Jun 2000 10:02:19 +0000 (10:02 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 9 Jun 2000 10:02:19 +0000 (10:02 +0000)
Reported by Mark Elbrecht.

* autoconf.sh <trace> (trace2m4.sed): Use `..*' instead of
`[^:][^:]*' to catch file names.  The rest of regex is probably
precise enough to avoid incorrect parsing.

ChangeLog
autoconf.in
autoconf.sh
bin/autoconf.in

index 46b35b0b42ddd78da04c4b2339c1d3f6b47556d7..0c13bbe2497bb61afd4216cb8b6c7c6800e8d782 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2000-06-09  Akim Demaille  <akim@epita.fr>
+
+       `autoconf --trace' dies on filenames with `:'.
+       Reported by Mark Elbrecht.
+
+       * autoconf.sh <trace> (trace2m4.sed): Use `..*' instead of
+       `[^:][^:]*' to catch file names.  The rest of regex is probably
+       precise enough to avoid incorrect parsing.
+
 2000-06-09  Akim Demaille  <akim@epita.fr>
 
        * acspecific.m4 (_AC_SYS_LARGEFILE_MACRO_VALUE): Always initialize
index 320e49a974cc57e0e65a4f98e23b0cb18202bef2..fec48d3e980475dfc6415c6e86e7eb815fca93b5 100644 (file)
@@ -374,6 +374,22 @@ divert(-1)
   define([star],    [_$0([$1], args($@))])
 EOF
 
+  # trace2m4.sed
+  # ------------
+  # Transform the traces from m4 into an m4 input file.
+  # Typically, transform:
+  # | m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE])
+  # into
+  # | AT_AC_SUBST([configure.in], [3], [1], [AC_SUBST], [exec_prefix], [NONE])
+  # Pay attention that the file name might include colons, if under DOS
+  # for instance, so we don't use `[^:][^:]*'.
+  # The first s/// catches multiline traces, the second, traces as above.
+  preamble='m4trace:\(..*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)-'
+  cat >$tmp/trace2m4.sed <<EOF
+  s/^$preamble \([^(][^(]*\)(\(.*\)$/AT_\4([\1], [\2], [\3], [\4], \5/
+  s/^$preamble \(.*\)$/AT_\4([\1], [\2], [\3], [\4])/
+EOF
+
   # translate.awk
   # -------------
   # Translate user tracing requests into m4 macros.
@@ -501,8 +517,7 @@ EOF
   # Run m4 on the input file to get traces.
   $verbose "Running $run_m4_trace $infile | $M4 $tmp/trace.m4" >&2
   $run_m4_trace $infile 2>&1 >/dev/null |
-    sed -e 's/^m4trace:\([^:][^:]*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)- \([^(][^(]*\)(\(.*\)$/AT_\4([\1], [\2], [\3], [\4], \5/' \
-        -e 's/^m4trace:\([^:][^:]*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)- \(.*\)$/AT_\4([\1], [\2], [\3], [\4])/' |
+    sed -f $tmp/trace2m4.sed |
     # Now we are ready to run m4 to process the trace file.
     $M4 $tmp/trace.m4 - |
     # It makes no sense to try to transform __oline__.
index 320e49a974cc57e0e65a4f98e23b0cb18202bef2..fec48d3e980475dfc6415c6e86e7eb815fca93b5 100644 (file)
@@ -374,6 +374,22 @@ divert(-1)
   define([star],    [_$0([$1], args($@))])
 EOF
 
+  # trace2m4.sed
+  # ------------
+  # Transform the traces from m4 into an m4 input file.
+  # Typically, transform:
+  # | m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE])
+  # into
+  # | AT_AC_SUBST([configure.in], [3], [1], [AC_SUBST], [exec_prefix], [NONE])
+  # Pay attention that the file name might include colons, if under DOS
+  # for instance, so we don't use `[^:][^:]*'.
+  # The first s/// catches multiline traces, the second, traces as above.
+  preamble='m4trace:\(..*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)-'
+  cat >$tmp/trace2m4.sed <<EOF
+  s/^$preamble \([^(][^(]*\)(\(.*\)$/AT_\4([\1], [\2], [\3], [\4], \5/
+  s/^$preamble \(.*\)$/AT_\4([\1], [\2], [\3], [\4])/
+EOF
+
   # translate.awk
   # -------------
   # Translate user tracing requests into m4 macros.
@@ -501,8 +517,7 @@ EOF
   # Run m4 on the input file to get traces.
   $verbose "Running $run_m4_trace $infile | $M4 $tmp/trace.m4" >&2
   $run_m4_trace $infile 2>&1 >/dev/null |
-    sed -e 's/^m4trace:\([^:][^:]*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)- \([^(][^(]*\)(\(.*\)$/AT_\4([\1], [\2], [\3], [\4], \5/' \
-        -e 's/^m4trace:\([^:][^:]*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)- \(.*\)$/AT_\4([\1], [\2], [\3], [\4])/' |
+    sed -f $tmp/trace2m4.sed |
     # Now we are ready to run m4 to process the trace file.
     $M4 $tmp/trace.m4 - |
     # It makes no sense to try to transform __oline__.
index 320e49a974cc57e0e65a4f98e23b0cb18202bef2..fec48d3e980475dfc6415c6e86e7eb815fca93b5 100644 (file)
@@ -374,6 +374,22 @@ divert(-1)
   define([star],    [_$0([$1], args($@))])
 EOF
 
+  # trace2m4.sed
+  # ------------
+  # Transform the traces from m4 into an m4 input file.
+  # Typically, transform:
+  # | m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE])
+  # into
+  # | AT_AC_SUBST([configure.in], [3], [1], [AC_SUBST], [exec_prefix], [NONE])
+  # Pay attention that the file name might include colons, if under DOS
+  # for instance, so we don't use `[^:][^:]*'.
+  # The first s/// catches multiline traces, the second, traces as above.
+  preamble='m4trace:\(..*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)-'
+  cat >$tmp/trace2m4.sed <<EOF
+  s/^$preamble \([^(][^(]*\)(\(.*\)$/AT_\4([\1], [\2], [\3], [\4], \5/
+  s/^$preamble \(.*\)$/AT_\4([\1], [\2], [\3], [\4])/
+EOF
+
   # translate.awk
   # -------------
   # Translate user tracing requests into m4 macros.
@@ -501,8 +517,7 @@ EOF
   # Run m4 on the input file to get traces.
   $verbose "Running $run_m4_trace $infile | $M4 $tmp/trace.m4" >&2
   $run_m4_trace $infile 2>&1 >/dev/null |
-    sed -e 's/^m4trace:\([^:][^:]*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)- \([^(][^(]*\)(\(.*\)$/AT_\4([\1], [\2], [\3], [\4], \5/' \
-        -e 's/^m4trace:\([^:][^:]*\):\([0-9][0-9]*\): -\([0-9][0-9]*\)- \(.*\)$/AT_\4([\1], [\2], [\3], [\4])/' |
+    sed -f $tmp/trace2m4.sed |
     # Now we are ready to run m4 to process the trace file.
     $M4 $tmp/trace.m4 - |
     # It makes no sense to try to transform __oline__.