From: Colin Walters Date: Wed, 22 Jun 2011 19:53:42 +0000 (-0400) Subject: gnome-autogen.sh: Don't print terminal codes if stdin isn't a tty X-Git-Tag: 3.1.0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2F3.1.0;p=platform%2Fupstream%2Fgnome-common.git gnome-autogen.sh: Don't print terminal codes if stdin isn't a tty Otherwise this shows up as garbage in log files. --- diff --git a/macros2/gnome-autogen.sh b/macros2/gnome-autogen.sh index ead647a..9967f89 100644 --- a/macros2/gnome-autogen.sh +++ b/macros2/gnome-autogen.sh @@ -36,8 +36,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 "$@"