summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-02 18:47:43 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-02 18:49:54 -0700
commitec2dabcf62f33737acbfa8ba7dcca8614a063304 (patch)
tree894368b91505c282a943a34141db6ce4e695971b
parent9efb1bb60a8190ffb7b2b9389749795c2b092a6a (diff)
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 <alan.coopersmith@oracle.com>
-rwxr-xr-xgenmakefile.sh25
1 files 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}"