From 18ae90dba18e6abf64b89a8cd0e367ec2b558f3b Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Sat, 23 Sep 2006 15:31:09 +0000 Subject: [PATCH] fixed script to make csc happy --- matita/scripts/crontab.sh | 45 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/matita/scripts/crontab.sh b/matita/scripts/crontab.sh index a521c15b9..b3528cee6 100644 --- a/matita/scripts/crontab.sh +++ b/matita/scripts/crontab.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -x #configuration TODAY=`date +%Y%m%d` @@ -10,13 +11,10 @@ SHELLTIME2CENTSPHP=scripts/shell_time2cents.php SHELLADDERPHP=scripts/shell_adder.php COMMONPHP=scripts/public_html/common.php MYSQL="mysql -u helm -h mowgli.cs.unibo.it matita" -SQLQMARK="select distinct mark from bench where mark like '" -SQLQORD="' order by mark;" -SQLQTIME="select SUM(timeuser) from bench where mark = \"" -SQLQGRMARK="\" group by mark;" -SQLQFAIL="select count(distinct test) from bench where mark = \"" -SQLQFAIL1="select distinct test from bench where mark = \"" -SQLQFAIL2="\" and result = 'fail';" +SQLQMARK="select distinct mark from bench where mark like '%s%%' order by mark;" +SQLQTIME="select SUM(timeuser) from bench where mark = '%s' group by mark;" +SQLQFAILCOUNT="select count(distinct test) from bench where mark = '%s' and result = 'fail';" +SQLQFAIL="select distinct test from bench where mark = '%s' and result = 'fail';" URL="http://mowgli.cs.unibo.it/~tassi/bench.php" #initialization @@ -30,8 +28,8 @@ svn co ${SVNROOT}helm/software/matita/scripts/ > LOG.svn 2>&1 #run tests scripts/profile_svn.sh 2> LOG -MARK=`echo $SQLQMARK$TODAY%$SQLQORD | $MYSQL | tail -n 1` -LASTMARK=`echo $SQLQMARK$YESTERDAY%$SQLQORD | $MYSQL | tail -n 1` +MARK=`printf "$SQLQMARK" "$TODAY" | $MYSQL | tail -n 1` +LASTMARK=`printf "$SQLQMARK" "$YESTERDAY" | $MYSQL | tail -n 1` if [ -z "$MARK" ]; then echo "No benchmark records for $TODAY" @@ -44,19 +42,19 @@ if [ -z "$LASTMARK" ]; then fi #check for slowdown -CUR_TIME=`echo $SQLQTIME$MARK$SQLQGRMARK | $MYSQL` -OLD_TIME=`echo $SQLQTIME$LASTMARK$SQLQGRMARK | $MYSQL` +CUR_TIME=`printf "$SQLQTIME" "$MARK" | $MYSQL | tail -n 1` +OLD_TIME=`printf "$SQLQTIME" "$LASTMARK" | $MYSQL | tail -n 1` if [ -z "$CUR_TIME" -o -z "$OLD_TIME" ]; then cat <