tazwok rev 18

Check for build dependencies (BUILD_DEPENDS)
author Christophe Lincoln <pankso@slitaz.org>
date Wed Jan 02 11:13:07 2008 +0100 (2008-01-02)
parents 9a7c35669bbc
children c1f521073999
files tazwok
line diff
     1.1 --- a/tazwok	Wed Jan 02 09:55:29 2008 +0100
     1.2 +++ b/tazwok	Wed Jan 02 11:13:07 2008 +0100
     1.3 @@ -16,7 +16,7 @@
     1.4  ####################
     1.5  
     1.6  # Packages categories.
     1.7 -CATEGORIES="base-system base-apps x-window extra"
     1.8 +CATEGORIES="base-system base-apps x-window devel extra"
     1.9  
    1.10  # Use words rater than numbers in the code.
    1.11  COMMAND=$1
    1.12 @@ -163,6 +163,36 @@
    1.13  	fi
    1.14  }
    1.15  
    1.16 +# Check for build dependencies and notify user.
    1.17 +check_for_build_depends()
    1.18 +{
    1.19 +	echo "Checking for build dependencies..."
    1.20 +	for pkg in $BUILD_DEPENDS
    1.21 +	do
    1.22 +		if [ ! -d "/var/lib/tazpkg/installed/$pkg" ]; then
    1.23 +			MISSING_PACKAGE=$pkg
    1.24 +		fi
    1.25 +	done
    1.26 +	if [ ! "$MISSING_PACKAGE" = "" ]; then
    1.27 +		echo "================================================================================"
    1.28 +		for pkg in $BUILD_DEPENDS
    1.29 +		do
    1.30 +			if [ ! -d "/var/lib/tazpkg/installed/$pkg" ]; then
    1.31 +				MISSING_PACKAGE=$pkg
    1.32 +				echo "Missing : $pkg"
    1.33 +			fi
    1.34 +		done
    1.35 +		echo "================================================================================"
    1.36 +		echo "You can continue or exit to install missing dependencies."
    1.37 +		echo -n "Continue or exit (y/N) ? "; read anser
    1.38 +		if [ "$anser" == "y" ]; then
    1.39 +			continue
    1.40 +		else
    1.41 +			exit 0
    1.42 +		fi
    1.43 +	fi
    1.44 +}
    1.45 +
    1.46  # Configure and make a package with the receipt.
    1.47  compile_package()
    1.48  {
    1.49 @@ -180,6 +210,7 @@
    1.50  	else
    1.51  		src=$WOK/$PACKAGE/$PACKAGE-$VERSION
    1.52  	fi
    1.53 +	check_for_build_depends
    1.54  	check_for_wanted
    1.55  	echo ""
    1.56  	echo "Starting to cook $PACKAGE..."