tazwok rev 327

Fixed update-wok. It should check if file/folder doesn't exist in clean_wok before delete it in WOK. The other way delete my full WOK every time.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Feb 20 05:58:40 2011 +0000 (2011-02-20)
parents 9ccd7f7c5db3
children dc3111cd66af
files tazwok
line diff
     1.1 --- a/tazwok	Sat Feb 19 22:57:02 2011 +0000
     1.2 +++ b/tazwok	Sun Feb 20 05:58:40 2011 +0000
     1.3 @@ -2866,18 +2866,19 @@
     1.4  					# Auto-install only if we are in a cook chroot.
     1.5  					if [ -x /usr/bin/clean-chroot ]; then
     1.6  						echo "" >&2
     1.7 -						echo "You need to install mercurial	to get wok from hg (recommended). Oherwise, you can switch wok get method to \"tarball\" into $LOCAL_RESOSITORY/tazwok.conf (per-repository configuration, it not always exists) or /etc/slitaz/tazwok.conf (global configuration)." | fold -s >&2
     1.8 +						echo "You need to install mercurial to get wok from hg (recommended). Oherwise, you can switch wok get method to \"tarball\" into $LOCAL_RESOSITORY/tazwok.conf (per-repository configuration, it not always exists) or /etc/slitaz/tazwok.conf (global configuration)." | fold -s >&2
     1.9  						echo "">&2
    1.10  					else
    1.11  						tazpkg get-install mercurial
    1.12  					fi
    1.13  
    1.14 -				fi
    1.15 -				report step "Getting wok changes using hg"
    1.16 -				if [ -d .hg ]; then
    1.17 -					hg pull -u || exit 1
    1.18  				else
    1.19 -					hg clone $HG_WOK . || exit 1
    1.20 +					report step "Getting wok changes using hg"
    1.21 +					if [ -d .hg ]; then
    1.22 +						hg pull -u || exit 1
    1.23 +					else
    1.24 +						clone $HG_WOK . || exit 1
    1.25 +					fi
    1.26  				fi
    1.27  				report end-step
    1.28  				[ -x /usr/bin/clean-chroot ] && clean-chroot
    1.29 @@ -2906,13 +2907,15 @@
    1.30  		cd $WOK	
    1.31  		for dir in *; do
    1.32  			[ -d $dir ] || continue
    1.33 -			[ -d "$clean_wok/$dir" ] || rm -rf $dir
    1.34 +			[ ! -d "$clean_wok/$dir" ] || rm -rf $dir
    1.35  		done
    1.36  		for file in */receipt */description.txt; do
    1.37 -			[ -f "$clean_wok/$file" ] || rm -rf $file
    1.38 +			[ -f $file ] || continue
    1.39 +			[ ! -f "$clean_wok/$file" ] || rm -rf $file
    1.40  		done
    1.41  		for i in $(find */stuff); do
    1.42 -			[ -e "$clean_wok/$i" ] || rm -rf $i
    1.43 +			[ -e $i ] || continue
    1.44 +			[ ! -e "$clean_wok/$file" ] || rm -rf $i
    1.45  		done
    1.46  
    1.47  		cp -a $clean_wok/* $WOK