tazwok rev 241

Reworking gen-cooklist function to not use check_commit with it.
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Feb 11 00:39:20 2011 +0100 (2011-02-11)
parents 38f279f7cd0a
children cf9db010eecc
files tazwok
line diff
     1.1 --- a/tazwok	Thu Feb 10 23:13:52 2011 +0100
     1.2 +++ b/tazwok	Fri Feb 11 00:39:20 2011 +0100
     1.3 @@ -1466,18 +1466,34 @@
     1.4  		gen_wan_db
     1.5  		look_for=all && with_args=yes && with_dev= && with_wanted=
     1.6  		filter=use_wanted
     1.7 -		append_to_dep()
     1.8 -		{
     1.9 -			check_for_commit && echo $PACKAGE >> $tmp/dep
    1.10 -		}
    1.11 +		if [ "$COMMAND" = gen-cooklist ]; then
    1.12 +   			for PACKAGE in $pkg_list; do
    1.13 +				grep -q ^$PACKAGE$'\t' $dep_db && continue
    1.14 +				[ -d "$WOK/$p" ] || continue
    1.15 +				check_for_missing
    1.16 +			done
    1.17 +			append_to_dep()
    1.18 +			{
    1.19 +				if ! grep -q ^$PACKAGE$'\t' $dep_db; then
    1.20 +					check_for_missing && echo $PACKAGE >> $tmp/dep
    1.21 +				else
    1.22 +					echo $PACKAGE >> $tmp/dep
    1.23 +				fi
    1.24 +			}
    1.25 +		else
    1.26 +			append_to_dep()
    1.27 +			{
    1.28 +				check_for_commit && echo $PACKAGE >> $tmp/dep
    1.29 +			}
    1.30 +		fi
    1.31  	else
    1.32  		append_to_dep()
    1.33  		{
    1.34  			echo $PACKAGE >> $tmp/dep
    1.35  		}
    1.36  		# If requested packages are not in dep_db, partial generation of this db is needed.
    1.37 -		for p in $pkg_list; do
    1.38 -			grep -q ^$p$'\t' $dep_db && continue
    1.39 +		for PACKAGE in $pkg_list; do
    1.40 +			grep -q ^$PACKAGE$'\t' $dep_db && continue
    1.41  			[ -d "$WOK/$p" ] || continue	
    1.42  			plan_check_for_missing=yes	
    1.43  			check_for_missing
    1.44 @@ -1554,6 +1570,7 @@
    1.45  		[ "$?" = 2 ] && return 1
    1.46  		return
    1.47  	fi
    1.48 +	RECEIPT=$WOK/$PACKAGE/receipt
    1.49  	source_receipt
    1.50  	PACKAGE=${WANTED:-$PACKAGE}
    1.51  	update_wan_db
    1.52 @@ -1661,7 +1678,7 @@
    1.53  		done
    1.54  	fi
    1.55  	
    1.56 -	if [ -s $PACKAGES_REPOSITORY/commit ]; then
    1.57 +	if [ -s $PACKAGES_REPOSITORY/commit ] && [ "$COMMAND" != gen-cooklist ]; then
    1.58  		cd $PACKAGES_REPOSITORY
    1.59  		for PACKAGE in $(cat commit); do
    1.60  			WANTED="$(look_for_wanted)"