spk rev 91

spk-add: handle online arch packages (installing online pkgs from an ARM machine works :-)
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 25 16:00:43 2012 +0200 (2012-05-25)
parents 50cd05f3fa15
children 51329da37c52
files spk-add
line diff
     1.1 --- a/spk-add	Fri May 25 15:53:02 2012 +0200
     1.2 +++ b/spk-add	Fri May 25 16:00:43 2012 +0200
     1.3 @@ -119,7 +119,7 @@
     1.4  	case "$SLITAZ_ARCH" in
     1.5  		arm|x86_64) arch="-${SLITAZ_ARCH}" ;;
     1.6  	esac
     1.7 -	tmpdir="$tmpdir/$PACKAGE-${VERSION}${arch}" 
     1.8 +	tmpdir="$tmpdir/$PACKAGE-${VERSION}${arch}"
     1.9  
    1.10  	# Get files to remove if upgrading
    1.11  	local files_to_remove
    1.12 @@ -300,12 +300,6 @@
    1.13  	#fi
    1.14  
    1.15  	# Check if package is mirrored
    1.16 -	#if ! mirrored_pkg $package_name; then
    1.17 -		#gettext "Could not find package on mirror:"
    1.18 -		#boldify " $package_name" && exit 1
    1.19 -	#fi
    1.20 -
    1.21 -	# Check if package is mirrored
    1.22  	mirrored_pkg $package_name
    1.23  	if [ ! "$mirrored" ]; then
    1.24  		gettext "Could not find package on mirror:"
    1.25 @@ -313,7 +307,14 @@
    1.26  	fi
    1.27  
    1.28  	# We want: package-version.tazpkg
    1.29 -	local package_full=$(full_package $package_name)
    1.30 +	local package_full=$(full_package ${package_name})
    1.31 +
    1.32 +	# Add architecture string to package full name
    1.33 +	case "$SLITAZ_ARCH" in
    1.34 +		arm|x86_64)
    1.35 +			pkgarch="-${SLITAZ_ARCH}.tazpkg"
    1.36 +			package_full=$(echo $package_full | sed s/.tazpkg/$pkgarch/) ;;
    1.37 +	esac
    1.38  
    1.39  	# Let fetch the package by download()
    1.40  	[ "$count" == 1 ] && newline