Automatic generating of dashboard.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 9 Mar 2012 19:24:13 +0000 (20:24 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 9 Mar 2012 19:24:13 +0000 (20:24 +0100)
dashboard.pl
matrixgen-cron.sh

index 0b2f688..d92bc50 100755 (executable)
@@ -148,6 +148,7 @@ foreach my $s (keys %list) {
 
 
 # ==== glue reports ====
+if (0) {
 foreach my $c (sort keys %components) {
        my $cmd;
 
@@ -165,6 +166,7 @@ foreach my $c (sort keys %components) {
        `cat /tmp/report-$c-install.twiki.part /tmp/report-$c-upgrade.twiki.part > /tmp/report-$c.twiki 2>/dev/null`;
        `rm -f /tmp/report-$c-*.twiki.part`;
 }
+}
 
 
 # ==== matrix ====
index 908ce23..c6b05c0 100755 (executable)
@@ -3,18 +3,25 @@ for dir in `ls -1 | grep -v '\.'`; do
        if test $dir = 'RAW'; then continue; fi
        (cd $dir;
         ../matrixgen.pl > matrix.html.$$
-        egrep -v -- 'Modified: ' matrix.html.$$ > new.$$
-        egrep -v -- 'Modified: ' matrix.html > old.$$ 2>/dev/null
-        if ! cmp old.$$ new.$$ >/dev/null; then
-               mv matrix.html.$$ matrix.html
-               rm -f ./report-*.twiki
-               mv /tmp/report-*.twiki .
-               chown apache:users matrix.html report-*.twiki
-               /sbin/restorecon matrix.html report-*.twiki
-        fi
-        rm -f old.$$ new.$$ matrix.html.$$ /tmp/report-*.twiki
+        ../dashboard.pl > dashboard.html.$$
+        for page in matrix dashboard; do
+               egrep -v -- 'Modified: ' $page.html.$$ > new.$$
+               egrep -v -- 'Modified: ' $page.html > old.$$ 2>/dev/null
+               if ! cmp old.$$ new.$$ >/dev/null; then
+                       mv $page.html.$$ $page.html
+                       if test $page = 'matrix'; then
+                               rm -f ./report-*.twiki
+                               mv /tmp/report-*.twiki .
+                               chown apache:users $page.html report-*.twiki
+                               /sbin/restorecon report-*.twiki
+                       fi
+                       /sbin/restorecon $page.html
+               fi
+        done
+        rm -f old.$$ new.$$ matrix.html.$$ dashboard.$$ /tmp/report-*.twiki
         )
 done
 ./matrixgen.pl > matrix.html.$$;chown apache:users matrix.html.$$; mv matrix.html.$$ matrix.html
+./dashboard.pl > dashboard.html.$$;chown apache:users dashboard.html.$$; mv dashboard.html.$$ dashboard.html
 rm -f /tmp/report-*.twiki
 find ./RAW -mtime +7 -exec rm -f {} \;