cookutils rev 29

Better output for cookorder, add SETUP_PKGS in cook.conf to share list with the cooker + small improvments
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 06 16:14:39 2011 +0200 (2011-05-06)
parents 747a392fb6f7
children c1a2be11e84a
files cook cook.conf cooker web/cooker.cgi
line diff
     1.1 --- a/cook	Fri May 06 04:50:10 2011 +0200
     1.2 +++ b/cook	Fri May 06 16:14:39 2011 +0200
     1.3 @@ -161,7 +161,7 @@
     1.4  		hg*|mercurial*)
     1.5  			# We are in cache so clone here and create a tarball
     1.6  			pwd=$(pwd)
     1.7 -			if $(echo "$WGET_URL" | fgrep -q hg); then
     1.8 +			if $(echo "$WGET_URL" | fgrep -q "hg|"); then
     1.9  				url=${WGET_URL#hg|}
    1.10  			else
    1.11  				url=${WGET_URL#mercurial|}
    1.12 @@ -514,7 +514,7 @@
    1.13  		gettext "Creating directories structure in:"; echo " $SLITAZ"
    1.14  		mkdir -p $WOK $PKGS $SRC $CACHE $LOGS
    1.15  		gettext -e "Checking for packages to install...\n"
    1.16 -		for pkg in slitaz-toolchain tazdev intltool gettext
    1.17 +		for pkg in $SETUP_PKGS
    1.18  		do
    1.19  			[ ! -d "$INSTALLED/$pkg" ] && tazpkg get-install $pkg
    1.20  		done
     2.1 --- a/cook.conf	Fri May 06 04:50:10 2011 +0200
     2.2 +++ b/cook.conf	Fri May 06 16:14:39 2011 +0200
     2.3 @@ -48,3 +48,6 @@
     2.4  SF_MIRROR="http://switch.dl.sourceforge.net/sourceforge"
     2.5  XORG_MIRROR="ftp://ftp.solnet.ch/mirror/x.org/pub/individual"
     2.6  GNOME_MIRROR="http://ftp.gnome.org/pub/GNOME/sources"
     2.7 +
     2.8 +# List of packages installed by cook or the Cooker setup.
     2.9 +SETUP_PKGS="slitaz-toolchain slitaz-dev-pkgs intltool gettext bzip2"
     3.1 --- a/cooker	Fri May 06 04:50:10 2011 +0200
     3.2 +++ b/cooker	Fri May 06 16:14:39 2011 +0200
     3.3 @@ -77,18 +77,20 @@
     3.4  	rm -f $command && touch $command
     3.5  }
     3.6  
     3.7 -# Scan packages deps an fill up cookorder list.
     3.8 +# Scan packages build deps an fill up cookorder list.
     3.9  cook_order_scan() {
    3.10  	touch $cooklist $cookorder
    3.11  	for pkg in $(cat $cooklist)
    3.12  	do
    3.13 -		unset DEPENDS BUILD_DEPENDS
    3.14 +		unset BUILD_DEPENDS
    3.15  		. $wok/$pkg/receipt
    3.16 -		for dep in $DEPENDS $BUILD_DEPENDS
    3.17 +		# The :: is for web interface color.
    3.18 +		[ "$BUILD_DEPENDS" ] && echo "$pkg :: $BUILD_DEPENDS"
    3.19 +		for dep in $BUILD_DEPENDS
    3.20  		do
    3.21  			if grep -q "^$dep$" $cooklist; then
    3.22 -				echo -e "$pkg: $dep"
    3.23  				if ! grep -q "^$dep$" $cookorder; then
    3.24 +					
    3.25  					echo "$dep" >> $cookorder
    3.26  				fi
    3.27  			fi
    3.28 @@ -143,7 +145,7 @@
    3.29  		unset WANTED
    3.30  		. $wok/$pkg/receipt
    3.31  		if [ "$WANTED" ]; then
    3.32 -			echo "$pkg: $WANTED"
    3.33 +			echo "$pkg :: $WANTED"
    3.34  			sed -i -e "/^$pkg$/"d  \
    3.35  				-e "/^$WANTED$/ a $pkg"  $cooklist
    3.36  		fi
    3.37 @@ -210,7 +212,7 @@
    3.38  		echo -e "\nSetting up the Cooker"
    3.39  		echo "Cooker --setup using: $SLITAZ" | log
    3.40  		separator
    3.41 -		for pkg in mercurial rsync slitaz-toolchain gettext
    3.42 +		for pkg in $SETUP_PKGS mercurial rsync
    3.43  		do
    3.44  			[ ! -d "$INSTALLED/$pkg" ] && tazpkg get-install $pkg
    3.45  		done
    3.46 @@ -231,15 +233,15 @@
    3.47  		cp -a ${wok}-hg $wok
    3.48  		separator && echo "" ;;
    3.49  	--notes)
    3.50 -			# View cooknotes.
    3.51 -			echo -e "\nCooknotes"
    3.52 -			separator
    3.53 -			cat $cooknotes
    3.54 -			separator && echo "" ;;
    3.55 +		# View cooknotes.
    3.56 +		echo -e "\nCooknotes"
    3.57 +		separator
    3.58 +		cat $cooknotes
    3.59 +		separator && echo "" ;;
    3.60  	--note=*)
    3.61 -			# Blocked a pkg and want other to know why ? Post a note!
    3.62 -			note=${1#--note=}
    3.63 -			[ "$note" ] && echo "$note" >> $cooknotes ;;
    3.64 +		# Blocked a pkg and want other to know why ? Post a note!
    3.65 +		note=${1#--note=}
    3.66 +		[ "$note" ] && echo "$note" >> $cooknotes ;;
    3.67  	--reverse=*)
    3.68  		# Cook all reverse dependencies for a packages. This command let us
    3.69  		# control the Cooker manually for commit that will cook a lot of packages.
    3.70 @@ -281,7 +283,8 @@
    3.71  		cp -a $list $cooklist
    3.72  		strip_blocked
    3.73  		cook_order | tee $LOGS/cookorder.log
    3.74 -		cook_list ;;
    3.75 +		#cook_list
    3.76 +		;;
    3.77  	--list=*)
    3.78  		# Cook a list og package given in argument.
    3.79  		list=${1#--list=}
     4.1 --- a/web/cooker.cgi	Fri May 06 04:50:10 2011 +0200
     4.2 +++ b/web/cooker.cgi	Fri May 06 16:14:39 2011 +0200
     4.3 @@ -36,6 +36,7 @@
     4.4  				-e 's#ERROR:#<span class="span-error">ERROR:</span>#g' \
     4.5  				-e s"#^Executing:\([^']*\).#<span class='span-sky'>\0</span>#"g \
     4.6  				-e s"#^====\([^']*\).#<span class='span-line'>\0</span>#"g \
     4.7 +				-e s"#^[a-zA-Z0-9]\([^']*\) :: #<span class='span-sky'>\0</span>#"g \
     4.8  				-e s"#ftp://\([^']*\).*#<a href='\0'>\0</a>#"g	\
     4.9  				-e s"#http://\([^']*\).*#<a href='\0'>\0</a>#"g ;;
    4.10  		receipt)