# HG changeset patch # User Christophe Lincoln # Date 1304739257 -7200 # Node ID 7281d806c7eac1d5ae0800325ebfc8e50f294cec # Parent 8df3646e9d8f23271b5cd90898c4fc4408655373 cook + cooker + doc: add blocked functionality and information diff -r 8df3646e9d8f -r 7281d806c7ea cook --- a/cook Sat May 07 04:42:06 2011 +0200 +++ b/cook Sat May 07 05:34:17 2011 +0200 @@ -40,6 +40,8 @@ --clean|-c Cook : $(gettext "clean the package in the wok.") --install|-i Cook : $(gettext "cook and install the package.") --getsrc|-gs Cook : $(gettext "get the package source tarball.") + --block|-b Cook : $(gettext "Block a package so cook will skip it.") + --unblock|-ub Cook : $(gettext "Unblock a blocked package.") --wok|-w Setup: $(gettext "create also a wok from Hg repo.") EOT @@ -544,12 +546,10 @@ # Handle --options case "$2" in - --wok) + --wok|-w) [ ! -d "$INSTALLED/mercurial" ] && tazpkg get-install mercurial [ -d "$WOK" ] && echo -e "A wok already exist.\n" && exit 1 hg clone $HG_URL ;; - --chroot) - echo "TODO: create a chroot with tazdev" ;; esac # SliTaz group and permissions @@ -659,7 +659,7 @@ check_pkg_in_wok && echo "" # Skip blocked, 3 lines also for the Cooker. - if grep -q ^$pkg$ $blocked; then + if grep -q "^$pkg$" $blocked && [ "$2" == "--*" ]; then gettext -e "Blocked package:"; echo -e " $pkg\n" && exit 0 fi @@ -672,15 +672,23 @@ # Handle --options case "$2" in --clean|-c) - gettext -e "Cleaning package:"; echo -n " $pkg" + gettext -e "Cleaning:"; echo -n " $pkg" cd $WOK/$pkg && rm -rf install taz source status && echo "" && exit 0 ;; --install|-i) inst='yes' ;; - --getsrc) - echo "Getting source for: $pkg" + --getsrc|-gs) + gettext "Getting source for:"; echo " $pkg" separator && get_source echo -e "Tarball: $SRC/$TARBALL\n" && exit 0 ;; + --block|-b) + gettext "Blocking:"; echo -n " $pkg" + [ $(grep "^$pkg$" $blocked) ] || echo "$pkg" >> $blocked + status && echo "" && exit 0 ;; + --unblock|-ub) + gettext "Unblocking:"; echo -n " $pkg" + sed -i "/^${pkg}$/"d $blocked + status && echo "" && exit 0 ;; esac # Check if wanted is build now so we have separate log files. diff -r 8df3646e9d8f -r 7281d806c7ea cooker --- a/cooker Sat May 07 04:42:06 2011 +0200 +++ b/cooker Sat May 07 05:34:17 2011 +0200 @@ -10,7 +10,8 @@ [ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf [ -f "cook.conf" ] && . ./cook.conf -# The same wok as cook. +# Set pkg name and use same wok as cook. +pkg="$2" wok="$WOK" flavors="$SLITAZ/flavors" @@ -34,15 +35,17 @@ Usage: cooker [command] [pkg|list|note] Options: - usage|-u Display this short usage. - setup|-s Setup the Cooker environment. - note|-n Add a note to the cooknotes. - notes|-ns Display all the cooknotes. - pkg|-p Same as 'cook pkg' but with cooker log. - flavor|-f Cook all packages of a flavor. - list|-l Cook all package in the given list. - cat|-c Cook all packages of a category. - all|-a Find and cook all unbuilt packages. + usage|-u Display this short usage. + setup|-s Setup the Cooker environment. + note|-n Add a note to the cooknotes. + notes|-ns Display all the cooknotes. + block|-b Block a package so cook will skip it. + unblock|-ub Unblock a blocked package. + pkg|-p Same as 'cook pkg' but with cooker log. + flavor|-f Cook all packages of a flavor. + list|-l Cook all package in the given list. + cat|-c Cook all packages of a category. + all|-a Find and cook all unbuilt packages. EOT exit 0 @@ -257,13 +260,18 @@ separator cat $cooknotes separator && echo "" ;; + block|-b) + # Block a package. + [ "$pkg" ] && cook $pkg --block ;; + unblock|-ub) + # Unblock a package. + [ "$pkg" ] && cook $pkg --unblock ;; reverse|-r) # Cook all reverse dependencies for a packages. This command let us # control the Cooker manually for commit that will cook a lot of packages. # # Use hg commit ? Ex: hg commit -m "Message bla bla | cooker:reverse" # - pkg="$2" [ ! -d "$wok/$pkg" ] && echo -e "\nNo package $2 found.\n" && exit 0 rm -f $cooklist && touch $cooklist && cd $wok echo -e "\nReverse cooklist for: $pkg" @@ -281,7 +289,6 @@ cook_list ;; pkg|-p) # Same as 'cook pkg' but with log for web interface. - pkg="$2" echo "Cook started for: $pkg" | log cook $pkg || broken empty_command ;; diff -r 8df3646e9d8f -r 7281d806c7ea doc/cookutils.en.html --- a/doc/cookutils.en.html Sat May 07 04:42:06 2011 +0200 +++ b/doc/cookutils.en.html Sat May 07 05:34:17 2011 +0200 @@ -26,7 +26,9 @@ Cook let you compile and create a package, provide a log file and check receipt/package quality. The Cooker is a build bot with more automation and can be used as a frontend to cook, since it provide a CGI/web interface - who let you view cook logs in a nice and colored way. + who let you view cook logs in a nice and colored way. Cook and the Cooker + use the same DB files and wok, ther share blocked + and broken packages as well as activity.

Cook usage

@@ -242,6 +244,29 @@ # cooker cat [category] + +

Blocked packages

+

+ Cook and the Cooker handle a file with a list of blocked package so they + not cook when commits appends or if a cooklist is used. This is very useful + for a Cooker Build Bot in production. When you block or unblock a package + you can add a note to the cooknotes. Blocking packages example: +

+
+# cook pkgname --block
+# cooker block pkgname
+# cooker -n "Blocked pkgname note"
+
+

+ The list of blocked packages are also displayed on the Cooker web interface. + To unblock a package you have to use the unblock command or cook --unblock + option: +

+
+# cook pkgname --unblock
+# cooker unblock pkgname
+
+

Cooker CGI/Web

To let you view log files in a nice way, keep activity trace and help find