maint.mk: avoid echo -e
authorEric Blake <eblake@redhat.com>
Wed, 26 May 2010 17:47:22 +0000 (11:47 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 26 May 2010 17:47:22 +0000 (11:47 -0600)
There are still other potentially non-portable uses of echo
throughout this file, if $(ME) contains \ or starts with -,
but this patch is a trivial step in the right direction.

* top/maint.mk (gzip_rsyncable): Convert all uses of echo -* to
printf.
Reported by Matthias Bolte.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
top/maint.mk

index 29107170af690d3c4131af13b4fcf4e99381bb52..91f1cf153ab8a34f217d2def98c6731e605b0232 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-26  Eric Blake  <eblake@redhat.com>
+
+       maint.mk: avoid echo -e
+       * top/maint.mk (gzip_rsyncable): Convert all uses of echo -* to
+       printf.
+       Reported by Matthias Bolte.
+
 2010-05-25  Bruno Haible  <bruno@clisp.org>
 
        Update to GNU gettext 0.18, part 2.
index 3bcab0c2d82706eb1e6be66bf0164db89d273c2e..045537f8ac488ea4c751a0c4c84547ac86d6dc14 100644 (file)
@@ -27,7 +27,8 @@ build_aux ?= $(srcdir)/build-aux
 # Do not save the original name or timestamp in the .tar.gz file.
 # Use --rsyncable if available.
 gzip_rsyncable := \
-  $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
+  $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \
+    && printf %s --rsyncable)
 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
 
 GIT = git
@@ -187,11 +188,11 @@ syntax-check: $(local-check)
 
 # By default, _sc_search_regexp does not ignore case.
 export ignore_case =
-_ignore_case = $$(test -n "$$ignore_case" && echo -i || :)
+_ignore_case = $$(test -n "$$ignore_case" && printf %s -i || :)
 
 define _sc_say_and_exit
    dummy=; : so we do not need a semicolon before each use;            \
-   { echo -e "$(ME): $$msg" 1>&2; exit 1; };
+   { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; };
 endef
 
 # _sc_search_regexp used to be named _prohibit_regexp.  However,