tazwok rev 313

Minor fix in sort_cooklist(); major fix in check_for_incoming(); check-incoming) now update .flavors files
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Feb 18 18:08:27 2011 +0100 (2011-02-18)
parents 44d261b0b464
children c50ed39ebbc8
files tazwok
line diff
     1.1 --- a/tazwok	Fri Feb 18 02:53:40 2011 +0100
     1.2 +++ b/tazwok	Fri Feb 18 18:08:27 2011 +0100
     1.3 @@ -1808,7 +1808,7 @@
     1.4  				echo $PACKAGE >> $PACKAGES_REPOSITORY/blocked
     1.5  		done
     1.6  	fi
     1.7 -	
     1.8 +
     1.9  	if [ -s $PACKAGES_REPOSITORY/commit ] && [ "$COMMAND" != gen-cooklist ]; then
    1.10  		cd $PACKAGES_REPOSITORY
    1.11  		for PACKAGE in $(cat commit); do
    1.12 @@ -1831,7 +1831,7 @@
    1.13  	fi
    1.14  	[ "$plan_sort_depdb" ] && sort -o $dep_db $dep_db && unset plan_sort_depdb
    1.15  	[ "$plan_regen_cookorder" ] && sort_db
    1.16 -	report step "Sorting cooklist"
    1.17 +	report step "Generating cooklist"
    1.18  	if [ -f "$tmp/checked" ]; then
    1.19  		rm -f $tmp/cooklist
    1.20  		cat $tmp/checked | while read PACKAGE; do
    1.21 @@ -1843,7 +1843,10 @@
    1.22  			sed "/^$PACKAGE/d" -i $tmp/cooklist
    1.23  		done
    1.24  	fi
    1.25 +	report end-step
    1.26 +	[ -s $tmp/cooklist ] || return
    1.27  
    1.28 +	report step "Sorting cooklist"
    1.29  	for PACKAGE in $(cat $tmp/cooklist); do
    1.30  		WANTED="$(look_for_wanted)"
    1.31  		[ "$WANTED" ] || continue
    1.32 @@ -1916,6 +1919,7 @@
    1.33  	incoming_pkgs="$(cut -f 1 -d '|' $INCOMING_REPOSITORY/packages.desc)"
    1.34  	if ! [ "$forced" ]; then
    1.35  		cooklist=$PACKAGES_REPOSITORY/cooklist
    1.36 +		pkg="$incoming_pkgs"
    1.37  		gen_cook_list
    1.38  		if [ -s $PACKAGES_REPOSITORY/cooklist ]; then
    1.39  			missingpkg=$(look_for_missing_pkg cooklist)
    1.40 @@ -1927,6 +1931,7 @@
    1.41  			fi
    1.42  		fi
    1.43  	fi
    1.44 +
    1.45  	report step "Moving incoming packages to main repository"
    1.46  	unset EXTRAVERSION
    1.47  	for PACKAGE in $incoming_pkgs; do
    1.48 @@ -1945,13 +1950,41 @@
    1.49  					rm -f $SOURCES_REPOSITORY/$previous_tarball
    1.50  			fi
    1.51  	done
    1.52 -	report end-step
    1.53  	for file in packages.list packages.equiv packages.md5 packages.desc \
    1.54  		packages.txt; do
    1.55  		echo -n "" > $INCOMING_REPOSITORY/$file
    1.56  	done
    1.57  	rm -r $INCOMING_REPOSITORY/files.list.lzma
    1.58  	pkg_repository=$PACKAGES_REPOSITORY && update_packages_db
    1.59 +
    1.60 +	report step "Updating flavors"
    1.61 +	if [ -x /usr/bin/tazlito ] || [ -x /usr/bin/clean-chroot ]; then
    1.62 +		if ! [ -x /usr/bin/tazlito ]; then
    1.63 +			tazpkg get-install tazlito
    1.64 +		fi
    1.65 +
    1.66 +		# Handle cases where tazwok is used into main system;
    1.67 +		# Handle cases where SLITAZ_DIR is not /home/slitaz.
    1.68 +		[ -L /home/slitaz/flavors ] && rm /home/slitaz/flavors
    1.69 +		mkdir -p /home/slitaz
    1.70 +		ln -s $LOCAL_REPOSITORY/flavors /home/slitaz/flavors
    1.71 +
    1.72 +		cd $LOCAL_REPOSITORY/packages
    1.73 +		for i in $LOCAL_REPOSITORY/flavors/*; do
    1.74 +			[ -d "$i" ] continue	
    1.75 +			tazlito pack-flavor ${i##*/}
    1.76 +		done
    1.77 +
    1.78 +		noheader=""
    1.79 +		for i in *.flavor; do
    1.80 +			tazlito show-flavor $i --brief $noheader
    1.81 +			noheader="--noheader"
    1.82 +		done > flavors.list
    1.83 +		[ -x /usr/bin/clean-chroot ] && clean-chroot
    1.84 +	else
    1.85 +		echo "Can't create up-to-date flavors because tazlito package is missing." >&2
    1.86 +	fi
    1.87 +	report end-step
    1.88  }
    1.89  
    1.90  ########################################################################
    1.91 @@ -2834,7 +2867,7 @@
    1.92  					# Auto-install only if we are in a cook chroot.
    1.93  					if [ -x /usr/bin/clean-chroot ]; then
    1.94  						echo "" >&2
    1.95 -						echo "You need to install mercurial	to get wok from hg (recommended). Oherwise, you can switch wok get method to \"tarball\" into $LOCAL_RESOSITORY/tazwok.conf (per-repository configuration, it not always exists) or /etc/slitaz/tazwok.conf (global configuration)." | fold >&2
    1.96 +						echo "You need to install mercurial	to get wok from hg (recommended). Oherwise, you can switch wok get method to \"tarball\" into $LOCAL_RESOSITORY/tazwok.conf (per-repository configuration, it not always exists) or /etc/slitaz/tazwok.conf (global configuration)." | fold -s >&2
    1.97  						echo "">&2
    1.98  					else
    1.99  						tazpkg get-install mercurial
   1.100 @@ -2872,7 +2905,8 @@
   1.101  
   1.102  		# Handle removed files/dir.
   1.103  		cd $WOK	
   1.104 -		for dir in $(ls -d *); do
   1.105 +		for dir in *; do
   1.106 +			[ -d $dir ] || continue
   1.107  			[ -d "$clean_wok/$dir" ] || rm -rf $dir
   1.108  		done
   1.109  		for file in */receipt */description.txt; do
   1.110 @@ -3079,6 +3113,7 @@
   1.111  		[ -f $LOCAL_RESOSITORY/incoming ] && rm [ -f $LOCAL_REPOSITORY/incoming ]
   1.112  		report step "Checking $INCOMING_REPOSITORY"
   1.113  		report open-bloc
   1.114 +		[ -f $LOCAL_REPOSITORY/log/incoming.html ] && rm $LOCAL_REPOSITORY/log/incoming.html	
   1.115  		report sublog $LOCAL_REPOSITORY/log/incoming.html
   1.116  		check_for_incoming
   1.117  		report end-sublog
   1.118 @@ -3225,4 +3260,5 @@
   1.119  	;;
   1.120  esac
   1.121  
   1.122 -report stop 2>/dev/null || exit 0
   1.123 +report stop 2>/dev/null
   1.124 +exit 0
   1.125 \ No newline at end of file