# HG changeset patch # User Christophe Lincoln # Date 1336582835 -7200 # Node ID c75f13234af0bfbfbe787a12a0eae14629b3b0fc # Parent 740cd63ddb41388b7754a8d4a8da10c1c3b4d5a0 cook: handle testsuite() in receipt, use libtaz.sh diff -r 740cd63ddb41 -r c75f13234af0 cook --- a/cook Wed May 09 18:25:13 2012 +0200 +++ b/cook Wed May 09 19:00:35 2012 +0200 @@ -6,6 +6,7 @@ # Copyright (C) SliTaz GNU/Linux - GNU gpl v3 # Author: Christophe Lincoln # +. /lib/libtaz.sh [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf [ -f "cook.conf" ] && . ./cook.conf @@ -31,6 +32,7 @@ $(echo -e "\033[1m$(gettext "Commands:")\033[0m") usage|help $(gettext "Display this short usage.") setup $(gettext "Setup your build environment.") + arm-setup $(gettext "Create packages DB lists and flavors.") test $(gettext "Test environment and cook a package.") list-wok $(gettext "List packages in the wok.") search $(gettext "Simple packages search function.") @@ -56,25 +58,6 @@ exit 0 } -# Be sure we're root. -check_root() { - [ $(id -u) != 0 ] && gettext -e "\nYou must be root to cook.\n\n" && exit 0 -} - -separator() { - echo "================================================================================" -} - -status() { - echo -en "\\033[70G[ " - if [ $? = 0 ]; then - echo -en "\\033[1;32mOK" - else - echo -en "\\033[1;31mFailed" - fi - echo -e "\\033[0;39m ]" -} - # Log activities, we want first letter capitalized. log() { grep ^[A-Z] | \ @@ -616,6 +599,14 @@ mkdir -p $install fi separator && echo "" + + # Execute testsuite. + if grep -q ^testsuite $receipt; then + echo "Running testsuite" + separator + testsuite $@ || exit 1 + separator && echo "" + fi } # Cook quality assurance.