bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint.mk: avoid echo -e


From: Eric Blake
Subject: [PATCH] maint.mk: avoid echo -e
Date: Wed, 26 May 2010 11:51:03 -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 <address@hidden>
---

Matthias pointed this out to me on IRC, while he was inspecting libvirt.

 ChangeLog    |    7 +++++++
 top/maint.mk |    7 ++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2910717..91f1cf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-26  Eric Blake  <address@hidden>
+
+       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  <address@hidden>

        Update to GNU gettext 0.18, part 2.
diff --git a/top/maint.mk b/top/maint.mk
index 3bcab0c..045537f 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -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,
-- 
1.7.0.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]