From: Bruno Haible Date: Thu, 25 Feb 2010 11:13:28 +0000 (+0100) Subject: Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80cd995cdcbf4b9ded895a43621a11f11806ad8d;p=pspp Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21. --- diff --git a/ChangeLog b/ChangeLog index 0b5ca462f5..0c9e14f8d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-02-25 Bruno Haible + + Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21. + * gnulib-tool: Define 'echo' as a function only before the ksh alias + setting, not afterwards. + Reported by Ben Walton . + 2010-02-24 Eric Blake bootstrap, git-version-gen: use timestamp diff --git a/gnulib-tool b/gnulib-tool index ba41b6180b..259bb74400 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -727,7 +727,10 @@ fi # For bash >= 2.0: define echo to a function that uses the printf built-in. # For bash < 2.0: define echo to a function that uses cat of a here document. # (There is no win in using 'printf' over 'cat' if it is not a shell built-in.) -if test -z "$have_echo" \ +# Also handle problem 2, specific to bash 3.2, here. +if { test -z "$have_echo" \ + || case "$BASH_VERSION" in 3.2*) true;; *) false;; esac; \ + } \ && test -n "$BASH_VERSION"; then \ if type printf 2>/dev/null | grep / > /dev/null; then # 'printf' is not a shell built-in. @@ -810,15 +813,6 @@ if test -z "$have_echo" \ exec /bin/sh "$0" --no-reexec "$@" exit 127 fi -# Now handle problem 2, specific to bash 3.2. -case "$BASH_VERSION" in - 3.2*) - echo () - { - printf '%s\n' "$*" - } - ;; -esac if test -z "$have_echo"; then func_fatal_error "Shell does not support 'echo' correctly. Please install GNU bash and set the environment variable CONFIG_SHELL to point to it." fi