tazpkg rev 429 4.3

Add --root-config option to install/get-install: Use lib & cache from $root instead of main system (usefull to install using other repositories than thoses defined on host). (4.3)
author Antoine Bodin <gokhlayeh@slitaz.org>
date Thu Feb 24 23:51:02 2011 +0100 (2011-02-24)
parents 9e17dfffe734
children df5c6e3fb2cd
files tazpkg
line diff
     1.1 --- a/tazpkg	Fri Mar 04 03:31:16 2011 +0100
     1.2 +++ b/tazpkg	Thu Feb 24 23:51:02 2011 +0100
     1.3 @@ -1752,12 +1752,22 @@
     1.4  		
     1.5  		# Get repositories priority list.
     1.6  		look_for_priority
     1.7 -		get_options_list="root forced list"
     1.8 +		get_options_list="root forced list root-config"
     1.9  		get_options
    1.10  		
    1.11 +		[ "$root" ] && ROOT="$root" && check_base_dir "$root"
    1.12 +		[ "$list" ] && INSTALL_LIST="$list"
    1.13 +		if [ "$root-config" ]; then
    1.14 +			if [ "$root" ]; then
    1.15 +				CACHE_DIR=$root/$CACHE_DIR
    1.16 +				LOCALSTATE=$root/$LOCALSTATE
    1.17 +				INSTALLED=$root/$INSTALLED
    1.18 +			else
    1.19 +				echo "root-config needs --root= option used." >&2
    1.20 +				exit 1
    1.21 +			fi
    1.22 +		fi	
    1.23  		# Check if forced install.
    1.24 -		[ "$root" ] && ROOT="$root" && check_dir "$root"
    1.25 -		[ "$list" ] && INSTALL_LIST="$list"
    1.26  		if ! [ "$forced" ]; then
    1.27  			check_for_installed_package $ROOT
    1.28  		fi
    1.29 @@ -2615,13 +2625,23 @@
    1.30  		
    1.31  		# Get repositories priority list.
    1.32  		look_for_priority
    1.33 -		get_options_list="root forced list"
    1.34 +		get_options_list="root forced list root-config"
    1.35  		get_options
    1.36  		
    1.37  		DO_CHECK=""
    1.38  		[ "$forced" ] && DO_CHECK=no
    1.39 -		[ "$root" ] && ROOT="$root" && check_dir "$root"
    1.40 +		[ "$root" ] && ROOT="$root" && check_base_dir "$root"
    1.41  		[ "$list" ] && INSTALL_LIST="$list"
    1.42 +		if [ "$root-config" ]; then
    1.43 +			if [ "$root" ]; then
    1.44 +				CACHE_DIR=$root/$CACHE_DIR
    1.45 +				LOCALSTATE=$root/$LOCALSTATE
    1.46 +				INSTALLED=$root/$INSTALLED
    1.47 +			else
    1.48 +				echo "root-config needs --root= option used." >&2
    1.49 +				exit 1
    1.50 +			fi
    1.51 +		fi
    1.52  		AUTOEXEC="no"
    1.53  		if ! check_for_package_in_list check; then
    1.54  			PACKAGE=get-$PACKAGE