cookutils rev 360
cook: handle testsuite() in receipt, use libtaz.sh
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Wed May 09 19:00:35 2012 +0200 (2012-05-09) |
parents | 740cd63ddb41 |
children | e7e7979eb49d |
files | cook |
line diff
1.1 --- a/cook Wed May 09 18:25:13 2012 +0200 1.2 +++ b/cook Wed May 09 19:00:35 2012 +0200 1.3 @@ -6,6 +6,7 @@ 1.4 # Copyright (C) SliTaz GNU/Linux - GNU gpl v3 1.5 # Author: Christophe Lincoln <pankso@slitaz.org> 1.6 # 1.7 +. /lib/libtaz.sh 1.8 1.9 [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf 1.10 [ -f "cook.conf" ] && . ./cook.conf 1.11 @@ -31,6 +32,7 @@ 1.12 $(echo -e "\033[1m$(gettext "Commands:")\033[0m") 1.13 usage|help $(gettext "Display this short usage.") 1.14 setup $(gettext "Setup your build environment.") 1.15 + arm-setup $(gettext "Create packages DB lists and flavors.") 1.16 test $(gettext "Test environment and cook a package.") 1.17 list-wok $(gettext "List packages in the wok.") 1.18 search $(gettext "Simple packages search function.") 1.19 @@ -56,25 +58,6 @@ 1.20 exit 0 1.21 } 1.22 1.23 -# Be sure we're root. 1.24 -check_root() { 1.25 - [ $(id -u) != 0 ] && gettext -e "\nYou must be root to cook.\n\n" && exit 0 1.26 -} 1.27 - 1.28 -separator() { 1.29 - echo "================================================================================" 1.30 -} 1.31 - 1.32 -status() { 1.33 - echo -en "\\033[70G[ " 1.34 - if [ $? = 0 ]; then 1.35 - echo -en "\\033[1;32mOK" 1.36 - else 1.37 - echo -en "\\033[1;31mFailed" 1.38 - fi 1.39 - echo -e "\\033[0;39m ]" 1.40 -} 1.41 - 1.42 # Log activities, we want first letter capitalized. 1.43 log() { 1.44 grep ^[A-Z] | \ 1.45 @@ -616,6 +599,14 @@ 1.46 mkdir -p $install 1.47 fi 1.48 separator && echo "" 1.49 + 1.50 + # Execute testsuite. 1.51 + if grep -q ^testsuite $receipt; then 1.52 + echo "Running testsuite" 1.53 + separator 1.54 + testsuite $@ || exit 1 1.55 + separator && echo "" 1.56 + fi 1.57 } 1.58 1.59 # Cook quality assurance.