tazwok rev 352

Some changes to Pascal's improvement, handle all logs created (including iso/check-incoming/cook-toolchain); fix an error about cookorder.txt
author Antoine Bodin <gokhlayeh@slitaz.org>
date Wed Feb 23 22:44:05 2011 +0100 (2011-02-23)
parents 976c9e9df5fb
children 083e9c4c49c3 dc1b670ed59c
files chroot-scripts/cook-toolchain chroot-scripts/gen-iso tazwok
line diff
     1.1 --- a/chroot-scripts/cook-toolchain	Wed Feb 23 12:23:02 2011 +0100
     1.2 +++ b/chroot-scripts/cook-toolchain	Wed Feb 23 22:44:05 2011 +0100
     1.3 @@ -5,6 +5,13 @@
     1.4  # Important settings and variables.
     1.5  source /usr/lib/slitaz/libtaz
     1.6  source /etc/slitaz/tazwok.conf
     1.7 +
     1.8 +# Report progress on webserver.
     1.9 +log_step="$LOCAL_REPOSITORY/log/step"
    1.10 +run_on_exit="$run_on_exit
    1.11 +rm -f $LOCAL_REPOSITORY/log/step
    1.12 +rm -f $LOCAL_REPOSITORY/log/package"
    1.13 +
    1.14  source_lib report
    1.15  report start
    1.16  
    1.17 @@ -61,6 +68,7 @@
    1.18  for PACKAGE in binutils gcc; do
    1.19  	rm $LOCAL_REPOSITORY/log/tmp-toolchain-$PACKAGE-firstpass.html 2>/dev/null
    1.20  	report sublog $LOCAL_REPOSITORY/log/tmp-toolchain-$PACKAGE-firstpass.html
    1.21 +	echo "tmp-toolchain-$PACKAGE-firstpass" > $LOCAL_REPOSITORY/log/package
    1.22  	report step "Compiling $PACKAGE, first pass"
    1.23  	report open-bloc
    1.24  	prepare_package
    1.25 @@ -75,6 +83,7 @@
    1.26  for PACKAGE in $SLITAZ_TOOLCHAIN; do
    1.27  	rm $LOCAL_REPOSITORY/log/tmp-toolchain-$PACKAGE.html 2>/dev/null
    1.28  	report sublog $LOCAL_REPOSITORY/log/tmp-toolchain-$PACKAGE.html
    1.29 +	echo "tmp-toolchain-$PACKAGE" > $LOCAL_REPOSITORY/log/package
    1.30  	report step "Compiling $PACKAGE"
    1.31  	report open-bloc
    1.32  	prepare_package
     2.1 --- a/chroot-scripts/gen-iso	Wed Feb 23 12:23:02 2011 +0100
     2.2 +++ b/chroot-scripts/gen-iso	Wed Feb 23 22:44:05 2011 +0100
     2.3 @@ -5,11 +5,18 @@
     2.4  [ "$1" ] || { echo "Usage: gen-iso flavorname [gzip]" >&2; exit 1; }
     2.5  source /usr/lib/slitaz/libtaz
     2.6  
     2.7 +# Report progress on webserver.
     2.8 +log_step="$LOCAL_REPOSITORY/log/step"
     2.9 +run_on_exit="$run_on_exit
    2.10 +rm -f $LOCAL_REPOSITORY/log/step
    2.11 +rm -f $LOCAL_REPOSITORY/log/package"
    2.12 +
    2.13  [ -d "$SLITAZ_DIR/flavors" ] || ln -s $LOCAL_REPOSITORY/flavors $SLITAZ_DIR
    2.14  if [ -d "$SLITAZ_DIR/flavors/$1" ]; then
    2.15  	source_lib report
    2.16  	export log_opt=$LOCAL_REPOSITORY/log/iso-$1.html
    2.17  	rm -f $log_opt
    2.18 +	echo "iso-$1" > $LOCAL_REPOSITORY/log/package
    2.19  	report start
    2.20  	if ! [ -x /usr/bin/tazlito ]; then
    2.21  		report step "Installing tazlito"
     3.1 --- a/tazwok	Wed Feb 23 12:23:02 2011 +0100
     3.2 +++ b/tazwok	Wed Feb 23 22:44:05 2011 +0100
     3.3 @@ -137,9 +137,14 @@
     3.4  		touch $SOURCES_REPOSITORY/sources.list
     3.5  	fi
     3.6  
     3.7 -	
     3.8  	# Limit memory usage.
     3.9  	ulimit -v $(awk '/MemTotal/ { print int(($2*80)/100) }' < /proc/meminfo)
    3.10 +
    3.11 +	# log steps for webserver.
    3.12 +	log_step="$LOCAL_REPOSITORY/log/step"
    3.13 +	run_on_exit="$run_on_exit
    3.14 +rm -f $LOCAL_REPOSITORY/log/step
    3.15 +rm -f $LOCAL_REPOSITORY/log/package"
    3.16  }
    3.17  
    3.18  # Used in several functions.
    3.19 @@ -1182,7 +1187,8 @@
    3.20  					sed "/^$PACKAGE$/d" -i $PACKAGES_REPOSITORY/$i
    3.21  				done	
    3.22  				rm -f $LOCAL_REPOSITORY/log/$PACKAGE.html	
    3.23 -				if [ "$pkg_repository" = "$INCOMING_REPOSITORY" ]; then
    3.24 +				if [ "$pkg_repository" = "$INCOMING_REPOSITORY" ] && \
    3.25 +				[ "$(sed 1!d $PACKAGES_REPOSITORY/cookorder.txt)" != "#PlanSort" ] ; then
    3.26  					sed 1i"#PlanSort" -i $PACKAGES_REPOSITORY/cookorder.txt
    3.27  					regen_cooklist=yes
    3.28  				else
    3.29 @@ -1686,7 +1692,8 @@
    3.30  	if [ "$check_db_status" ]; then
    3.31  		[ "$plan_sort_depdb" ] && sort -o $dep_db $dep_db && unset plan_sort_depdb
    3.32  		[ "$plan_sort_wandb" ] && sort -o $wan_db $wan_db && unset plan_sort_wandb
    3.33 -		if [ "$plan_regen_cookorder" ]; then
    3.34 +		if [ "$plan_regen_cookorder" ] && \
    3.35 +		[ "$(sed 1!d $PACKAGES_REPOSITORY/cookorder.txt)" != "#PlanSort" ]; then
    3.36  			grep -q "^#" $PACKAGES_REPOSITORY/cookorder.txt || \
    3.37  			sed 1i"#PlanSort" -i $PACKAGES_REPOSITORY/cookorder.txt
    3.38  		fi
    3.39 @@ -2582,7 +2589,7 @@
    3.40  		[ "$plan_sort_depdb" ] && sort -o $dep_db $dep_db && unset plan_sort_depdb
    3.41  		[ "$plan_sort_wandb" ] && sort -o $wan_db $wan_db && unset plan_sort_wandb
    3.42  		if [ "$plan_regen_cookorder" ]; then
    3.43 -			grep -q "^#" $PACKAGES_REPOSITORY/cookorder.txt || \
    3.44 +			[ "$(sed 1!d $PACKAGES_REPOSITORY/cookorder.txt)" = "#PlanSort" ] || \
    3.45  			sed 1i"#PlanSort" -i $PACKAGES_REPOSITORY/cookorder.txt
    3.46  		fi
    3.47  		cook
    3.48 @@ -3116,6 +3123,7 @@
    3.49  		report open-bloc
    3.50  		[ -f $LOCAL_REPOSITORY/log/incoming.html ] && rm $LOCAL_REPOSITORY/log/incoming.html	
    3.51  		report sublog $LOCAL_REPOSITORY/log/incoming.html
    3.52 +		echo "incoming" > $LOCAL_REPOSITORY/log/package	
    3.53  		check_for_incoming
    3.54  		report end-sublog
    3.55  		report close-bloc