cookutils rev 79

cooker: add command rev so we can rebuild a specific revision
author Christophe Lincoln <pankso@slitaz.org>
date Sun May 08 00:09:36 2011 +0200 (2011-05-08)
parents a1c33e54c56b
children 1b9322fabdf3
files cooker doc/cookutils.en.html
line diff
     1.1 --- a/cooker	Sat May 07 23:23:59 2011 +0200
     1.2 +++ b/cooker	Sun May 08 00:09:36 2011 +0200
     1.3 @@ -45,6 +45,7 @@
     1.4    flavor|-f       Cook all packages of a flavor.
     1.5    list|-l         Cook all packages in the given list.
     1.6    cat|-c          Cook all packages of a category.
     1.7 +  rev|-r          Cook packages of a specific revision.
     1.8    all|-a          Find and cook all unbuilt packages.
     1.9  
    1.10  EOT
    1.11 @@ -211,10 +212,8 @@
    1.12  cook_list() {
    1.13  	for pkg in $(cat $cooklist)
    1.14  	do
    1.15 -		if [ ! -d "$wok/$pkg/install" ]; then
    1.16 -			cook $pkg || broken
    1.17 -			sed -i /^${pkg}$/d $cooklist
    1.18 -		fi
    1.19 +		cook $pkg || broken
    1.20 +		sed -i /^${pkg}$/d $cooklist
    1.21  	done
    1.22  }
    1.23  
    1.24 @@ -320,6 +319,19 @@
    1.25  			echo -e "\nSpecified list does not exist: $list\n" && exit 1
    1.26  		cp -a $list $cooklist
    1.27  		strip_blocked
    1.28 +		cook_order | tee $LOGS/cookorder.log ;;
    1.29 +	rev|-r)
    1.30 +		# Cook or recook a specific Hg revision.
    1.31 +		rev="$2"
    1.32 +		[ "$rev" ] || exit 0
    1.33 +		cd $wok
    1.34 +		log=$(hg log --rev=$rev --template "{files}\n" | cut -d "/" -f 1)
    1.35 +		rm -f $cooklist && touch $cooklist
    1.36 +		for pkg in $log
    1.37 +		do
    1.38 +			echo "$pkg" >> $cooklist
    1.39 +		done
    1.40 +		strip_blocked
    1.41  		cook_order | tee $LOGS/cookorder.log
    1.42  		cook_list ;;
    1.43  	all|-a)
    1.44 @@ -342,7 +354,7 @@
    1.45  		strip_blocked
    1.46  		echo "Packages to cook: $(cat $cooklist | wc -l)" | log
    1.47  		cook_order | tee $LOGS/cookorder.log
    1.48 -		cook_list && empty_command;;
    1.49 +		cook_list ;;
    1.50  	*)
    1.51  		# Default is to cook all commits.
    1.52  		[ "$1" ] && usage
     2.1 --- a/doc/cookutils.en.html	Sat May 07 23:23:59 2011 +0200
     2.2 +++ b/doc/cookutils.en.html	Sun May 08 00:09:36 2011 +0200
     2.3 @@ -252,6 +252,14 @@
     2.4  # cooker list [/path/to/cooklist]
     2.5  # cooker cat [category]
     2.6  </pre>
     2.7 +<p>
     2.8 +	The Cooker let you also recook a specific Hg revision. It usefull in
     2.9 +	production so if the Build Bot was interupted while cooking commits, you
    2.10 +	can then cook packages manually:
    2.11 +</p>
    2.12 +<pre>
    2.13 +# cooker rev 9496
    2.14 +</pre>
    2.15  
    2.16  <a name="blocked"></a>
    2.17  <h3>Blocked packages</h3>