aboutsummaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorJacky Cao <cao.zhong1@gmail.com>2015-05-15 22:12:53 +0800
committerJacky Tsao <cao.zhong1@gmail.com>2015-05-17 10:07:42 +0800
commit89483b83fb48b1ff070081ea31ea84f231f0228c (patch)
treeb64b920d44424a8c898f58c9d877ab3b5d8afcf2 /envsetup.sh
parentc340a30641ca4ed5c40612f3bfe36b41fadca0c0 (diff)
downloadplatform_build-89483b83fb48b1ff070081ea31ea84f231f0228c.tar.gz
platform_build-89483b83fb48b1ff070081ea31ea84f231f0228c.tar.bz2
platform_build-89483b83fb48b1ff070081ea31ea84f231f0228c.zip
Portable way to color
Change-Id: I62ae1da772f4e3eb80ed26aca89ebe47aff8efa7
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/envsetup.sh b/envsetup.sh
index bec69932d7..88c7c5c9fd 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -29,7 +29,7 @@ EOF
T=$(gettop)
local A
A=""
- for i in `cat $T/build/envsetup.sh | sed -n "/^[ \t]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
+ for i in `cat $T/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
A="$A $i"
done
echo $A
@@ -1426,9 +1426,9 @@ function pez {
local retval=$?
if [ $retval -ne 0 ]
then
- echo -e "\e[0;31mFAILURE\e[00m"
+ echo $'\E'"[0;31mFAILURE\e[00m"
else
- echo -e "\e[0;32mSUCCESS\e[00m"
+ echo $'\E'"[0;32mSUCCESS\e[00m"
fi
return $retval
}
@@ -1450,9 +1450,9 @@ function make()
local secs=$(($tdiff % 60))
local ncolors=$(tput colors 2>/dev/null)
if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
- color_failed="\e[0;31m"
- color_success="\e[0;32m"
- color_reset="\e[00m"
+ color_failed=$'\E'"[0;31m"
+ color_success=$'\E'"[0;32m"
+ color_reset=$'\E'"[00m"
else
color_failed=""
color_success=""
@@ -1460,9 +1460,9 @@ function make()
fi
echo
if [ $ret -eq 0 ] ; then
- echo -n -e "${color_success}#### make completed successfully "
+ echo -n "${color_success}#### make completed successfully "
else
- echo -n -e "${color_failed}#### make failed to build some targets "
+ echo -n "${color_failed}#### make failed to build some targets "
fi
if [ $hours -gt 0 ] ; then
printf "(%02g:%02g:%02g (hh:mm:ss))" $hours $mins $secs
@@ -1471,7 +1471,7 @@ function make()
elif [ $secs -gt 0 ] ; then
printf "(%s seconds)" $secs
fi
- echo -e " ####${color_reset}"
+ echo " ####${color_reset}"
echo
return $ret
}