cookutils rev 60

Small imrovments to cook and cooker
author Christophe Lincoln <pankso@slitaz.org>
date Sat May 07 15:22:54 2011 +0200 (2011-05-07)
parents e72b406b4f0c
children 0ffae104a10c
files cook cooker
line diff
     1.1 --- a/cook	Sat May 07 14:33:44 2011 +0200
     1.2 +++ b/cook	Sat May 07 15:22:54 2011 +0200
     1.3 @@ -586,6 +586,7 @@
     1.4  		# Create the package folder and an empty receipt.
     1.5  		pkg="$2"
     1.6  		[ "$pkg" ] || usage
     1.7 +		[ -d "${WOK}-hg" ] && WOK=${WOK}-hg
     1.8  		echo ""
     1.9  		if [ -d "$WOK/$pkg" ]; then
    1.10  			echo -n  "$pkg " && gettext "package already exist."
     2.1 --- a/cooker	Sat May 07 14:33:44 2011 +0200
     2.2 +++ b/cooker	Sat May 07 15:22:54 2011 +0200
     2.3 @@ -234,7 +234,6 @@
     2.4  		mkdir -p $SLITAZ && cd $SLITAZ
     2.5  		[ -d "${wok}-hg" ] && echo -e "Hg wok already exists.\n" && exit 1
     2.6  		[ -d "$wok" ] && echo -e "Build wok already exists.\n" && exit 1
     2.7 -		[ -d "$flavors" ] && echo -e "Flavors repo already exists.\n" && exit 1
     2.8  
     2.9  		# Directories and files
    2.10  		echo "mkdir's and touch files in: $SLITAZ"
    2.11 @@ -244,7 +243,7 @@
    2.12  			touch $f
    2.13  		done
    2.14  		hg clone $WOK_URL ${wok}-hg || exit 1
    2.15 -		hg clone $FLAVORS_URL flavors
    2.16 +		[ -d "$flavors" ] || hg clone $FLAVORS_URL flavors
    2.17  		cp -a ${wok}-hg $wok
    2.18  		separator && echo "" ;;
    2.19  	note|-n)
    2.20 @@ -306,6 +305,7 @@
    2.21  		name="$2"
    2.22  		[ ! -d "$flavors/$name" ] && \
    2.23  			echo -e "\nSpecified flavor does not exist: $name\n" && exit 1
    2.24 +		[ -d "$flavors/.hg" ] && cd $flavors && hg pull -u
    2.25  		list=$flavors/$name/packages.list
    2.26  		cp -a $list $cooklist
    2.27  		strip_blocked
    2.28 @@ -351,11 +351,11 @@
    2.29  		separator | tee -a $LOGS/commits.log
    2.30  		
    2.31  		# Get revisions.
    2.32 -		cd $wok || ( echo "No wok found: $wok" && exit 1 )
    2.33 +		cd $wok || exit 1
    2.34  		cur=$(hg head --template '{rev}\n')
    2.35  		echo "Updating Hg wok: ${wok}-hg" | log
    2.36  		echo "hg:pull" > $command
    2.37 -		[ -f "${wok}-hg/.hg/hgrc" ] && cd ${wok}-hg && hg pull -u | log_commits
    2.38 +		cd ${wok}-hg && hg pull -u | log_commits
    2.39  		new=$(hg head --template '{rev}\n')
    2.40  		
    2.41  		# Sync build wok with rsync so we don't take care about removing old