POSIX doesn't require s/[^/]// to work.

From Paul Eggert and Johan Danielsson.
* doc/autoconf.texi (Limitations of Usual Tools) <sed>:
Reorganize.  Document this issue.
* autoupdate.sh (dir): Use `,' as separator instead of `/'
* autoreconf.sh: Likewise.
* autoupdate.sh: Ditto.
This commit is contained in:
Akim Demaille 2000-11-16 10:12:50 +00:00
parent ae4c79d264
commit 5eb1d8aeb6
8 changed files with 39 additions and 25 deletions

View File

@ -1,3 +1,14 @@
2000-11-16 Akim Demaille <akim@epita.fr>
POSIX doesn't require s/[^/]// to work.
From Paul Eggert and Johan Danielsson.
* doc/autoconf.texi (Limitations of Usual Tools) <sed>:
Reorganize. Document this issue.
* autoupdate.sh (dir): Use `,' as separator instead of `/'
* autoreconf.sh: Likewise.
* autoupdate.sh: Ditto.
2000-11-16 Paul Eggert <eggert@twinsun.com>
* m4/largefile.m4 (_AC_SYS_LARGEFILE_SOURCE): Remove, replaced by...

View File

@ -81,7 +81,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
dir=`echo "$0" | sed -e 's/[^/]*$//'`
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
# We test "$dir/autoconf" in case we are in the build tree, in which case
# the names are not transformed yet.
for autoconf in "$AUTOCONF" \
@ -293,7 +293,7 @@ test -r $config_h.top && cat $config_h.top >>$tmp/config.hin
# Dump `acconfig.h' but its bottom.
test -r $localdir/acconfig.h &&
sed -e '/@BOTTOM@/,$d' -e 's/@TOP@//' $localdir/acconfig.h >>$tmp/config.hin
sed '/@BOTTOM@/,$d;s/@TOP@//' $localdir/acconfig.h >>$tmp/config.hin
# Dump the templates from `configure.in'.
for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p' | sort`; do

View File

@ -81,7 +81,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
dir=`echo "$0" | sed -e 's/[^/]*$//'`
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
# We test "$dir/autoconf" in case we are in the build tree, in which case
# the names are not transformed yet.
for autoconf in "$AUTOCONF" \
@ -293,7 +293,7 @@ test -r $config_h.top && cat $config_h.top >>$tmp/config.hin
# Dump `acconfig.h' but its bottom.
test -r $localdir/acconfig.h &&
sed -e '/@BOTTOM@/,$d' -e 's/@TOP@//' $localdir/acconfig.h >>$tmp/config.hin
sed '/@BOTTOM@/,$d;s/@TOP@//' $localdir/acconfig.h >>$tmp/config.hin
# Dump the templates from `configure.in'.
for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p' | sort`; do

View File

@ -91,7 +91,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
debug=false
dir=`echo "$0" | sed -e 's/[^/]*$//'`
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
force=false
# --install -- as --add-missing in other tools.
install=false

View File

@ -91,7 +91,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
debug=false
dir=`echo "$0" | sed -e 's/[^/]*$//'`
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
force=false
# --install -- as --add-missing in other tools.
install=false

View File

@ -81,7 +81,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
dir=`echo "$0" | sed -e 's/[^/]*$//'`
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
# We test "$dir/autoconf" in case we are in the build tree, in which case
# the names are not transformed yet.
for autoconf in "$AUTOCONF" \
@ -293,7 +293,7 @@ test -r $config_h.top && cat $config_h.top >>$tmp/config.hin
# Dump `acconfig.h' but its bottom.
test -r $localdir/acconfig.h &&
sed -e '/@BOTTOM@/,$d' -e 's/@TOP@//' $localdir/acconfig.h >>$tmp/config.hin
sed '/@BOTTOM@/,$d;s/@TOP@//' $localdir/acconfig.h >>$tmp/config.hin
# Dump the templates from `configure.in'.
for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p' | sort`; do

View File

@ -91,7 +91,7 @@ if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
# Variables.
: ${autoconf_dir=${AC_MACRODIR=@datadir@}}
debug=false
dir=`echo "$0" | sed -e 's/[^/]*$//'`
dir=`echo "$0" | sed -e 's,[^/]*$,,'`
force=false
# --install -- as --add-missing in other tools.
install=false

View File

@ -5885,8 +5885,26 @@ don't rely on symbolic links on @sc{djgpp}.
@item @command{sed}
@cindex @command{sed}
Patterns should not include the separator (unless escaped), even as part
of a character class. In conformance with @sc{posix}, the Cray
@command{sed} will reject @samp{s/[^/]*$//}: use @samp{s,[^/]*$,,}.
Sed scripts should not use branch labels longer than 8 characters and
should not contain comments.
Input should have reasonably long lines, since some @command{sed} have
an input buffer limited to 4000 bytes.
Alternation, @samp{\|}, is common but not portable.
@c FIXME: I know Solaris is guilty, but I don't remember how.
Anchors (@samp{^} and @samp{$}) inside groups are not portable.
Nested groups are extremely portable, but there is at least one
@command{sed} (System V/68 Base Operating System R3V7.1) that does not
support it.
Of course the option @option{-e} is portable, but it is not needed. No
valid @command{sed} program can start with a dash, so it does not help
valid Sed program can start with a dash, so it does not help
disambiguating. Its sole usefulness is helping enforcing indenting as
in:
@ -5906,21 +5924,6 @@ Contrary to yet another urban legend, you may portably use @samp{&} in
the replacement part of the @code{s} command to mean ``what was
matched''.
@command{sed} scripts should not use branch labels longer than 8
characters and should not contain comments.
@command{sed} input should have reasonably long lines, since some
@command{sed} have an input buffer limited to 4000 bytes.
Alternation, @samp{\|}, is common but not portable.
Nested groups are extremely portable, but there is at least one
@command{sed} (System V/68 Base Operating System R3V7.1) that does not
support it.
Anchors (@samp{^} and @samp{$}) inside groups are not portable.
@c FIXME: I know Solaris is guilty, but I don't remember how.
@item @command{sed} (@samp{t})
@cindex @command{sed} (@samp{t})