tazwok rev 284

Fix function check-incoming: only consider already existing packages when checking for broken/to-cook
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Feb 14 19:27:33 2011 +0100 (2011-02-14)
parents 4f5a311f69dc
children d99c36a1ea3a
files tazwok
line diff
     1.1 --- a/tazwok	Mon Feb 14 18:36:37 2011 +0100
     1.2 +++ b/tazwok	Mon Feb 14 19:27:33 2011 +0100
     1.3 @@ -1869,28 +1869,48 @@
     1.4  	report end-step
     1.5  }
     1.6  
     1.7 +look_for_missing_pkg()
     1.8 +{
     1.9 +	for pkg in $(cat $PACKAGES_REPOSITORY/$1); do
    1.10 +		grep -q ^$pkg$ $INCOMING_REPOSITORY/packages.txt \
    1.11 +			$PACKAGES_REPOSITORY/packages.txt || \
    1.12 +			continue
    1.13 +		echo $pkg
    1.14 +	done
    1.15 +}
    1.16 +
    1.17  check_for_incoming()
    1.18  {
    1.19  	[ -s $INCOMING_REPOSITORY/packages.desc ] || {
    1.20  	echo "No packages in $INCOMING_REPOSITORY."
    1.21  	return; }
    1.22  	if [ -s $PACKAGES_REPOSITORY/broken ]; then
    1.23 -		echo "Don't move incoming packages to main repository because theses ones are broken:
    1.24 -		$(cat $PACKAGES_REPOSITORY/broken)" >&2
    1.25 -		return
    1.26 +		missingpkg=$(look_for_missing_pkg broken)
    1.27 +		if [ "$missingpkg" ]; then
    1.28 +			echo "Don't move incoming packages to main repository because theses ones are broken:" >&2
    1.29 +			echo "$missingpkg"
    1.30 +			return 1
    1.31 +		fi
    1.32  	fi
    1.33  	if [ -s $PACKAGES_REPOSITORY/cooklist ]; then
    1.34 -		echo "Don't move incoming packages to main repository because some of them need to be cooked:
    1.35 -		$(cat $PACKAGES_REPOSITORY/cooklist)" >&2
    1.36 -		return
    1.37 +		missingpkg=$(look_for_missing_pkg cooklist)
    1.38 +		if [ "$missingpkg" ]; then
    1.39 +			echo "Don't move incoming packages to main repository because theses ones needs to be cooked:" >&2
    1.40 +			echo "$missingpkg"
    1.41 +			return 1
    1.42 +		fi
    1.43  	fi
    1.44  	pkg="$(cut -f 1 -d '|' $INCOMING_REPOSITORY/packages.desc)"
    1.45  	if ! [ "$forced" ]; then
    1.46  		cooklist=$PACKAGES_REPOSITORY/cooklist
    1.47  		gen_cook_list
    1.48  		if [ -s $PACKAGES_REPOSITORY/cooklist ]; then
    1.49 -			echo "Don't move incoming packages to main repository because some of them need to be cooked." >&2
    1.50 -			return
    1.51 +			missingpkg=$(look_for_missing_pkg cooklist)
    1.52 +			if [ "$missingpkg" ]; then
    1.53 +				echo "Don't move incoming packages to main repository because theses ones needs to be cooked:" >&2
    1.54 +				echo "$missingpkg"
    1.55 +				return 1
    1.56 +			fi
    1.57  		fi
    1.58  	fi
    1.59  	report step "Moving incoming packages to main repository"