Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21.
authorBruno Haible <bruno@clisp.org>
Thu, 25 Feb 2010 11:13:28 +0000 (12:13 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 25 Feb 2010 11:13:28 +0000 (12:13 +0100)
ChangeLog
gnulib-tool

index 0b5ca462f55f9babd11c4068a6b259d9b759c74c..0c9e14f8d8a55852fb3ca386da182340f8c3b854 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-02-25  Bruno Haible  <bruno@clisp.org>
+
+       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 <bwalton@artsci.utoronto.ca>.
+
 2010-02-24  Eric Blake  <eblake@redhat.com>
 
        bootstrap, git-version-gen: use timestamp
index ba41b6180b5b9742ec9c6b402f91b1a6fe02eaf4..259bb74400fd2e9829c99021691aecca71c155f3 100755 (executable)
@@ -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