wok-current rev 6540

Disable chain-cook & add +build option for genpkg only
author Antoine Bodin <gokhlayeh@mailoo.org>
date Thu Oct 07 02:09:49 2010 +0200 (2010-10-07)
parents 95882644e965
children 93df23918b33
files tazbb/stuff/tazbb tazbb/stuff/web/index.php
line diff
     1.1 --- a/tazbb/stuff/tazbb	Wed Oct 06 05:39:56 2010 +0000
     1.2 +++ b/tazbb/stuff/tazbb	Thu Oct 07 02:09:49 2010 +0200
     1.3 @@ -95,7 +95,8 @@
     1.4  	if ! grep -q "^Packages" $DB_DIR/summary; then
     1.5  		cat >> $DB_DIR/summary << _EOT_
     1.6  Packages : `ls $BUILD_WOK | wc -l` in the wok, `cat $DB_DIR/cooklist | wc -l` to cook, \
     1.7 -`cat $DB_DIR/blocked | wc -l` blocked, `cat $DB_DIR/corrupted | wc -l` corrupted
     1.8 +`cat $DB_DIR/genpkglist | wc -l` to repack, `cat $DB_DIR/blocked | wc -l` blocked, \
     1.9 +`cat $DB_DIR/corrupted | wc -l` corrupted
    1.10  _EOT_
    1.11  	fi
    1.12  }
    1.13 @@ -108,6 +109,8 @@
    1.14  		$DB_DIR/summary
    1.15  	sed -i s/"[0-9]* to cook"/"`cat $DB_DIR/cooklist | wc -l` to cook"/ \
    1.16  		$DB_DIR/summary
    1.17 +	sed -i s/"[0-9]* to repack"/"`cat $DB_DIR/genpkglist | wc -l` to repack"/ \
    1.18 +		$DB_DIR/summary
    1.19  	sed -i s/"[0-9]* blocked"/"`cat $DB_DIR/blocked | wc -l` blocked"/ \
    1.20  		$DB_DIR/summary
    1.21  	sed -i s/"[0-9]* corrupted"/"`cat $DB_DIR/corrupted | wc -l` corrupted"/ \
    1.22 @@ -130,6 +133,9 @@
    1.23  	echo "Cooklist"
    1.24  	echo "================================================================================"
    1.25  	cat $DB_DIR/cooklist && echo ""
    1.26 +	echo "Genpkglist"
    1.27 +	echo "================================================================================"
    1.28 +	cat $DB_DIR/genpkglist && echo ""
    1.29  	echo "Packlist"
    1.30  	echo "================================================================================"
    1.31  	cat $DB_DIR/packlist && echo ""
    1.32 @@ -281,6 +287,7 @@
    1.33  {
    1.34  	# Clean up last results.
    1.35  	rm -f $DB_DIR/cooklist && touch $DB_DIR/cooklist
    1.36 +	rm -f $DB_DIR/genpkglist && touch $DB_DIR/genpkglist
    1.37  	rm -f $DB_DIR/report && touch $DB_DIR/report
    1.38  	rm -f $DB_DIR/unbuilt && touch $DB_DIR/unbuilt
    1.39  	echo "Checking all files in: $HG_WOK"
    1.40 @@ -324,34 +331,30 @@
    1.41  				FILE_YEAR=`date -u -r $file '+%Y'`
    1.42  				FILE_DATE=`date -u -r $file '+%m%d%H%M'`
    1.43  				[ "$2" = "--verbose" ] && echo " -> Checking: $file"
    1.44 -				if [ "$FILE_YEAR" -ge "$PKG_YEAR" -a "$FILE_DATE" -gt "$PKG_DATE" ] && ! grep -q $PACKAGE $DB_DIR/cooklist; then
    1.45 +				if [ "$FILE_YEAR" -ge "$PKG_YEAR" -a "$FILE_DATE" -gt "$PKG_DATE" ] && ! grep -q $PACKAGE $DB_DIR/cooklist && ! grep -q $PACKAGE $DB_DIR/genpkglist; then
    1.46  					[ "$1" = "report" ] && echo "Refresh : $PACKAGE ($VERSION)"
    1.47  					echo "Refresh : $PACKAGE ($VERSION)" >> $DB_DIR/report
    1.48  					echo "$PACKAGE" >> $DB_DIR/cooklist
    1.49  				fi
    1.50  			done
    1.51  		fi
    1.52 -		# Now check if package is built and not already in the list.
    1.53 -		if [ ! -d $BUILD_WOK/$PACKAGE/taz ] && ! grep -q $PACKAGE $DB_DIR/cooklist; then
    1.54 -			[ "$1" = "report" ] && echo "Unbuilt : $PACKAGE ($VERSION)"
    1.55 -			echo "Unbuilt : $PACKAGE ($VERSION)" >> $DB_DIR/report
    1.56 -			echo "$PACKAGE" >> $DB_DIR/cooklist
    1.57 -		fi
    1.58 -		if ! grep -q $PACKAGE $DB_DIR/cooklist; then
    1.59 -			case " $TOOLCHAIN " in
    1.60 -			*\ $PACKAGE\ *) continue;;
    1.61 -			esac
    1.62 -			case "$PACKAGE" in
    1.63 -			tazbb|tazwok|tazpkg) continue;;
    1.64 -			esac
    1.65 -			for dep in $BUILD_DEPENDS $TOOLCHAIN ; do
    1.66 -				[ $BUILD_WOK/$PACKAGE/taz -nt $BUILD_WOK/$dep/taz ] && continue
    1.67 -				[ "$1" = "report" ] && echo "Refresh : $PACKAGE (older than $dep)"
    1.68 -				echo "Refresh : $PACKAGE (older than $dep)" >> $DB_DIR/report
    1.69 -				echo "$PACKAGE" >> $DB_DIR/cooklist
    1.70 -				break
    1.71 -			done
    1.72 -		fi
    1.73 +		
    1.74 +		# Desactivate this feature because it create infinite cooking loops.
    1.75 +		#if ! grep -q $PACKAGE $DB_DIR/cooklist; then
    1.76 +		#	case " $TOOLCHAIN " in
    1.77 +		#	*\ $PACKAGE\ *) continue;;
    1.78 +		#	esac
    1.79 +		#	case "$PACKAGE" in
    1.80 +		#	tazbb|tazwok|tazpkg) continue;;
    1.81 +		#	esac
    1.82 +		#	for dep in $BUILD_DEPENDS $TOOLCHAIN ; do
    1.83 +		#		[ $BUILD_WOK/$PACKAGE/taz -nt $BUILD_WOK/$dep/taz ] && continue
    1.84 +		#		[ "$1" = "report" ] && echo "Refresh : $PACKAGE (older than $dep)"
    1.85 +		#		echo "Refresh : $PACKAGE (older than $dep)" >> $DB_DIR/report
    1.86 +		#		echo "$PACKAGE" >> $DB_DIR/cooklist
    1.87 +		#		break
    1.88 +		#	done
    1.89 +		#fi
    1.90  		# Rebuild unbuilt packages list with link to log file. This list
    1.91  		# is also generated by cook_inslall to have real time stats.
    1.92  		if [ ! -d $BUILD_WOK/$PACKAGE/taz ]; then
    1.93 @@ -374,20 +377,47 @@
    1.94  	# commit was build by the previous build.
    1.95  	LAST_REV=$(($LAST_REV+1))
    1.96  	echo -e "Will cook from revision $LAST_REV to $NEW_REV\n"
    1.97 -	for file in `hg log --rev=$LAST_REV:$NEW_REV --template '{files}\n'`
    1.98 -	do
    1.99 -		pkg=`echo $file | cut -d "/" -f 1`
   1.100 -		if ! grep -q ^$pkg$ $DB_DIR/cooklist; then
   1.101 -			if [ -f $pkg/receipt ]; then
   1.102 -				. $pkg/receipt
   1.103 -				echo "Commit  : $PACKAGE ($VERSION)" >> $DB_DIR/report
   1.104 -				echo "$PACKAGE" >> $DB_DIR/cooklist
   1.105 +	for rev in $(seq $LAST_REV $NEW_REV); do
   1.106 +		hg_log=$(hg log --rev=$rev --template "{files}\t{desc}\n")
   1.107 +		for file in $(echo "$hg_log" | cut -f 1); do
   1.108 +			pkg=`echo $file | cut -d "/" -f 1`
   1.109 +			if [ "$(echo $hg_log | grep -i '+build')" ]; then
   1.110 +				if ! grep -q ^$pkg$ $DB_DIR/genpkglist && ! grep -q ^$pkg$ $DB_DIR/cooklist; then
   1.111 +					if [ -f $pkg/receipt ]; then
   1.112 +						. $pkg/receipt
   1.113 +						echo "Commit  : $PACKAGE ($VERSION) - genpkg only" >> $DB_DIR/report
   1.114 +						echo "$PACKAGE" >> $DB_DIR/genpkglist
   1.115 +					fi
   1.116 +				fi
   1.117 +			else
   1.118 +				if ! grep -q ^$pkg$ $DB_DIR/cooklist; then
   1.119 +					if [ -f $pkg/receipt ]; then
   1.120 +						. $pkg/receipt
   1.121 +						echo "Commit  : $PACKAGE ($VERSION)" >> $DB_DIR/report
   1.122 +						sed "/^$PACKAGE$/d" -i $DB_DIR/genpkglist
   1.123 +						echo "$PACKAGE" >> $DB_DIR/cooklist
   1.124 +					fi
   1.125 +				fi
   1.126  			fi
   1.127 -		fi
   1.128 +		done
   1.129  	done
   1.130  	packages_summary
   1.131  }
   1.132  
   1.133 +# Genpkg : don't regen the package if source _pkg is missing, this
   1.134 +# function re-generate the package only if all is fine, else it
   1.135 +# does nothing and forget the package.
   1.136 +genpkg_package()
   1.137 +{
   1.138 +	EXTRAVERSION=""
   1.139 +	DEPENDS=""
   1.140 +	BUILD_DEPENDS=""
   1.141 +	SOURCE=""
   1.142 +	WANTED=""
   1.143 +	echo "(Repack <a href=\"log.php?package=$(escape $pkg)$LOG_SUFFIX\">$pkg</a>)" > $DB_DIR/running
   1.144 +	tazwok check-receipt $pkg && echo 'N' | tazwok genpkg $pkg
   1.145 +}
   1.146 +
   1.147  # Cook one package
   1.148  cook_package()
   1.149  {
   1.150 @@ -476,6 +506,16 @@
   1.151  # Here we cook all packages found in the cooklist.
   1.152  cook_install()
   1.153  {
   1.154 +	# First repack packages in genpkglist
   1.155 +	for pkg in `cat $DB_DIR/genpkglist`; do
   1.156 +		genpkg_package $pkg
   1.157 +		
   1.158 +		# Remove package from the genpkglist and empty lines for HTML <pre>.
   1.159 +		sed -i /"^$pkg$"/d $DB_DIR/genpkglist
   1.160 +		sed -i '/^$/d' $DB_DIR/genpkglist
   1.161 +		packages_summary_update
   1.162 +	done		
   1.163 +	
   1.164  	echo "" > $DB_DIR/unbuilt
   1.165  	for pkg in `cat $DB_DIR/cooklist | sort_cook_list`
   1.166  	do
     2.1 --- a/tazbb/stuff/web/index.php	Wed Oct 06 05:39:56 2010 +0000
     2.2 +++ b/tazbb/stuff/web/index.php	Thu Oct 07 02:09:49 2010 +0200
     2.3 @@ -122,6 +122,13 @@
     2.4  ?>
     2.5  </pre>
     2.6  
     2.7 +<h3>Genpkglist</h3>
     2.8 +<pre class="package">
     2.9 +<?php
    2.10 +include("$db_dir/genpkglist");
    2.11 +?>
    2.12 +</pre>
    2.13 +
    2.14  <h3>Cooklist</h3>
    2.15  <pre class="package">
    2.16  <?php