cookutils rev 13
cooker: more log and better (again)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu May 05 00:06:01 2011 +0200 (2011-05-05) |
parents | 97ff63251957 |
children | 01dfc1ed1e0e |
files | cook cooker |
line diff
1.1 --- a/cook Wed May 04 23:36:02 2011 +0200 1.2 +++ b/cook Thu May 05 00:06:01 2011 +0200 1.3 @@ -62,7 +62,7 @@ 1.4 echo -e "\\033[0;39m ]" 1.5 } 1.6 1.7 -# Log activities. 1.8 +# Log activities, we want first letter capitalized. 1.9 log() { 1.10 grep ^[a-zA-Z0-9] | \ 1.11 sed s"#^[A-Z]\([^']*\)#$(date '+%Y-%m-%d %H:%M') : \0#" >> $activity 1.12 @@ -472,7 +472,7 @@ 1.13 gettext -e "All done, ready to cook packages :-)\n\n" ;; 1.14 test) 1.15 # Test a cook environment. 1.16 - echo "cook test: testing the cook environment" | log 1.17 + echo "Cook test: testing the cook environment" | log 1.18 [ ! -d "$WOK" ] && exit 1 1.19 [ ! -d "$WOK/cooktest" ] && cp -r $DATA/cooktest $WOK 1.20 cook cooktest ;; 1.21 @@ -498,7 +498,7 @@ 1.22 [ -z "$2" ] && gettext -e "\nNo list in argument.\n\n" && exit 1 1.23 [ ! -f "$2" ] && gettext -e "\nNo list found:" && \ 1.24 echo -e " $2\n" && exit 1 1.25 - echo "cook list: Starting to cook: $2" | log 1.26 + echo "Cook list starting: $2" | log 1.27 for pkg in $(cat $2) 1.28 do 1.29 cook $pkg || broken 1.30 @@ -519,7 +519,7 @@ 1.31 [ ! -d "$PKGS" ] && \ 1.32 gettext -e "\nPackages directory dont exist\n\n" && exit 1 1.33 cd $PKGS 1.34 - echo "cook pkglist: Creating packages list" | log 1.35 + echo "Cook pkglist: Creating all packages list" | log 1.36 gettext -e "\nCreating lists for:"; echo " $PKGS" 1.37 separator 1.38 rm -f packages.* files.list*
2.1 --- a/cooker Wed May 04 23:36:02 2011 +0200 2.2 +++ b/cooker Thu May 05 00:06:01 2011 +0200 2.3 @@ -50,7 +50,7 @@ 2.4 [ -s "$activity" ] && tail -n 20 $activity > /tmp/tail && \ 2.5 mv -f /tmp/tail $activity 2.6 2.7 -# Log activities. 2.8 +# Log activities, we want first letter capitalized. 2.9 log() { 2.10 grep ^[a-zA-Z0-9] | \ 2.11 sed s"#^[A-Z]\([^']*\)#$(date '+%Y-%m-%d %H:%M') : \0#" >> $activity 2.12 @@ -155,7 +155,7 @@ 2.13 if [ -s "$commits" ]; then 2.14 for pkg in $(cat $commits) 2.15 do 2.16 - echo "cook started for: <a href='cooker.cgi?log=$pkg'>$pkg</a>" | log 2.17 + echo "Cook started for: <a href='cooker.cgi?log=$pkg'>$pkg</a>" | log 2.18 echo "cook:$pkg" > $status 2.19 cook $pkg || broken 2.20 sed -i /^${pkg}$/d $commits 2.21 @@ -172,7 +172,7 @@ 2.22 --setup) 2.23 # Setup the Cooker environment. 2.24 echo -e "\nSetting up the Cooker" 2.25 - echo "cooker --setup: $SLITAZ" | log 2.26 + echo "Cooker --setup using: $SLITAZ" | log 2.27 separator 2.28 for pkg in mercurial rsync slitaz-toolchain 2.29 do 2.30 @@ -209,7 +209,7 @@ 2.31 --pkg=*) 2.32 # Same as 'cook pkg' but with log for web interface. 2.33 pkg=${1#--pkg=} 2.34 - echo "cook started for: <a href='cooker.cgi?log=$pkg'>$pkg</a>" | log 2.35 + echo "Cook started for: <a href='cooker.cgi?log=$pkg'>$pkg</a>" | log 2.36 cook $pkg || broken ;; 2.37 --cat=*) 2.38 # Cook all packages of a category. 2.39 @@ -223,7 +223,7 @@ 2.40 cook_order | tee $LOGS/cooker-order.log 2.41 for pkg in $(cat $cooklist) 2.42 do 2.43 - echo "cook started for: <a href='cooker.cgi?log=$pkg'>$pkg</a>" | log 2.44 + echo "Cook started for: <a href='cooker.cgi?log=$pkg'>$pkg</a>" | log 2.45 cook $pkg || broken 2.46 done 2.47 ;; 2.48 @@ -251,6 +251,7 @@ 2.49 done && sed -i /^$/d $cooklist 2.50 2.51 echo "Packages to cook: $(cat $cooklist | wc -l)" 2.52 + echo "Packages to cook: $(cat $cooklist | wc -l)" | log 2.53 cook_order | tee $LOGS/cooker-order.log 2.54 2.55 # Clean DB files 2.56 @@ -269,7 +270,7 @@ 2.57 # Get revisions. 2.58 cd $wok || ( echo "" && exit 1 ) 2.59 cur=$(hg head --template '{rev}\n') 2.60 - echo "Updating Hg wok" | log 2.61 + echo "Updating Hg wok: ${wok}-hg" | log 2.62 echo "hg:pull" > $status 2.63 cd ${wok}-hg && hg pull -u 2.64 new=$(hg head --template '{rev}\n') 2.65 @@ -284,7 +285,7 @@ 2.66 cp -a ${wok}-hg/* $wok 2.67 cp -a ${wok}-hg/.hg $wok 2.68 else 2.69 - echo "No changes: $cur vs $new" | log 2.70 + echo "No revision changes: $cur vs $new" | log 2.71 separator && echo "" && exit 0 2.72 fi 2.73