use struct timeval to obtain the cputime. disable display atm until the code is corre...
[AROS.git] / scripts / nightly / functions
blob169708897cbb72cf66f8d156f2b56434d4834aa1
2 # Codes:
3 # ---   = Information
4 # !!!   = Error
5 # >>>   = Executing command
7 print()
9     echo $* | tee -a $LOG_ALL | tee -a $LOG_THIS
12 printi()
14     print '---' $*
17 printe()
19     print '!!!' $* 
22 printx()
24     print '>>>' $*
27 printfile()
29     cat $* | tee -a $LOG_ALL | tee -a $LOG_THIS
32 execute()
34     printx $*
35     (
36         $*
37         if [ $? != 0 ]; then
38             touch /tmp/_aros_build_fail
39         fi
40     ) 2>&1 | tee -a $LOG_ALL | tee -a $LOG_THIS
41     if [ -f /tmp/_aros_build_fail ]; then
42         printe "Command '$*' returned error. ABORTING BUILD!"
43         rm -f /tmp/_aros_build_fail
44         exit 5
45     fi
48 archive()
50     archdir=$(dirname $1)
51     archname=$(basename $1)
52     oldpwd=$(pwd)
53     
54     makedir $archdir
55     execute tar cjvf $1 --exclude=.svn $2
56     cd      $archdir
57     echo    ">>> md5sum $archname >$archname.md5"
58     md5sum  $archname >$archname.md5
59     cd      $oldpwd
62 ziparc()
64     archdir=$(dirname $1)
65     archname=$(basename $1)
66     oldpwd=$(pwd)
67     
68     makedir $archdir
69     execute zip -r9 $1 $2 -x \*/.svn/\*
70     cd      $archdir
71     echo    ">>> md5sum $archname >$archname.md5"
72     md5sum  $archname >$archname.md5
73     cd      $oldpwd
76 lhaarc()
78     archdir=$(dirname $1)
79     archname=$(basename $1)
80     oldpwd=$(pwd)
81     
82     makedir $archdir
83     execute lha -a -x=\*/.svn/\* $1 $2
84     cd      $archdir
85     echo    ">>> md5sum $archname >$archname.md5"
86     md5sum  $archname >$archname.md5
87     cd      $oldpwd
90 resetl()
92     LOG_THIS=/dev/null
95 setl()
97     LOG_THIS=$LOG_BASE/$1
98     if [ ! -f $LOG_THIS ]; then
99         touch $LOG_THIS >/dev/null
100     fi