tazwok rev 538

tazwok: Add $KBASEVER so if its set it will replace $VERSION. This fixes source version tarball name when using linux-patch $VERSION.
author Christopher Rogers <slaxemulator@gmail.com>
date Wed Jun 15 15:27:05 2011 +0000 (2011-06-15)
parents ec992cde007f
children a1fb349257d8
files tazwok
line diff
     1.1 --- a/tazwok	Fri May 27 14:35:54 2011 +0200
     1.2 +++ b/tazwok	Wed Jun 15 15:27:05 2011 +0000
     1.3 @@ -462,17 +462,17 @@
     1.4  	fi
     1.5  	tmp_src=$tmp/tarball-$$
     1.6  	if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
     1.7 -		[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] ; then
     1.8 +		[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma" ] ; then
     1.9  		cd $SOURCES_REPOSITORY
    1.10  		if [ "$SOURCE" ]; then
    1.11 -			alt_url="http://mirror.slitaz.org/sources/packages/${SOURCE:0:1}/$SOURCE-$VERSION.tar.lzma"
    1.12 +			alt_url="http://mirror.slitaz.org/sources/packages/${SOURCE:0:1}/$SOURCE-${KBASEVER:-$VERSION}.tar.lzma"
    1.13  		else
    1.14 -			alt_url="http://mirror.slitaz.org/sources/packages/${PACKAGE:0:1}/$PACKAGE-$VERSION.tar.lzma"
    1.15 +			alt_url="http://mirror.slitaz.org/sources/packages/${PACKAGE:0:1}/$PACKAGE-${KBASEVER:-$VERSION}.tar.lzma"
    1.16  		fi
    1.17  		download $WGET_URL $alt_url http://mirror.slitaz.org/sources/packages/${TARBALL:0:1}/$TARBALL
    1.18  		unset alt_url
    1.19  		if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \
    1.20 -			[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] && \
    1.21 +			[ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma" ] && \
    1.22  			[ ! -d $tmp_src ]; then
    1.23  			echo -e "\nDownload failed, exiting. Please check WGET_URL variable.\n" >&2
    1.24  			report end-step
    1.25 @@ -480,7 +480,7 @@
    1.26  		fi
    1.27  	fi
    1.28  	report end-step
    1.29 -	if { [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] && [ "$nounpack" ] ; } || \
    1.30 +	if { [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma" ] && [ "$nounpack" ] ; } || \
    1.31  	{ [ -f "$SOURCES_REPOSITORY/$TARBALL" ] && [ "$repack_src" != yes ] && [ "$nounpack" ] ; }; then
    1.32  		[ -d "$tmp_src" ] && rm -r "$tmp_src"
    1.33  		return 0
    1.34 @@ -494,11 +494,11 @@
    1.35  	# If $tmp_src exists, there's already a unpacked tarball in it.
    1.36  	if ! [ -d "$tmp_src" ]; then
    1.37  		mkdir "$tmp_src"
    1.38 -		if [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] && [ "$repack_src" = yes ]; then
    1.39 -			lzma d $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma -so | \
    1.40 +		if [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma" ] && [ "$repack_src" = yes ]; then
    1.41 +			lzma d $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma -so | \
    1.42  				tar xf - -C "$tmp_src"
    1.43  			repack_src=no
    1.44 -			TARBALL=${SOURCE:-$PACKAGE}-$VERSION.tar.lzma
    1.45 +			TARBALL=${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma
    1.46  		elif [ -f "$SOURCES_REPOSITORY/$TARBALL" ]; then
    1.47  			case "$TARBALL" in
    1.48  				*zip|*xpi) cd $tmp_src && unzip -o $SOURCES_REPOSITORY/$TARBALL ;;
    1.49 @@ -542,7 +542,7 @@
    1.50  	if [ "$repack_src" = yes ]; then
    1.51  			report step "Repacking sources in .tar.lzma format"
    1.52  			[ "$TARBALL" ] && rm -f $SOURCES_REPOSITORY/$TARBALL
    1.53 -			TARBALL=${SOURCE:-$PACKAGE}-$VERSION.tar.lzma
    1.54 +			TARBALL=${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma
    1.55  			cd "$tmp_src"
    1.56  			tar -c * | lzma e $SOURCES_REPOSITORY/$TARBALL -si
    1.57  	fi
    1.58 @@ -599,8 +599,8 @@
    1.59  		[ "$WGET_URL" ] || continue
    1.60  		if grep -q "^$PACKAGE | $VERSION" $PACKAGES_REPOSITORY/packages.desc; then
    1.61  			main_version="$VERSION"
    1.62 -			if [ -f $src_repository/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma ]; then
    1.63 -				echo -e "$PACKAGE:main\t${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" >> $src_repository/sources.list
    1.64 +			if [ -f $src_repository/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma ]; then
    1.65 +				echo -e "$PACKAGE:main\t${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma" >> $src_repository/sources.list
    1.66  			elif [ -f "$src_repository/$TARBALL" ]; then
    1.67  				echo -e "$PACKAGE:main\t$TARBALL" >> $src_repository/sources.list
    1.68  			fi
    1.69 @@ -614,8 +614,8 @@
    1.70  			fi
    1.71  		fi
    1.72  		if [ ! "$main_version" ] || [ $(grep -q "^$PACKAGE | $VERSION" $INCOMING_REPOSITORY/packages.desc 2>/dev/null) ]; then
    1.73 -			if [ -f $src_repository/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma ]; then
    1.74 -				echo -e "$PACKAGE:incoming\t${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" >> $src_repository/sources.list
    1.75 +			if [ -f $src_repository/${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma ]; then
    1.76 +				echo -e "$PACKAGE:incoming\t${SOURCE:-$PACKAGE}-${KBASEVER:-$VERSION}.tar.lzma" >> $src_repository/sources.list
    1.77  			elif [ -f "$src_repository/$TARBALL" ]; then
    1.78  				echo -e "$PACKAGE:incoming\t$TARBALL" >> $src_repository/sources.list
    1.79  			fi