tazpkg rev 448 4.3

bugfix
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Apr 01 03:43:47 2011 +0200 (2011-04-01)
parents 27d053dfc95c
children 5f9f0aceea96
files tazpkg
line diff
     1.1 --- a/tazpkg	Fri Mar 25 18:22:11 2011 +0100
     1.2 +++ b/tazpkg	Fri Apr 01 03:43:47 2011 +0200
     1.3 @@ -2229,13 +2229,20 @@
     1.4  		# Recharge packages.list from a mirror.
     1.5  		#
     1.6  		check_root
     1.7 -		if [ "$2" = main ]; then
     1.8 +		get_options_list="root forced list rootconfig"
     1.9 +		get_options
    1.10 +		ARG=$2
    1.11 +		if [ "$root" ]; then
    1.12 +			LOCALSTATE=$root$LOCALSTATE
    1.13 +			[ "${2#--}" != "$2" ] && ARG=$3
    1.14 +		fi
    1.15 +		if [ "$ARG" = main ]; then
    1.16  			repository_to_recharge=$LOCALSTATE
    1.17 -		elif [ "$2" ]; then
    1.18 -			if [ -d "$LOCALSTATE/undigest/$2" ]; then
    1.19 -				repository_to_recharge=$LOCALSTATE/undigest/$2
    1.20 +		elif [ "$ARG" ]; then
    1.21 +			if [ -d "$LOCALSTATE/undigest/$ARG" ]; then
    1.22 +				repository_to_recharge=$LOCALSTATE/undigest/$ARG
    1.23  			else
    1.24 -				echo "\$LOCALSTATE/undigest/$2 `gettext \"doesn't exists.\"`" >&2
    1.25 +				echo "\$LOCALSTATE/undigest/$ARG `gettext \"doesn't exists.\"`" >&2
    1.26  				exit 1
    1.27  			fi
    1.28  		else
    1.29 @@ -2718,6 +2725,7 @@
    1.30  			download $PACKAGE.tazpkg
    1.31  		fi
    1.32  		PACKAGE_FILE=$CACHE_DIR/$PACKAGE.tazpkg
    1.33 +		[ "$rootconfig" ] && LOCALSTATE=${LOCALSTATE#$root}
    1.34  		install_package $ROOT
    1.35  		[ "$AUTOEXEC" != "no" ] && $PACKAGE $ROOT 
    1.36  		update_desktop_database $ROOT