From kde-commits Sat Apr 30 23:27:28 2016 From: Allen Winter Date: Sat, 30 Apr 2016 23:27:28 +0000 To: kde-commits Subject: [websites/quality-kde-org] tools: tools/parsedoxlog.sh - attempt to bypass SVN in favor of git Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=146205885823135 Git commit 5ca91fcb020911e458b83dd262b33da3c9bb0886 by Allen Winter. Committed on 30/04/2016 at 23:27. Pushed by winterz into branch 'master'. tools/parsedoxlog.sh - attempt to bypass SVN in favor of git M +55 -47 tools/parsedoxlog.sh http://commits.kde.org/websites/quality-kde-org/5ca91fcb020911e458b83dd262b= 33da3c9bb0886 diff --git a/tools/parsedoxlog.sh b/tools/parsedoxlog.sh index 416c9a2..4433c18 100755 --- a/tools/parsedoxlog.sh +++ b/tools/parsedoxlog.sh @@ -32,6 +32,13 @@ DOXDATAPATH=3D$LIBSPATH/kdelibs/doc/common PSQL=3D"psql" #replace with echo when/if the database is in a bad way PSQL_FLAGS=3D"-t -h localhost -U kde ebn" = +GITREV() { + savepath=3D`pwd` + cd $1 + REV=3D`git rev-parse --short HEAD 2>/dev/null` + cd $savepath +} + # Determine the modules we need to build the documentation of... case "$VERSION" in kde-3.5|kde-4.* ) @@ -79,7 +86,7 @@ if [ "$PSQL" !=3D "echo" ]; then if test -z "$1" ; then timestamp=3D`date "+%B %d %Y %T"` # Bump generation now - generation=3D`echo "SELECT * FROM nextval('generation') ;" | $PSQL $PS= QL_FLAGS | sed 's+^\s*++'` ; = + generation=3D`echo "SELECT * FROM nextval('generation') ;" | $PSQL $PS= QL_FLAGS | sed 's+^\s*++'` ; else generation=3D`echo "SELECT generation FROM tools WHERE id =3D $flavor"= | $PSQL $PSQL_FLAGS | sed 's+^\s*++'` ; generation=3D`expr 1 + "$generation"` @@ -107,57 +114,58 @@ case "$VERSION" in ;; esac = -REV=3D`svn info svn://anonsvn.kde.org/home/kde/ | grep Revision | awk '{pr= int \$2}'` - -for i in $MODULES; do = - LOGFILE=3D$LOGPATH/$i.log - test -d "$SRCPATH/$i" || { echo "Skipping $SRCPATH/$i" ; continue ; } - - # Just count the total number of errors - AMT=3D`grep ^$SRCPATH $LOGFILE | wc -l` - expr 0 + "$AMT" > /dev/null 2>&1 || AMT=3D"0" - $VERBOSE && { echo "* Number of errors: $AMT" ; \ - echo "* Number of applications: " `grep 'Creating apidox' "$i.log" | wc = -l` ; } - - # An impenetrable forest of awkisms. Scan the logfile, - # breaking it into sections using the *** Creating - # header; count total errors under a top-level application - # heading (eg. dcop or kio) and print the results as - # lines with = - # appname count - # - # ... then pipe that to a while loop that reads the results - # and adds records to the results table for each appname. - : > /tmp/doxygen.sh.$$ - awk 'BEGIN {t=3D-1;app=3D""; ot=3D"'$i'"; } = - /\*\*\* Creating apidox/ { = - napp=3D$5; slash=3Dindex(napp,"/"); = - if (slash>0) napp=3Dsubstr($5,1,slash-1); = - if (napp!=3Dapp) { = - if (t>=3D0) print app,t; = - close( ot "-" app ".log" ); - app=3Dnapp; = - t=3D0; = - print $0 > ( ot "-" app ".log" ) ; - } = - } = - /^\/.*[Ww]arning/ { if (t>=3D0) t=3Dt+1; } - t>=3D0 { print $0 >> ( ot "-" app ".log" ); } = - END { if (t>=3D0) print app,t;}' $LOGFILE | \ - while true ; do +for i in $MODULES; do + LOGFILE=3D$LOGPATH/$i.log + test -d "$SRCPATH/$i" || { echo "Skipping $SRCPATH/$i" ; continue = ; } + + # Just count the total number of errors + AMT=3D`grep ^$SRCPATH $LOGFILE | wc -l` + expr 0 + "$AMT" > /dev/null 2>&1 || AMT=3D"0" + $VERBOSE && { echo "* Number of errors: $AMT" ; \ + echo "* Number of applications: " `grep 'Creating apidox' = "$i.log" | wc -l` ; } + + # An impenetrable forest of awkisms. Scan the logfile, + # breaking it into sections using the *** Creating + # header; count total errors under a top-level application + # heading (eg. dcop or kio) and print the results as + # lines with + # appname count + # + # ... then pipe that to a while loop that reads the results + # and adds records to the results table for each appname. + : > /tmp/doxygen.sh.$$ + awk 'BEGIN {t=3D-1;app=3D""; ot=3D"'$i'"; } + /\*\*\* Creating apidox/ { + napp=3D$5; slash=3Dindex(napp,"/"); + if (slash>0) napp=3Dsubstr($5,1,slash-1); + if (napp!=3Dapp) { + if (t>=3D0) print app,t; + close( ot "-" app ".log" ); + app=3Dnapp; + t=3D0; + print $0 > ( ot "-" app ".log" ) ; + } + } + /^\/.*[Ww]arning/ { if (t>=3D0) t=3Dt+1; } + t>=3D0 { print $0 >> ( ot "-" app ".log" ); } + END { if (t>=3D0) print app,t;}' $LOGFILE | \ + while true ; do read APP COUNT ; - test -z "$APP" && break ; - echo "$APP $COUNT" >> /tmp/doxygen.sh.$$ - $BINPATH/doxylog2html.pl --explain --export=3Debn --cms=3D"$VERSION/$i/$= APP" --rev=3D$REV $TEMPPATH/$i-$APP.log | sed s+/tempdocs/+/apidocs/+g > $O= UTPATH/$i-$APP.html; - mv -f $TEMPPATH/$i-$APP.log $OUTPATH; - echo "INSERT INTO results_apidox VALUES ( $generation, '$i', '$APP', $CO= UNT, $component, '', 'apidox-$VERSION/$i-$APP.html' ); "; - done | \ - $PSQL $PSQL_FLAGS > /dev/null + test -z "$APP" && break ; + echo "$APP $COUNT" >> /tmp/doxygen.sh.$$ + GETREV $SRCPATH/$i/$APP + echo "Path=3D$SRCPATH/$i/$APP: REV=3D$REV" + $BINPATH/doxylog2html.pl --explain --export=3Debn --cms=3D= "$VERSION/$i/$APP" --rev=3D$REV $TEMPPATH/$i-$APP.log | sed s+/tempdocs/+/a= pidocs/+g > $OUTPATH/$i-$APP.html; + mv -f $TEMPPATH/$i-$APP.log $OUTPATH; + echo "INSERT INTO results_apidox VALUES ( $generation, '$i= ', '$APP', $COUNT, $component, '', 'apidox-$VERSION/$i-$APP.html' ); "; + done | \ + $PSQL $PSQL_FLAGS > /dev/null done = if [ "$PSQL" !=3D "echo" ]; then if test -z "$1" ; then - ( = + ( + REV=3D0 #lacking anything better at the moment echo "INSERT INTO generations VALUES ( $generation, '$timestamp', (SEL= ECT SUM(issues) FROM results_apidox WHERE generation =3D $generation), $fla= vor, $REV ) ;" echo "UPDATE tools SET generation =3D $generation WHERE id =3D $flavor= ;" ) | $PSQL $PSQL_FLAGS | sed 's+^\s*++' > /dev/null