changeset 12903:82f649e8c371

Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21.
author Bruno Haible <bruno@clisp.org>
date Thu, 25 Feb 2010 12:13:28 +0100
parents 74f6f4021fe0
children 8a8780d00ba8
files ChangeLog gnulib-tool
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -727,7 +727,10 @@
 # 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 @@
   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