wok-6.x rev 10841

locale-zh_CN: Fixed post_install and post_remove to be only work when not being installed with --root option.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Jun 10 02:24:41 2011 +0800 (2011-06-10)
parents ad950661374c
children 67b1c30b972d
files locale-zh_CN/receipt
line diff
     1.1 --- a/locale-zh_CN/receipt	Thu Jun 09 11:52:00 2011 +0000
     1.2 +++ b/locale-zh_CN/receipt	Fri Jun 10 02:24:41 2011 +0800
     1.3 @@ -42,16 +42,20 @@
     1.4  
     1.5  post_install()
     1.6  {
     1.7 -	echo LANG=zh_CN.UTF-8 > /etc/locale.conf
     1.8 -	echo Asia/Shanghai > /etc/TZ
     1.9 -	export TZ=Asia/Shanghai
    1.10 -	hwclock --hctosys
    1.11 +	if [ -z "$1" ]; then
    1.12 +		echo LANG=zh_CN.UTF-8 > /etc/locale.conf
    1.13 +		echo Asia/Shanghai > /etc/TZ
    1.14 +		export TZ=Asia/Shanghai
    1.15 +		hwclock --hctosys
    1.16 +	fi
    1.17  }
    1.18  
    1.19  # Back to C if it's the last used locale.
    1.20  post_remove()
    1.21  {
    1.22 -	if grep -q $LOCALEDEF /etc/locale.conf; then
    1.23 -		echo "LANG=C" > /etc/locale.conf
    1.24 +	if [ -z "$1" ]; then
    1.25 +		if [ $(grep -q $LOCALEDEF /etc/locale.conf) ]; then
    1.26 +			echo "LANG=C" > /etc/locale.conf
    1.27 +		fi
    1.28  	fi
    1.29  }