From ec2dabcf62f33737acbfa8ba7dcca8614a063304 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 2 Jul 2013 18:47:43 -0700 Subject: genmakefile.sh: Change echo to printf for better portability & control Solaris has too many echoes, some which support "-n" to not print newlines, others which simply treat it as another item to echo to stdout. The printf command is more portable, allows us better control over newline insertion and quoting, and easier to read indicators for tabs. After this change, when run on Solaris, the Makefile.cursors produced in the redglass & whiteglass directories by genmakefile.sh are identical to the versions currently checked into git. Signed-off-by: Alan Coopersmith --- genmakefile.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/genmakefile.sh b/genmakefile.sh index 34d0b8b..23b25a7 100755 --- a/genmakefile.sh +++ b/genmakefile.sh @@ -4,26 +4,27 @@ test "x$1" = "x" || . "$1" -echo "# this is a generated file -- do not edit." -echo -echo "CURSORFILES = ${CURSORS}" -echo "CLEANFILES = \$(CURSORFILES)" -echo "cursor_DATA = \$(CURSORFILES)" -echo +printf '# this is a generated file -- do not edit.\n' +printf '\n' +printf 'CURSORFILES = %s\n' "${CURSORS}" +printf 'CLEANFILES = $(CURSORFILES)\n' +printf 'cursor_DATA = $(CURSORFILES)\n' +printf '\n' for i in $CURSORS; do - echo -n "${i}:" + printf '%s:' "${i}" for png in $(cut -d" " -f4 ${i}.cfg); do EXTRA_DIST="${EXTRA_DIST} ${png}" - echo -n " \$(srcdir)/${png}" + printf ' $(srcdir)/%s' "${png}" done - echo - echo " \$(XCURSORGEN) -p \$(srcdir) \$(srcdir)/${i}.cfg ${i}" - echo + printf '\n' + printf '\t$(XCURSORGEN) -p $(srcdir) $(srcdir)/%s.cfg %s\n' \ + "${i}" "${i}" + printf '\n' EXTRA_DIST="${EXTRA_DIST} ${i}.cfg ${i}.xcf" done test "x$DIST" = "x" || EXTRA_DIST="${EXTRA_DIST} ${DIST}" # the lack of space is intentional. -echo "EXTRA_DIST =${EXTRA_DIST}" +printf 'EXTRA_DIST =%s\n' "${EXTRA_DIST}" -- cgit v1.2.3