]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* Makefile.maint (sc_root_tests): Use recommend style s/a/b/ for
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 Jan 2006 00:02:26 +0000 (00:02 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 Jan 2006 00:02:26 +0000 (00:02 +0000)
sed substitutions.
* doc/autoconf.texi (Installation Directory Variables): Use s|a|b|
for file names, again.  Reported by Noah Misch.
(Coding Style): Explain that s|a|b| is preferred for file names.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Prefer s/a/b/.
(AC_OUTPUT_MAKE_DEFS): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Likewise.
* tests/local.at (AT_CHECK_AUTOM4TE): Likewise.

ChangeLog
Makefile.maint
doc/autoconf.texi
lib/autoconf/status.m4
lib/autotest/general.m4
lib/m4sugar/m4sh.m4
tests/local.at

index 4c38b80a38946ffe8987f3872b1c311b8113a478..a054dcca517cbc8695bfb20261d81718a0c9493b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2006-01-05  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * Makefile.maint (sc_root_tests): Use recommend style s/a/b/ for
+       sed substitutions.
+       * doc/autoconf.texi (Installation Directory Variables): Use s|a|b|
+       for file names, again.  Reported by Noah Misch.
+       (Coding Style): Explain that s|a|b| is preferred for file names.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Prefer s/a/b/.
+       (AC_OUTPUT_MAKE_DEFS): Likewise.
+       * lib/autotest/general.m4 (AT_INIT): Likewise.
+       * lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Likewise.
+       * tests/local.at (AT_CHECK_AUTOM4TE): Likewise.
+
        Fix Posix-conformance bugs re use of { command in sed scripts,
        and improve the sed-related documentation a bit.
        * doc/autoconf.texi (Installation Directory Variables): Use
index 8656fbbad6a11491414b80dc9e42ea0ca6889e51..c266b3242e89e99390c83d010714fa6b008d3f16 100644 (file)
@@ -2,7 +2,8 @@
 # This Makefile fragment is shared between the coreutils,
 # CPPI, Bison, and Autoconf.
 
-## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+## Foundation, Inc.
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -207,7 +208,7 @@ sc_prohibit_jm_in_m4:
 sc_root_tests:
        @t1=sc-root.expected; t2=sc-root.actual;                        \
        grep -nl '^PRIV_CHECK_ARG=require-root'                         \
-         $$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1;           \
+         $$($(CVS_LIST) tests) |sed s/tests/./ |sort > $$t1;           \
        sed -n 's,      cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
          $(srcdir)/tests/Makefile.am |sort > $$t2;                     \
        diff -u $$t1 $$t2 || diff=1;                                    \
index ab845f653d8bfa2963ccbdf27bf71f8ff9523258..bcfe4b216c793c6e7adb49afee4d04319e5cfd69 100644 (file)
@@ -2458,8 +2458,8 @@ Makefile snippet similar to:
 @example
 @group
 edit = sed \
-        -e 's,@@datadir[@@],$(pkgdatadir),g' \
-        -e 's,@@prefix[@@],$(prefix),g'
+        -e 's|@@datadir[@@]|$(pkgdatadir)|g' \
+        -e 's|@@prefix[@@]|$(prefix)|g'
 @end group
 
 @group
@@ -9621,7 +9621,13 @@ better than hacking Autoconf @code{:-)}.
 When using @command{sed}, don't use @option{-e} except for indenting
 purposes.  With the @code{s} and @code{y} commands, the preferred
 separator is @samp{/} unless @samp{/} itself might appear in the pattern
-or replacement, in which case you should use @samp{,}.
+or replacement, in which case you should use @samp{|}, or optionally
+@samp{,} if you know the pattern and replacement cannot contain a file
+name.  If none of these characters will do, choose a printable character
+that cannot appear in the pattern or replacement.  Characters from the
+set @samp{"#$&'()*;<=>?`|~} are good choices if the pattern or
+replacement might contain a file name, since they have special meaning
+to the shell and are less likely to occur in file names.
 
 @xref{Macro Definitions}, for details on how to define a macro.  If a
 macro doesn't use @code{AC_REQUIRE} and it is expected to never be the
index 95b53d5325850e5704a10792b04731d23bfff3c8..054b8ca7838a80482967d7e724b36cafafd1ec4b 100644 (file)
@@ -389,7 +389,7 @@ m4_if(_AC_Var, [ac_delim],
 [dnl Just to be on the safe side, claim that $ac_delim is the empty string.
 m4_define([_AC_SED_FRAG],
 m4_defn([_AC_SED_FRAG])dnl
-[s,ac_delim,|#_!!_#|,g
+[s/ac_delim/|#_!!_#|/g
 ])dnl
 m4_define([_AC_SED_CMD_NUM], m4_incr(_AC_SED_CMD_NUM))],
       _AC_Var, [@END@],
@@ -1435,16 +1435,16 @@ m4_define([AC_OUTPUT_MAKE_DEFS],
 cat >confdef2opt.sed <<\_ACEOF
 t clear
 :clear
-s,^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\),-D\1=\2,g
+s/^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
 t quote
-s,^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\),-D\1=\2,g
+s/^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
 t quote
 d
 :quote
-s,[     `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
+s/[     `~#$^&*(){}\\|;'"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
 p
 _ACEOF
 # We use echo to avoid assuming a particular line-breaking character.
index 7bd3d9f127a60de36ad4d7e919f9214ed6a34d35..ec105bac1ece4c9e8a23246eaa19dc05ff1fb9cd 100644 (file)
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.                          -*- Autoconf -*-
 # M4 macros used in building test suites.
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
 # Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -306,14 +306,14 @@ do
     [[0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-])
        at_range_start=`echo $at_option |tr -d '-'`
        at_range=`echo " $at_groups_all " | \
-         sed -e 's,^.* \('$at_range_start' \),\1,'`
+         sed -e 's/^.* \('$at_range_start' \)/\1/'`
        at_groups="$at_groups$at_range "
        ;;
 
     [-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]])
        at_range_end=`echo $at_option |tr -d '-'`
        at_range=`echo " $at_groups_all " | \
-         sed -e 's,\( '$at_range_end'\) .*$,\1,'`
+         sed -e 's/\( '$at_range_end'\) .*$/\1/'`
        at_groups="$at_groups$at_range "
        ;;
 
@@ -331,8 +331,8 @@ do
          at_range_start=$at_tmp
        fi
        at_range=`echo " $at_groups_all " | \
-         sed -e 's,^.*\( '$at_range_start' \),\1,' \
-             -e 's,\( '$at_range_end'\) .*$,\1,'`
+         sed -e 's/^.*\( '$at_range_start' \)/\1/' \
+             -e 's/\( '$at_range_end'\) .*$/\1/'`
        at_groups="$at_groups$at_range "
        ;;
 
index 6dbfb3dcc832f64a4edabdfcb652d38b8a81c359..4dc656104f82907a87ea045956b2e3f5b70d4789 100644 (file)
@@ -773,15 +773,15 @@ _AS_LINENO_WORKS || {
     /[[$]]LINENO/=
   ' <$as_myself |
     sed '
-      s,[[$]]LINENO.*,&-,
+      s/[[$]]LINENO.*/&-/
       t lineno
       b
       :lineno
       N
       :loop
-      s,[[$]]LINENO\([[^'$as_cr_alnum'_]].*\n\)\(.*\),\2\1\2,
+      s/[[$]]LINENO\([[^'$as_cr_alnum'_]].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-\n.*,,
+      s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x $as_me.lineno ||
     AS_ERROR([cannot create $as_me.lineno; rerun with a POSIX shell])
index a6bf2ee691e25ff57664e4500cb3f9b1cf30d504..a6f2cd4070b406a1a3973e42d1a73054e87e4f7f 100644 (file)
@@ -1,6 +1,6 @@
 # M4 macros used in building Autoconf test suites.        -*- Autotest -*-
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
 # Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -91,8 +91,8 @@ m4_define([AT_CHECK_PERL_SYNTAX],
 m4_define([AT_CHECK_AUTOM4TE],
 [AT_CHECK([autom4te $1], [$2], [$3], m4_ifval([$4], [stderr]))
 m4_ifval([$4],
-[AT_CHECK([[sed -e 's,^\([^:]*\): *\([0-9][0-9]*\): *[^:]*m4: ,m4: \1: \2: ,' \
-               -e 's,^[^:]*m4: *\([^:]*\): *\([0-9][0-9]*\): ,m4: \1: \2: ,' \
+[AT_CHECK([[sed -e 's/^\([^:]*\): *\([0-9][0-9]*\): *[^:]*m4: /m4: \1: \2: /' \
+               -e 's/^[^:]*m4: *\([^:]*\): *\([0-9][0-9]*\): /m4: \1: \2: /' \
                -e 's/^autom4te: [^ ]*m4 /autom4te: m4 /' \
                -e 's/^autom4te: [^ ]*m4.exe /autom4te: m4 /' \
                -e 's/ (E[A-Z]*)$//' \