# HG changeset patch # User Christophe Lincoln # Date 1304731973 -7200 # Node ID 969f0ec4eeac1e4dafe4bed27339fc362cb68d5c # Parent 14576e7f36dd4070df0c067c5a937d0b41f1c05e Add $taz var, bunch of tiny improvment and one more info in README diff -r 14576e7f36dd -r 969f0ec4eeac README --- a/README Sat May 07 02:56:03 2011 +0200 +++ b/README Sat May 07 03:32:53 2011 +0200 @@ -35,14 +35,21 @@ * The work of a Build Bot, unix philosophy: one tool for one task * Cook a package if your receipt is crappy :-) -Cook variables used in receipt: +Cook paths variables used in receipt: - * $src : Path to package source: wok/pkg/source - * $stuff : Path to package stuff: wok/pkg/stuff - * $fs : Path to package file system: wok/pkg/taz/*/fs - * $install : Path to all installed files by the package + * $src : Package source: wok/pkg/source + * $stuff : Package stuff: wok/pkg/stuff + * $fs : Package file system: wok/pkg/taz/*/fs + * $install : All installed files by the package Old style is $_pkg and cook is compatible +Cook internal paths variables: + + * $pkgdir : Package directory in the wok: wok/pkg + * $receipt : Package receipt in wok: wok/pkg/receipt + * $taz : The taz directory: wok/pkg/taz + * $pack : Package to compress: wok/taz/pkg-* + Cook also manages packages lists so they can be used for a personal packages repository or sent to the official mirror. We create and use: @@ -55,9 +62,9 @@ Cooker -------------------------------------------------------------------------------- -The Cooker is a Build Bot which automates the build process but doesn't make the dinner -for you! We need quality receipts to cook succesfully and the goal is not to have -a bloated script so please Keep It Short and Simple. +The Cooker is a Build Bot which automates the build process but doesn't make +the dinner for you! We need quality receipts to cook succesfully and the goal +is not to have a bloated script so please Keep It Short and Simple. Cmdline tool : /usr/bin/cooker Web interface : /var/www/cgi-bin/cooker @@ -65,8 +72,8 @@ The web interface consists of one CGI script and one CSS style. Cook logs can be produced by cook and the cooker just acts as a fronted to check them in -a nice way. A web interface also highlights success and error and can show receipts -and the cooker logs such as the last ordered list or commits check. +a nice way. A web interface also highlights success and error and can show +receipts and the cooker logs such as the last ordered list or commits check. Toolchain @@ -84,6 +91,7 @@ * In all cases: KISS * Use tab and not space to indent + * Max 80 char by line (try to edit in a Xterm 80x24) * Use names rather than $1 $2 $3 * Variables from config file are $UPPERCASE * Variables initialized by cook are $lowercase diff -r 14576e7f36dd -r 969f0ec4eeac cook --- a/cook Sat May 07 02:56:03 2011 +0200 +++ b/cook Sat May 07 03:32:53 2011 +0200 @@ -106,7 +106,7 @@ for var in PACKAGE VERSION CATEGORY SHORT_DESC MAINTAINER WEB_SITE do unset value - value=$(grep ^$var= receipt | cut -d \" -f 2) + value=$(grep ^$var= $receipt | cut -d \" -f 2) case "$var" in PACKAGE|VERSION|SHORT_DESC) if_empty_value ;; @@ -140,7 +140,8 @@ set_paths() { pkgdir=$WOK/$PACKAGE src=$pkgdir/source/$PACKAGE-$VERSION - pack=$pkgdir/taz/$PACKAGE-${VERSION}${EXTRAVERSION} + taz=$pkgdir/taz + pack=$taz/$PACKAGE-${VERSION}${EXTRAVERSION} fs=$pack/fs stuff=$pkgdir/stuff install=$pkgdir/install @@ -206,8 +207,8 @@ cd $WOK/$pkg [ -d install ] && prod=$(du -sh install | awk '{print $1}' 2>/dev/null) fs=$(du -sh taz/* | awk '{print $1}') - size=$(du -sh $PKGS/$PACKAGE-${VERSION}*.tazpkg | awk '{print $1}') - files=$(cat taz/$PACKAGE-*/files.list | wc -l) + size=$(du -sh $PKGS/$pkg-${VERSION}*.tazpkg | awk '{print $1}') + files=$(cat taz/$pkg-*/files.list | wc -l) cookdate=$(date "+%Y-%m-%d %H:%M") gettext "Summary for:"; echo " $PACKAGE $VERSION" separator @@ -324,6 +325,7 @@ separator set_paths [ "$QA" ] && receipt_quality + cd $pkgdir rm -rf install taz source # Disable -pipe if less than 512Mb free RAM. @@ -336,7 +338,7 @@ unset free # Export flags and path to be used by make - DESTDIR=$WOK/$PACKAGE/install + DESTDIR=$pkgdir/install export DESTDIR MAKEFLAGS CFLAGS CXXFLAGS BUILD_HOST CONFIG_SITE local LC_ALL=POSIX LANG=POSIX @@ -381,7 +383,7 @@ fi # Execute receipt rules. - if grep -q ^compile_rules $pkgdir/receipt; then + if grep -q ^compile_rules $receipt; then gettext -e "Executing: compile_rules\n" [ -d "$src" ] && cd $src compile_rules || echo "" && exit 1 @@ -414,13 +416,13 @@ set_paths echo "Pack: $PACKAGE $VERSION" separator - if grep -q ^genpkg_rules $pkgdir/receipt; then + if grep -q ^genpkg_rules $receipt; then gettext -e "Executing: genpkg_rules\n" cd $pkgdir mkdir -p $fs && genpkg_rules || (echo -e \ "\nERROR: genpkg_rules failed\n" >> $LOGS/$pkg.log && exit 1) fi - cd $pkgdir/taz + cd $taz for file in receipt description.txt do [ ! -f "../$file" ] && continue @@ -498,12 +500,13 @@ if fgrep -q ERROR: $LOGS/$pkg.log; then rm -f $command && exit 1 fi + gettext "QA: Checking for empty package..." files=$(grep -q ^/ $pkgdir/taz/$pkg-*/files.list) if [ ! "$files" ] && [ "$CATEGORY" != "meta" ]; then - echo -e "ERROR: empty package" + echo -e "\nERROR: empty package" rm -f $command && exit 1 else - mv -f $WOK/$pkg/taz/$pkg-*.tazpkg $PKGS + status && mv -f $pkgdir/taz/$pkg-*.tazpkg $PKGS sed -i /^${pkg}$/d $broken fi } @@ -649,11 +652,12 @@ time=$(date +%s) pkg="$1" [ -z "$pkg" ] && usage + receipt="$WOK/$pkg/receipt" check_pkg_in_wok && echo "" echo "cook:$pkg" > $command unset inst unset_receipt - cd $WOK/$pkg && . ./receipt + . $receipt # Handle --options case "$2" in