tazwok rev 253

Fix an issue into check_for_tarball() which prevent to cook packages without WGET_URL
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sat Feb 12 14:28:03 2011 +0100 (2011-02-12)
parents e30b39bbe912
children f91a9bc05a97
files tazwok
line diff
     1.1 --- a/tazwok	Sat Feb 12 14:21:57 2011 +0100
     1.2 +++ b/tazwok	Sat Feb 12 14:28:03 2011 +0100
     1.3 @@ -435,40 +435,39 @@
     1.4  # Check for src tarball and wget if needed.
     1.5  check_for_tarball()
     1.6  {
     1.7 -	if [ "$WGET_URL" ]; then
     1.8 -		report step "Checking for source tarball"
     1.9 -			
    1.10 -		if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
    1.11 -			[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] ; then
    1.12 -			cd $SOURCES_REPOSITORY
    1.13 -			download $WGET_URL
    1.14 -			
    1.15 -			# If source tarball is unreachable, try to find it on SliTaz
    1.16 -			# mirror.
    1.17 -			if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ]; then
    1.18 -				report step "Download failed, try with mirror copy... "
    1.19 -				if [ "$SOURCE" ]; then
    1.20 -					download http://mirror.slitaz.org/sources/packages/${SOURCE:0:1}/$SOURCE-$VERSION.tar.lzma
    1.21 -				else
    1.22 -					download http://mirror.slitaz.org/sources/packages/${PACKAGE:0:1}/$PACKAGE-$VERSION.tar.lzma
    1.23 -				fi
    1.24 -			fi
    1.25 -			if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
    1.26 -				[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-PACKAGE}-$VERSION.tar.lzma" ]; then
    1.27 -				report step "Download failed, try with mirror copy (again)... "
    1.28 -				file=$(basename $WGET_URL)
    1.29 -				download http://mirror.slitaz.org/sources/packages/${file:0:1}/$file
    1.30 -			fi
    1.31 -
    1.32 -			# Exit if download failed to avoid errors.
    1.33 -			if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && [ ! -f "$SOURCES_REPOSITORY/${SOURCE:-PACKAGE}-$VERSION.tar.lzma" ; then
    1.34 -				echo -e "\nDownload failed, exiting. Please check WGET_URL variable.\n" >&2
    1.35 -				report end-step
    1.36 -				return 1
    1.37 +	[ "$WGET_URL" ] || return
    1.38 +	report step "Checking for source tarball"
    1.39 +	
    1.40 +	if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
    1.41 +		[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] ; then
    1.42 +		cd $SOURCES_REPOSITORY
    1.43 +		download $WGET_URL
    1.44 +		
    1.45 +		# If source tarball is unreachable, try to find it on SliTaz
    1.46 +		# mirror.
    1.47 +		if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ]; then
    1.48 +			report step "Download failed, try with mirror copy... "
    1.49 +			if [ "$SOURCE" ]; then
    1.50 +				download http://mirror.slitaz.org/sources/packages/${SOURCE:0:1}/$SOURCE-$VERSION.tar.lzma
    1.51 +			else
    1.52 +				download http://mirror.slitaz.org/sources/packages/${PACKAGE:0:1}/$PACKAGE-$VERSION.tar.lzma
    1.53  			fi
    1.54  		fi
    1.55 -		report end-step
    1.56 +		if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
    1.57 +			[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-PACKAGE}-$VERSION.tar.lzma" ]; then
    1.58 +			report step "Download failed, try with mirror copy (again)... "
    1.59 +			file=$(basename $WGET_URL)
    1.60 +			download http://mirror.slitaz.org/sources/packages/${file:0:1}/$file
    1.61 +		fi
    1.62 +
    1.63 +		# Exit if download failed to avoid errors.
    1.64 +		if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && [ ! -f "$SOURCES_REPOSITORY/${SOURCE:-PACKAGE}-$VERSION.tar.lzma" ; then
    1.65 +			echo -e "\nDownload failed, exiting. Please check WGET_URL variable.\n" >&2
    1.66 +			report end-step
    1.67 +			return 1
    1.68 +		fi
    1.69  	fi
    1.70 +	report end-step
    1.71  	
    1.72  	if [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] && [ "$nounpack" ]; then
    1.73  		return