tazwok rev 233

Use new approach to avoid the need of SRC_WANTED
author Antoine Bodin <gokhlayeh@slitaz.org>
date Wed Feb 09 17:17:34 2011 +0100 (2011-02-09)
parents 96231de1f61b
children a618127f3ce2
files tazwok
line diff
     1.1 --- a/tazwok	Mon Feb 07 21:48:52 2011 +0000
     1.2 +++ b/tazwok	Wed Feb 09 17:17:34 2011 +0100
     1.3 @@ -423,22 +423,11 @@
     1.4  # Check for src tarball and wget if needed.
     1.5  check_for_tarball()
     1.6  {
     1.7 -	if [ "$SRC_WANTED" ]; then
     1.8 -		VERSION_SRCWANTED=$(grep  ^VERSION= $WOK/$SRC_WANTED/receipt | cut -d "=" -f2 | sed -e 's/"//g')
     1.9 -		[ "$VERSION" != "$VERSION_SRCWANTED" ] || return
    1.10 -		if [ "$SOURCE" ]; then
    1.11 -			tazwok get-src "$SRC_WANTED"  --target=$WOK/$PACKAGE/$SOURCE-$VERSION ${nounpack:+--nounpack} || return 1
    1.12 -		else
    1.13 -			tazwok get-src "$SRC_WANTED" --target=$WOK/$PACKAGE/$PACKAGE-$VERSION ${nounpack:+--nounpack} || return 1
    1.14 -		fi
    1.15 -		return
    1.16 -	fi
    1.17 -	
    1.18  	if [ "$WGET_URL" ]; then
    1.19  		report step "Checking for source tarball"
    1.20  			
    1.21  		if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
    1.22 -			[ ! -f "$SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma" ] ; then
    1.23 +			[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE-$VERSION.tar.lzma" ] ; then
    1.24  			cd $SOURCES_REPOSITORY
    1.25  			download $WGET_URL
    1.26  			
    1.27 @@ -446,7 +435,11 @@
    1.28  			# mirror.
    1.29  			if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ]; then
    1.30  				report step "Download failed, try with mirror copy... "
    1.31 -				download http://mirror.slitaz.org/sources/packages/${PACKAGE:0:1}/$PACKAGE-$VERSION.tar.lzma
    1.32 +				if [ "$SOURCE" ]; then
    1.33 +					download http://mirror.slitaz.org/sources/packages/${SOURCE:0:1}/$SOURCE-$VERSION.tar.lzma
    1.34 +				else
    1.35 +					download http://mirror.slitaz.org/sources/packages/${PACKAGE:0:1}/$PACKAGE-$VERSION.tar.lzma
    1.36 +				fi
    1.37  			fi
    1.38  			if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
    1.39  				[ ! -f "$SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma" ]; then
    1.40 @@ -465,7 +458,7 @@
    1.41  	fi
    1.42  	report end-step
    1.43  	
    1.44 -	if [ -f "$SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma" ] && [ "$nounpack" ]; then
    1.45 +	if [ -f "$SOURCES_REPOSITORY/$PACKAGE-${SOURCE:-$VERSION.tar.lzma" ] && [ "$nounpack" ]; then
    1.46  		return
    1.47  	fi
    1.48  
    1.49 @@ -487,8 +480,8 @@
    1.50  			
    1.51  	tmp_src=$WOK/$PACKAGE/tmp-src-$$
    1.52  	mkdir $tmp_src
    1.53 -	if [ -f "$SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma" ]; then
    1.54 -		lzma d $SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma -so | \
    1.55 +	if [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ]; then
    1.56 +		lzma d $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma -so | \
    1.57  			tar xf - -C $tmp_src
    1.58  	elif [ -f "$SOURCES_REPOSITORY/$TARBALL" ]; then
    1.59  		case "$TARBALL" in
    1.60 @@ -506,7 +499,7 @@
    1.61  			if check_for_var_modification src _pkg; then
    1.62  				mv $tmp_src $tmp_src-1
    1.63  				mkdir $tmp_src
    1.64 -				mv $tmp_src-1 $tmp_src/$PACKAGE-$VERSION
    1.65 +				mv $tmp_src-1 $tmp_src/${SOURCE:-$PACKAGE}-$VERSION
    1.66  			else
    1.67  				mv $tmp_src/* $WOK/$PACKAGE
    1.68  				repack_src=no
    1.69 @@ -517,7 +510,7 @@
    1.70  		if [ "$repack_src" = yes ]; then
    1.71  			report step "Repacking sources in .tar.lzma format"
    1.72  			cd $tmp_src
    1.73 -			tar -c * | lzma e $SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma -si
    1.74 +			tar -c * | lzma e $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma -si
    1.75  			rm $SOURCES_REPOSITORY/$TARBALL
    1.76  			prev_VERSION=$(get_pkg_version $INCOMING_REPOSITORY)
    1.77  
    1.78 @@ -1158,7 +1151,7 @@
    1.79  	unset PACKAGE SOURCE VERSION EXTRAVERSION CATEGORY SHORT_DESC \
    1.80  		MAINTAINER WEB_SITE WGET_URL DEPENDS BUILD_DEPENDS WANTED \
    1.81  		PACKED_SIZE UNPACKED_SIZE COOK_OPT PROVIDE CONFIG_FILES TAGS \
    1.82 -		src _pkg DESTDIR SRC_WANTED CONFIG_SITE
    1.83 +		src _pkg DESTDIR CONFIG_SITE
    1.84  	. ${RECEIPT:-$PWD/receipt}
    1.85  }
    1.86