From 4c625cd5209062aaba6eecdb95b47a219ae7c746 Mon Sep 17 00:00:00 2001 From: infirit Date: Fri, 3 Jan 2014 15:00:52 +0100 Subject: mate-autogen: Don't print terminal codes if stdin isn't a tty Otherwise this shows up as garbage in log files. Based on GNOME commit: https://git.gnome.org/browse/gnome-common/commit/?id=7f977b0214623142819c8b7a08839949fb9f3ec0 --- macros/mate-autogen | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/macros/mate-autogen b/macros/mate-autogen index 6907f6e..de3ddb6 100644 --- a/macros/mate-autogen +++ b/macros/mate-autogen @@ -51,8 +51,13 @@ case `echo -n x` in esac # some terminal codes ... -boldface="`tput bold 2>/dev/null`" -normal="`tput sgr0 2>/dev/null`" +if tty < /dev/null 1>/dev/null 2>&1; then + boldface="`tput bold 2>/dev/null`" + normal="`tput sgr0 2>/dev/null`" +else + boldface= + normal= +fi printbold() { echo $ECHO_N "$boldface" $ECHO_C echo "$@" -- cgit v1.2.1