spk rev 28

spk-add: rename some functions
author Christophe Lincoln <pankso@slitaz.org>
date Tue May 15 18:56:21 2012 +0200 (2012-05-15)
parents eb8149264a44
children 1e166d1364d7
files lib/libspk.sh spk-add
line diff
     1.1 --- a/lib/libspk.sh	Tue May 15 18:33:55 2012 +0200
     1.2 +++ b/lib/libspk.sh	Tue May 15 18:56:21 2012 +0200
     1.3 @@ -101,7 +101,7 @@
     1.4  	local name="$1"
     1.5  	if [ -d "$installed/$name" ]; then
     1.6  		echo $(boldify "$name") $(gettext "package is already installed.")
     1.7 -		exit 0
     1.8 +		continue
     1.9  	fi
    1.10  }
    1.11  
     2.1 --- a/spk-add	Tue May 15 18:33:55 2012 +0200
     2.2 +++ b/spk-add	Tue May 15 18:56:21 2012 +0200
     2.3 @@ -218,7 +218,7 @@
     2.4  
     2.5  # Install .tazpkg packages.
     2.6  # Parameters: package_file
     2.7 -install_pkg() {
     2.8 +install_local() {
     2.9  	package_file="$1"
    2.10  	check_root
    2.11  	check_valid_tazpkg $package_file
    2.12 @@ -237,7 +237,7 @@
    2.13  
    2.14  # Download and install a package. TODO: Handle Undigest Mirrors
    2.15  # Parameters: package_name
    2.16 -get_install() {
    2.17 +install_web() {
    2.18  	local package_name="$1"
    2.19  
    2.20  	check_root
    2.21 @@ -354,18 +354,26 @@
    2.22  # Old style
    2.23  case $1 in
    2.24  	install|-i)
    2.25 -		install_pkg $2 $3
    2.26 +		install_local $2 $3
    2.27  		exit 0 ;;
    2.28  	get-install|-gi)
    2.29 -		get_install $2
    2.30 +		install_web $2
    2.31  		exit 0 ;;
    2.32  	"") usage ;;
    2.33  esac
    2.34  
    2.35 -# Usage: spk-add package ... packageN
    2.36 +#
    2.37 +# Handle packages: package package.tazpkg ... packageN packageN.tazpkg
    2.38 +#
    2.39 +
    2.40 +check_root
    2.41 +
    2.42  for pkg in $@
    2.43  do
    2.44 -	[ -d "$installed/$pkg" ] && continue
    2.45 +	case "$pkg" in
    2.46 +		*.tazpkg|.spk)
    2.47 +			echo "Local package" ;;
    2.48 +	esac
    2.49  	echo "Adding: $pkg"
    2.50  done
    2.51  exit 0