tazwok rev 193

Fix: build wok data files if missing before scanning them
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sun Jan 23 00:06:01 2011 +0100 (2011-01-23)
parents 1b566a7699ca
children 3736cce27b0a
files tazwok
line diff
     1.1 --- a/tazwok	Sat Jan 22 16:44:10 2011 +0100
     1.2 +++ b/tazwok	Sun Jan 23 00:06:01 2011 +0100
     1.3 @@ -1255,9 +1255,6 @@
     1.4  	# The toolchain packages are moved in first position.
     1.5  	grep $(for pkg in `scan "$SLITAZ_TOOLCHAIN $SLITAZ_TOOLCHAIN_EXTRA" \
     1.6  		--look_for=all --with_args`; do echo " -e ^$pkg$"; done) \
     1.7 -		$tmp/cookorder | tac 
     1.8 -	grep $(for pkg in `scan "$SLITAZ_TOOLCHAIN $SLITAZ_TOOLCHAIN_EXTRA" \
     1.9 -		--look_for=all --with_args`; do echo " -e ^$pkg$"; done) \
    1.10  		$tmp/cookorder | tac > $PACKAGES_REPOSITORY/cookorder.txt
    1.11  	for pkg in $(cat $PACKAGES_REPOSITORY/cookorder.txt); do
    1.12  		sed "/^$pkg$/d" -i $tmp/cookorder
    1.13 @@ -1392,6 +1389,18 @@
    1.14  
    1.15  scan()
    1.16  {
    1.17 +	# With some commands we don't want report (list output).
    1.18 +	if [ "$COMMAND" = gen-cooklist ] || [ "$COMMAND" = build-depends ]; then
    1.19 +		report(){ : ; }
    1.20 +	fi
    1.21 +	
    1.22 +	# Generate wok data files if they're missing. Output message in
    1.23 +	# stderr as stdout output may be used as packages list.
    1.24 +	if [ ! -s "$wan_db" ] || [ ! -s "$dep_db" ]; then
    1.25 +		echo "Missing wok data files, generating them... This may take few minutes." >&2
    1.26 +		gen_wok_db
    1.27 +	fi
    1.28 +	
    1.29  	# Get packages in argument.
    1.30  	local PACKAGE pkg_list=
    1.31  	for arg in $@; do
    1.32 @@ -1467,10 +1476,6 @@
    1.33  			done
    1.34  		fi
    1.35  		if [ "$cooklist" ]; then
    1.36 -			
    1.37 -			# Make report quiet.
    1.38 -			report(){ : ; }
    1.39 -			
    1.40  			mv $tmp/dep $tmp/cooklist
    1.41  			sort_cooklist
    1.42  			rm $tmp/cooklist