embed summary extraction script
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 17 Dec 2007 10:04:33 +0000 (10:04 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 17 Dec 2007 10:04:33 +0000 (10:04 +0000)
summary.py [deleted file]
vbuild-nightly.sh

diff --git a/summary.py b/summary.py
deleted file mode 100755 (executable)
index d706807..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-# read a full log and tries to extract the interesting stuff
-
-import sys,re
-m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*")
-m_installing_any=re.compile('\r  (Installing:[^\]]*]) ')
-m_installing_err=re.compile('\r  (Installing:[^\]]*])(..+)')
-m_installing_end=re.compile('Installed:.*')
-m_installing_doc=re.compile(".*such file or directory for /usr/share/info.*")
-
-def scan_log (filename):
-
-    try:
-        if filename=="-":
-            filename="stdin"
-            f=sys.stdin
-        else:
-            f=open(filename)
-        echo=False
-        for line in f.xreadlines():
-            if m_show_line.match(line):
-                print line,
-            elif m_installing_err.match(line):
-                (installing,error)=m_installing_err.match(line).groups()
-                print installing
-                print error
-                echo=True
-            elif m_installing_end.match(line):
-                echo=False
-            elif m_installing_any.match(line):
-                if echo: 
-                    installing=m_installing_any.match(line).group(1)
-                    print installing
-                echo=False
-            else:
-                if echo: print line,
-        f.close()
-    except:
-        print 'Failed to analyze',filename
-
-if __name__ == "__main__":
-    for arg in sys.argv[1:]:
-        scan_log(arg)
index 1a04784..67fdf49 100755 (executable)
@@ -3,7 +3,6 @@ REVISION=$(echo '$Revision$' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' )
 
 COMMANDPATH=$0
 COMMAND=$(basename $0)
-DIRNAME=$(dirname $0)
 
 # default values, tunable with command-line options
 DEFAULT_FCDISTRO=f7
@@ -35,8 +34,49 @@ DATE=$(date +'%Y.%m.%d')
 function summary () {
     from=$1; shift
     echo "******************** BEG SUMMARY" 
-#   tr -d '\r' < $from | egrep 'BEG RPM|not installed|Installing:.*([eE]rror|[wW]arning)' 
-    $DIRNAME/summary.py < $from 
+    python - $from <<EOF
+# read a full log and tries to extract the interesting stuff
+
+import sys,re
+m_show_line=re.compile(".* BEG (RPM|VSERVER).*|.*'boot'.*|\* .*")
+m_installing_any=re.compile('\r  (Installing:[^\]]*]) ')
+m_installing_err=re.compile('\r  (Installing:[^\]]*])(..+)')
+m_installing_end=re.compile('Installed:.*')
+m_installing_doc=re.compile(".*such file or directory for /usr/share/info.*")
+
+def scan_log (filename):
+
+    try:
+        if filename=="-":
+            filename="stdin"
+            f=sys.stdin
+        else:
+            f=open(filename)
+        echo=False
+        for line in f.xreadlines():
+            if m_show_line.match(line):
+                print line,
+            elif m_installing_err.match(line):
+                (installing,error)=m_installing_err.match(line).groups()
+                print installing
+                print error
+                echo=True
+            elif m_installing_end.match(line):
+                echo=False
+            elif m_installing_any.match(line):
+                if echo: 
+                    installing=m_installing_any.match(line).group(1)
+                    print installing
+                echo=False
+            else:
+                if echo: print line,
+        f.close()
+    except:
+        print 'Failed to analyze',filename
+
+for arg in sys.argv[1:]:
+    scan_log(arg)
+EOF
     echo "******************** END SUMMARY" 
 }
 
@@ -196,12 +236,12 @@ function main () {
            t) PLDISTROTAGS=$OPTARG ;;
            r) TAGSRELEASE=$OPTARG ;;
            s) SVNPATH=$OPTARG ;;
-           o) USEOLD=true ;;
+           o) OVERWRITEMODE=true ;;
            m) MAILTO=$OPTARG ;;
            a) MAKEVARS=(${MAKEVARS[@]} "$OPTARG") ;;
            w) WEBPATH=$OPTARG ;;
            B) DO_TEST= ;;
-           T) DO_BUILD= ; USEOLD=true ;;
+           T) DO_BUILD= ; OVERWRITEMODE=true ;;
            v) set -x ;;
            7) BASE="$(date +%a|tr A-Z a-z)-@FCDISTRO@" ;;
            h|*) usage ;;
@@ -246,7 +286,7 @@ function main () {
         # (*) copy this command in the vserver
         # (*) invoke it
        
-       if [ -n "$USEOLD" ] ; then
+       if [ -n "$OVERWRITEMODE" ] ; then
             ### Re-use a vserver (finish an unfinished build..)
            if [ ! -d /vservers/${BASE} ] ; then
                echo $COMMAND : cannot find vserver $BASE