tazwok rev 278

Fix download: auto-install dowload tool only if command used is get-src; in other cases maintainer have to add the download tool into BUILD_DEPENDS to keep cookorder consistent, so we don't install it for him and display an error message if he forgot it; add auto-install for wget/tar when they are needed.
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Feb 14 17:32:29 2011 +0100 (2011-02-14)
parents 4798e247d453
children e01867d7ec3c
files tazwok
line diff
     1.1 --- a/tazwok	Mon Feb 14 17:19:23 2011 +0100
     1.2 +++ b/tazwok	Mon Feb 14 17:32:29 2011 +0100
     1.3 @@ -653,12 +653,17 @@
     1.4  
     1.5  download()
     1.6  {
     1.7 +	if [ "$COMMAND" = get-src ]; then
     1.8 +		if [ "${DEPENDS/tar}" != "$DEPENDS" ] || [ "${BUILD_DEPENDS/tar}" != "$BUILD_DEPENDS" ]; then
     1.9 +			[ -f $INSALLED/tar/receipt ] || tazpkg get-install tar --forced
    1.10 +		fi
    1.11 +	fi
    1.12  	for file in $@; do
    1.13  		echo "Downloading from ${file#*|}..."
    1.14  		case "$file" in
    1.15  			git\|*)
    1.16  				file=${file#git|}
    1.17 -				[ ! -f $INSTALLED/git/receipt ] && tazpkg get-install git --forced
    1.18 +				[ "$COMMAND" = get-src ] && [ ! -f $INSTALLED/git/receipt ] && tazpkg get-install git --forced
    1.19  				if [ -f $INSTALLED/git/receipt ]; then
    1.20  					mkdir $tmp_src
    1.21  					cd $tmp_src
    1.22 @@ -676,7 +681,7 @@
    1.23  			;;
    1.24  			subversion\|*)
    1.25  				file=${file#subversion|}
    1.26 -				[ ! -f $INSTALLED/subversion/receipt ] && tazpkg get-install subversion --forced
    1.27 +				[ "$COMMAND" = get-src ] && [ ! -f $INSTALLED/subversion/receipt ] && tazpkg get-install subversion --forced
    1.28  				if [ -f $INSTALLED/subversion/receipt ]; then
    1.29  					mkdir $tmp_src
    1.30  					cd $tmp_src
    1.31 @@ -693,7 +698,7 @@
    1.32  			;;
    1.33  			mercurial\|*)
    1.34  				file=${file#mercurial|}
    1.35 -				[ ! -f $INSTALLED/mercurial/receipt ] && tazpkg get-install mercurial --forced
    1.36 +				[ "$COMMAND" = get-src ] && [ ! -f $INSTALLED/mercurial/receipt ] && tazpkg get-install mercurial --forced
    1.37  				if [ -f $INSTALLED/mercurial/receipt ]; then
    1.38  					mkdir $tmp_src
    1.39  					cd $tmp_src
    1.40 @@ -709,6 +714,7 @@
    1.41  				fi
    1.42  			;;
    1.43  			https*)
    1.44 +				[ "$COMMAND" = get-src ] && [ ! -f $INSTALLED/wget/receipt ] && tazpkg get-install wget --forced
    1.45  				if [ -d $INSTALLED/wget ]; then
    1.46  					if [ "${WGET_URL%$TARBALL}" = "$WGET_URL" ] && [ "$file" = "$WGET_URL" ]; then
    1.47  						wget -q --no-check-certificate -O $TARBALL $file && break
    1.48 @@ -722,6 +728,11 @@
    1.49  			;;
    1.50  			http*|ftp*)
    1.51  				# Handle crappy URL.	
    1.52 +				if [ "$COMMAND" = get-src ]; then
    1.53 +					if [ "${DEPENDS/wget}" != "$DEPENDS" ] || [ "${BUILD_DEPENDS/wget}" != "$BUILD_DEPENDS" ]; then
    1.54 +						[ -f $INSALLED/wget/receipt ] || tazpkg get-install wget --forced
    1.55 +					fi
    1.56 +				fi
    1.57  				if [ "${WGET_URL%$TARBALL}" = "$WGET_URL" ] && [ "$file" = "$WGET_URL" ]; then
    1.58  					wget -q -O $TARBALL $file && break
    1.59  				else