cookutils rev 82

Small improvment to screen an log output
author Christophe Lincoln <pankso@slitaz.org>
date Sun May 08 02:07:12 2011 +0200 (2011-05-08)
parents 5d21241ca811
children 71a4432a8c30
files cooker
line diff
     1.1 --- a/cooker	Sun May 08 01:40:02 2011 +0200
     1.2 +++ b/cooker	Sun May 08 02:07:12 2011 +0200
     1.3 @@ -98,7 +98,7 @@
     1.4  	separator
     1.5  	echo "Hg wok revision  : $cur"
     1.6  	echo "Pulled revision  : $new"
     1.7 -	echo "Check date       : $(date '+%Y-%m-%d %H:%M')"
     1.8 +	echo "Check date       : $(date '+%Y-%m-%d %H:%M:%S')"
     1.9  }
    1.10  
    1.11  # Scan packages build deps and fill up cookorder list.
    1.12 @@ -373,13 +373,16 @@
    1.13  		echo ""
    1.14  		echo "Checking for commits" | log_commits
    1.15  		separator | tee -a $LOGS/commits.log
    1.16 -		gettext "Starting with PID: "
    1.17 -		echo $$ | tee $pidfile
    1.18 +		echo $$ > $pidfile
    1.19 +		echo "Cooker PID   : $$" | log_commits
    1.20 +		echo "Cooker date  : $(date '+%Y-%m-%d %H:%M:%S')" | log_commits
    1.21  		
    1.22 -		# Get revisions.
    1.23 +		# Get revisions. Here we have 2 echo since we want msg on screen,
    1.24 +		# in commits log and activity DB without space before :
    1.25  		cd $wok || exit 1
    1.26  		cur=$(hg head --template '{rev}\n')
    1.27 -		echo "Updating Hg wok: ${wok}-hg" | log
    1.28 +		echo "Updating wok : ${wok}-hg (rev $cur)" | log_commits
    1.29 +		echo "Updating wok: ${wok}-hg" | log
    1.30  		echo "hg:pull" > $command
    1.31  		cd ${wok}-hg && hg pull -u | log_commits
    1.32  		new=$(hg head --template '{rev}\n')
    1.33 @@ -414,9 +417,11 @@
    1.34  		done
    1.35  		
    1.36  		# Keep previous commit and discard duplicate lines
    1.37 +		pkgs=$(cat $commits | wc -l)
    1.38  		cat $commits $commits.tmp | sed /"^$"/d > $commits.new
    1.39  		uniq $commits.new > $commits && rm $commits.*
    1.40 -		echo "Packages to cook : $(cat $commits | wc -l)" | log_commits
    1.41 +		echo "Packages to cook: $pkgs" | log_commits
    1.42 +		echo "Packages to cook: $pkgs" | log
    1.43  		separator | log_commits
    1.44  		echo ""
    1.45  		strip_blocked