summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-20 07:15:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-20 07:15:04 +0000
commite4879592873abd4cd8aeed56f4cbaa360a3d3736 (patch)
tree849a2c109e0ea722244af180a3765b01fcb571fd /tool
parent487736646a8c50718289d4c1d71e4c63ad641b43 (diff)
highlight configure
* aclocal.m4 (COLORIZE_RESULT): highlight result messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/ifchange22
1 files changed, 20 insertions, 2 deletions
diff --git a/tool/ifchange b/tool/ifchange
index 488e9db..6a1923c 100755
--- a/tool/ifchange
+++ b/tool/ifchange
@@ -37,11 +37,29 @@ if [ "$temp" = - ]; then
trap 'rm -f "$temp"' 0
fi
+msg_begin= msg_unchanged= msg_updated= msg_reset=
+if [ -t ]; then
+ msg_begin="`tput smso 2>/dev/null`"
+ case "$msg_begin" in
+ ""*m)
+ msg_begin="`echo "$msg_begin" | sed 's/[0-9]*m$//'`"
+ if [ ${TEST_COLORS:+set} ]; then
+ msg_unchanged=`expr ":$TEST_COLORS:" : ".*:pass=\([^:]*\):"`
+ msg_updated=`expr ":$TEST_COLORS:" : ".*:fail=\([^:]*\):"`
+ fi
+ msg_unchanged="${msg_begin}${msg_unchanged:-32;1}m"
+ msg_updated="${msg_begin}${msg_updated:-31;1}m"
+ msg_reset="${msg_begin}m"
+ ;;
+ esac
+ unset msg_begin
+fi
+
if [ -f "$target" -a ! -${empty:+f}${empty:-s} "$temp" ] || cmp "$target" "$temp" >/dev/null 2>&1; then
- echo "$target unchanged"
+ echo "$target ${msg_unchanged}unchanged${msg_reset}"
rm -f "$temp"
else
- echo "$target updated"
+ echo "$target ${msg_updated}updated${msg_reset}"
[ x"${keepsuffix}" = x ] || mv -f "$target" "${target}${keepsuffix}"
mv -f "$temp" "$target"
fi