# HG changeset patch # User Bruno Haible # Date 1235787317 -3600 # Node ID 30f41a946fb04325efbb8f59cb2e7368bb9cc34a # Parent b07f7aa4a1fd94de77ccef4b2a41d1d91d13206e Don't use "sed --posix", since it is buggy. diff -r b07f7aa4a1fd -r 30f41a946fb0 ChangeLog --- a/ChangeLog Fri Feb 27 23:03:15 2009 +0100 +++ b/ChangeLog Sat Feb 28 03:15:17 2009 +0100 @@ -1,3 +1,8 @@ +2009-02-27 Bruno Haible + + * gnulib-tool (sed): Don't alias as "sed --posix". + Reported by Eric Blake. + 2009-02-27 Bruno Haible Avoid test link errors. diff -r b07f7aa4a1fd -r 30f41a946fb0 gnulib-tool --- a/gnulib-tool Fri Feb 27 23:03:15 2009 +0100 +++ b/gnulib-tool Sat Feb 28 03:15:17 2009 +0100 @@ -63,24 +63,28 @@ AUTOPOINT="${GETTEXTPATH}autopoint" fi -# When using GNU sed, turn off as many GNU extensions as possible, -# to minimize the risk of accidentally using non-portable features. -# However, do this only for gnulib-tool itself, not for the code that -# gnulib-tool generates, since we don't want "sed --posix" to leak -# into makefiles. -if (alias) > /dev/null 2>&1 && echo | sed --posix -e d >/dev/null 2>&1; then - # Define sed as an alias. - # It is not always possible to use aliases. Aliases are guaranteed to work - # if the executing shell is bash and either it is invoked as /bin/sh or - # is a version >= 2.0, supporting shopt. This is the common case. - # Two other approaches (use of a variable $sed or of a function func_sed - # instead of an alias) require massive, fragile code changes. - # An other approach (use of function sed) requires `which sed` - but 'which' - # is hard to emulate, due to missing "test -x" on some platforms. - if test -n "$BASH_VERSION"; then - shopt -s expand_aliases >/dev/null 2>&1 +# Disabled because "sed --posix" is buggy in GNU sed 4.1.5, see +# . +if false; then + # When using GNU sed, turn off as many GNU extensions as possible, + # to minimize the risk of accidentally using non-portable features. + # However, do this only for gnulib-tool itself, not for the code that + # gnulib-tool generates, since we don't want "sed --posix" to leak + # into makefiles. + if (alias) > /dev/null 2>&1 && echo | sed --posix -e d >/dev/null 2>&1; then + # Define sed as an alias. + # It is not always possible to use aliases. Aliases are guaranteed to work + # if the executing shell is bash and either it is invoked as /bin/sh or + # is a version >= 2.0, supporting shopt. This is the common case. + # Two other approaches (use of a variable $sed or of a function func_sed + # instead of an alias) require massive, fragile code changes. + # An other approach (use of function sed) requires `which sed` - but + # 'which' is hard to emulate, due to missing "test -x" on some platforms. + if test -n "$BASH_VERSION"; then + shopt -s expand_aliases >/dev/null 2>&1 + fi + alias sed='sed --posix' fi - alias sed='sed --posix' fi # sed_noop is a sed expression that does nothing.