wok-current rev 3500

tazdev: Add command projects-stats (-ps)
author Christophe Lincoln <pankso@slitaz.org>
date Fri Jun 19 05:11:41 2009 +0200 (2009-06-19)
parents 3934f2921b68
children f2257ece4594
files slitaz-dev-tools/stuff/README slitaz-dev-tools/stuff/tazdev slitaz-dev-tools/stuff/tazdev.conf
line diff
     1.1 --- a/slitaz-dev-tools/stuff/README	Fri Jun 19 02:43:44 2009 +0200
     1.2 +++ b/slitaz-dev-tools/stuff/README	Fri Jun 19 05:11:41 2009 +0200
     1.3 @@ -12,6 +12,7 @@
     1.4  SliTaz Laboratories:    http://labs.slitaz.org/
     1.5  Developers wiki:        http://labs.slitaz.org/wiki/distro
     1.6  Build host:             http://tank.slitaz.org/
     1.7 +Build bot:              http://bb.slitaz.org/
     1.8  
     1.9  
    1.10  ===============================================================================
     2.1 --- a/slitaz-dev-tools/stuff/tazdev	Fri Jun 19 02:43:44 2009 +0200
     2.2 +++ b/slitaz-dev-tools/stuff/tazdev	Fri Jun 19 05:11:41 2009 +0200
     2.3 @@ -22,17 +22,18 @@
     2.4  	echo -e "\nSliTaz developers and build host tool\n
     2.5  \033[1mUsage: \033[0m `basename $0` [command] [user] [stable|cooking|path]
     2.6  \033[1mCommands: \033[0m\n
     2.7 -  usage         Print this short usage and command list.
     2.8 -  cmplog        Log 'tazwok cmp' result (or use tazbb).
     2.9 -  update-wok    Update Hg wok and copy it to the chroot wok.
    2.10 -  update-www    Update SliTaz Website repo from Hg.
    2.11 -  chroot        Mount virtual fs if needed and chroot into the build env.
    2.12 -  gen-chroot    Generate a chroot environment using the last cooking base rootf.
    2.13 -  clean-chroot  Clean a chroot environment (skip root/ and home/)
    2.14 -  push          Upload new packages to the main mirror.
    2.15 -  dry-push      Show what will be uploaded to the mirror. Does nothing.
    2.16 -  pull          Download new packages from the main mirror.
    2.17 -  dry-pull      Show what will be downloaded from the mirror. Does nothing.\n"
    2.18 + usage          Print this short usage and command list.
    2.19 + projects-stats Display statistics about your projects (-ps)
    2.20 + cmplog         Log 'tazwok cmp' result (or use tazbb).
    2.21 + update-wok     Update Hg wok and copy it to the chroot wok.
    2.22 + update-www     Update SliTaz Website repo from Hg.
    2.23 + chroot         Mount virtual fs if needed and chroot into the build env.
    2.24 + gen-chroot     Generate a chroot using the last cooking base rootfs.
    2.25 + clean-chroot   Clean a chroot environment (skip root/ and home/)
    2.26 + push           Upload new packages to the main mirror (-p).
    2.27 + dry-push       Show what will be uploaded to the mirror. Does nothing (-dp).
    2.28 + pull           Download new packages from the main mirror.
    2.29 + dry-pull       Show what will be downloaded from the mirror. Does nothing.\n"
    2.30  }
    2.31  
    2.32  # Exit if user is not root.
    2.33 @@ -47,10 +48,11 @@
    2.34  status()
    2.35  {
    2.36  	local CHECK=$?
    2.37 +	echo -en "\033[70G"
    2.38  	if [ $CHECK = 0 ]; then
    2.39 -		echo " Done"
    2.40 +		echo "Done"
    2.41  	else
    2.42 -		echo " Failed"
    2.43 +		echo "Failed"
    2.44  	fi
    2.45  	return $CHECK
    2.46  }
    2.47 @@ -145,6 +147,30 @@
    2.48  		echo -e "Starting 'tazwok cmp' (can be long)...\n"
    2.49  		tazwok cmp | grep ^[A-Z] | tee $CMP_LOG
    2.50  		echo "Date: `date`" >> $CMP_LOG ;;
    2.51 +	'-ps'|projects-stats)
    2.52 +		echo -e "\nStatistics for: $PROJECTS\n"
    2.53 +		echo -n "Project" && echo -ne "\033[24G Size" && echo -ne "\033[38G Revision"
    2.54 +		echo -ne "\033[48G Version" && echo -e "\033[64G Files"
    2.55 +		echo "================================================================================"
    2.56 +		cd $PROJECTS
    2.57 +		for proj in *
    2.58 +		do
    2.59 +			rev=""
    2.60 +			echo -n "$proj"
    2.61 +			size=`du -sh $proj | awk '{ print $1 }'`
    2.62 +			echo -ne "\033[24G $size"
    2.63 +			if [ -d $proj/.hg ]; then
    2.64 +				cd $proj
    2.65 +				rev=`hg head --template '{rev}\n'`
    2.66 +				vers=`hg tags | head -n 2 | tail -n 1 | cut -d " " -f 1`
    2.67 +				echo -ne "\033[38G $rev"
    2.68 +				echo -ne "\033[48G $vers" && cd ..
    2.69 +			fi
    2.70 +			files=`find $proj -type f | wc -l`
    2.71 +			echo -e "\033[64G $files"
    2.72 +		done
    2.73 +		echo "================================================================================"
    2.74 +		echo "" ;;
    2.75  	update-wok)
    2.76  		# Update the Hg wok and copy it to the chroot env. Hg wok is
    2.77  		# copied to the chroot wok to avoid messing with build result
    2.78 @@ -219,11 +245,11 @@
    2.79  		done
    2.80  		echo "================================================================================"
    2.81  		echo "" ;;
    2.82 -	push)
    2.83 +	'-p'|push)
    2.84  		check_mirror
    2.85  		rsync -r -t -l -v -z --delete \
    2.86  			$LOCAL_DIR -e ssh $USER@$MIRROR:$REMOTE_DIR ;;
    2.87 -	dry-push)
    2.88 +	'-dp'|dry-push)
    2.89  		check_mirror
    2.90  		rsync -r -t -l -v -z --delete --dry-run \
    2.91  			$LOCAL_DIR -e ssh $USER@$MIRROR:$REMOTE_DIR ;;
     3.1 --- a/slitaz-dev-tools/stuff/tazdev.conf	Fri Jun 19 02:43:44 2009 +0200
     3.2 +++ b/slitaz-dev-tools/stuff/tazdev.conf	Fri Jun 19 05:11:41 2009 +0200
     3.3 @@ -10,6 +10,7 @@
     3.4  
     3.5  # Path to the Website repo.
     3.6  WEBSITE="/home/slitaz/www/website"
     3.7 +PROJECTS="$HOME/Projects"
     3.8  
     3.9  # Main mirror to push and download (ISO, rootfs. etc).
    3.10  MIRROR="mirror.slitaz.org"