update to use efl svn
[maemo-efl] / trunk / scripts / message-functions.sh
1 #!/bin/sh
2
3 ###########################################################
4 # Maemo-efl building script
5 # Helper functions for utility scripts.
6 ###########################################################
7
8 COLOR_GOOD="\033[1;32m"
9 COLOR_WARN="\033[1;33m"
10 COLOR_ERROR="\033[1;31m"
11 COLOR_NORMAL="\033[0m"
12
13 # error <message>
14 error() {
15     echo -e " ${COLOR_ERROR}* E:${COLOR_NORMAL} $*"
16     exit 1
17 }
18
19 # warn <message>
20 warn() {
21     echo -e " ${COLOR_WARN}* W:${COLOR_NORMAL} $*"
22 }
23
24 # msg <message>
25 msg() {
26     echo -e " ${COLOR_GOOD}*${COLOR_NORMAL} $*"
27 }
28
29 # msg_begin <message>
30 msg_begin() {
31     echo -en " ${COLOR_GOOD}*${COLOR_NORMAL} $* ..."
32 }
33
34 # msg_end <error-code>
35 msg_end() {
36 #echo -en "\033[72G"
37 echo -en "  "
38     if [ $1 -eq 0 ]; then
39         echo -e "${COLOR_GOOD}ok${COLOR_NORMAL}"
40     else
41         echo -e "${COLOR_ERROR}failed${COLOR_NORMAL}"
42         exit 1
43     fi
44 }