[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [websites/quality-kde-org] tools: tools/parsedoxlog.sh - attempt to bypass SVN in favor of git
From:       Allen Winter <winter () kde ! org>
Date:       2016-04-30 23:27:28
Message-ID: E1aweIK-0001vB-GL () scm ! kde ! org
[Download RAW message or body]

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/5ca91fcb020911e458b83dd262b33da3c9bb0886


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=$LIBSPATH/kdelibs/doc/common
 PSQL="psql" #replace with echo when/if the database is in a bad way
 PSQL_FLAGS="-t -h localhost -U kde ebn"
 
+GITREV() {
+  savepath=`pwd`
+  cd $1
+  REV=`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" != "echo" ]; then
   if test -z "$1" ; then
     timestamp=`date "+%B %d %Y %T"`
     # Bump generation now
-    generation=`echo "SELECT * FROM nextval('generation') ;" | $PSQL $PSQL_FLAGS | \
sed 's+^\s*++'` ;  +    generation=`echo "SELECT * FROM nextval('generation') ;" | \
$PSQL $PSQL_FLAGS | sed 's+^\s*++'` ;  else
     generation=`echo "SELECT generation FROM tools WHERE id = $flavor" | $PSQL \
$PSQL_FLAGS | sed 's+^\s*++'` ;  generation=`expr 1 + "$generation"`
@@ -107,57 +114,58 @@ case "$VERSION" in
     ;;
 esac
 
-REV=`svn info svn://anonsvn.kde.org/home/kde/ | grep Revision | awk '{print \$2}'`
-
-for i in $MODULES; do 
-	LOGFILE=$LOGPATH/$i.log
-	test -d "$SRCPATH/$i" || { echo "Skipping $SRCPATH/$i" ; continue ; }
-
-	# Just count the total number of errors
-	AMT=`grep ^$SRCPATH $LOGFILE | wc -l`
-	expr 0 + "$AMT" > /dev/null 2>&1 || AMT="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=-1;app=""; ot="'$i'"; } 
-	     /\*\*\* Creating apidox/ { 
-		napp=$5; slash=index(napp,"/"); 
-		if (slash>0) napp=substr($5,1,slash-1); 
-		if (napp!=app) { 
-			if (t>=0) print app,t; 
-			close( ot "-" app ".log" );
-			app=napp; 
-			t=0; 
-			print $0 > ( ot "-" app ".log" ) ;
-		} 
-	     } 
-	     /^\/.*[Ww]arning/ { if (t>=0) t=t+1; }
-	     t>=0 { print $0 >> ( ot "-" app ".log" ); } 
-	     END { if (t>=0) print app,t;}' $LOGFILE | \
-	while true ; do
+for i in $MODULES; do
+        LOGFILE=$LOGPATH/$i.log
+        test -d "$SRCPATH/$i" || { echo "Skipping $SRCPATH/$i" ; continue ; }
+
+        # Just count the total number of errors
+        AMT=`grep ^$SRCPATH $LOGFILE | wc -l`
+        expr 0 + "$AMT" > /dev/null 2>&1 || AMT="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=-1;app=""; ot="'$i'"; }
+             /\*\*\* Creating apidox/ {
+                napp=$5; slash=index(napp,"/");
+                if (slash>0) napp=substr($5,1,slash-1);
+                if (napp!=app) {
+                        if (t>=0) print app,t;
+                        close( ot "-" app ".log" );
+                        app=napp;
+                        t=0;
+                        print $0 > ( ot "-" app ".log" ) ;
+                }
+             }
+             /^\/.*[Ww]arning/ { if (t>=0) t=t+1; }
+             t>=0 { print $0 >> ( ot "-" app ".log" ); }
+             END { if (t>=0) 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=ebn --cms="$VERSION/$i/$APP" \
--rev=$REV $TEMPPATH/$i-$APP.log | sed s+/tempdocs/+/apidocs/+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
+                test -z "$APP" && break ;
+                echo "$APP $COUNT" >> /tmp/doxygen.sh.$$
+                GETREV $SRCPATH/$i/$APP
+                echo "Path=$SRCPATH/$i/$APP: REV=$REV"
+                $BINPATH/doxylog2html.pl --explain --export=ebn \
--cms="$VERSION/$i/$APP" --rev=$REV $TEMPPATH/$i-$APP.log | sed \
s+/tempdocs/+/apidocs/+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" != "echo" ]; then
   if test -z "$1" ; then
-  ( 
+  (
+    REV=0 #lacking anything better at the moment
     echo "INSERT INTO generations VALUES ( $generation, '$timestamp', (SELECT \
SUM(issues) FROM results_apidox WHERE generation = $generation), $flavor, $REV ) ;"  \
echo "UPDATE tools SET generation = $generation WHERE id = $flavor ;"  ) | $PSQL \
$PSQL_FLAGS | sed 's+^\s*++' > /dev/null


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic