Compress old reports (and uncompress as needed), add double major upgrades.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 8 Nov 2012 14:24:07 +0000 (15:24 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 8 Nov 2012 14:24:07 +0000 (15:24 +0100)
matrixgen-cron.sh
matrixgen.pl

index 6571122..9e06fd4 100755 (executable)
@@ -25,3 +25,6 @@ done
 ./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 {} \;
+find ./RAW -type f \! -name \*.bz2 -exec bzip2 --best {} \;
+find . -mtime +30 -name report.twiki -exec bzip2 --best {} \;
+find . -mtime +30 -name syslog -exec bzip2 --best {} \;
index 0b6bf10..2504ca0 100755 (executable)
@@ -51,12 +51,13 @@ sub table($) {
 }
 
 
-$list=`ls -1 | egrep '^(gridsite|lb|px|canl)'`;
+$list=`ls -1 | egrep '^(gridsite|lb|px|canl)' | sort`;
 @list=split /\n/, $list;
 
 #$list{install} = ();
-#$list{upgrade} = ();
 #$list{'minor-upgrade'} = ();
+#$list{'major-upgrade'} = ();
+#$list{'double-upgrade'} = ();
 foreach my $i (0..$#list) {
        my ($plat, $scen, $date);
 
@@ -78,7 +79,8 @@ foreach my $i (0..$#list) {
                close FH;
                chomp;
                if (/perf/i) { $scen = $_; }
-               elsif (/^upgrade/i or /major upgrade/i) { $scen = 'upgrade'; }
+               elsif (/^double.*upgrade/i) { $scen = 'double-upgrade'; }
+               elsif (/^upgrade/i or /major upgrade/i) { $scen = 'major-upgrade'; }
                elsif (/^minor upgrade/i) { $scen = 'minor-upgrade'; }
                elsif (/build/i) { $scen = 'build'; }
        }
@@ -113,8 +115,13 @@ foreach my $s (keys %list) {
 #printf STDERR "$item->{component}, $item->{platform}\n";
                        undef $result;
                        undef $done;
-                       if (-f "$item->{dir}/report.twiki") {
+                       if (-f "$item->{dir}/report.twiki" or -f "$item->{dir}/report.twiki.bz2") {
                                my ($section, $err, $yaim_used, $yaim_finished);
+                               if (-f "$item->{dir}/report.twiki.bz2") {
+                               # we have an older report to use - unpack and touch it
+                                       `bunzip2 $item->{dir}/report.twiki.bz2`;
+                                       `touch $item->{dir}/report.twiki`;
+                               }
                                `grep -- 'TESTS END HERE' $item->{dir}/report.twiki >/dev/null 2>&1`;
                                $section=$?;
                                `grep -- 'Installed YAIM versions' $item->{dir}/report.twiki >/dev/null 2>&1`;
@@ -168,7 +175,7 @@ foreach my $s (keys %list) {
 foreach my $c (sort keys %components) {
        my $cmd;
 
-       for my $s ('install', 'upgrade', 'minor-upgrade') {
+       for my $s ('install', 'minor-upgrade', 'major-upgrade', 'double-upgrade') {
                if (exists $list{$s}) {
                        for my $p (keys %{$list{$s}{$c}}) {
                                $item = $list{$s}{$c}{$p};
@@ -243,21 +250,30 @@ if (exists $list{install}) {
        }
 }
 
-if (exists $list{upgrade}) {
-       print "<a name=\"upgrade\"/><h1>Upgrade from EMI-1 (major)</h1>\n";
-       table($list{upgrade});
+if (exists $list{'minor-upgrade'}) {
+       print "<a name=\"minor-upgrade\"/><h1>Minor upgrade from production</h1>\n";
+       table($list{'minor-upgrade'});
+       print "\n";
+       if (-f 'minor-upgrade.html.in') {
+               system 'cat minor-upgrade.html.in';
+       }
+}
+
+if (exists $list{'major-upgrade'}) {
+       print "<a name=\"upgrade\"/><h1>Major upgrade from production</h1>\n";
+       table($list{'major-upgrade'});
        print "\n";
        if (-f 'upgrade.html.in') {
                system 'cat upgrade.html.in';
        }
 }
 
-if (exists $list{'minor-upgrade'}) {
-       print "<a name=\"minor-upgrade\"/><h1>Upgrade from EMI-2 (minor)</h1>\n";
-       table($list{'minor-upgrade'});
+if (exists $list{'double-upgrade'}) {
+       print "<a name=\"upgrade\"/><h1>Double major upgrade from production</h1>\n";
+       table($list{'double-upgrade'});
        print "\n";
-       if (-f 'minor-upgrade.html.in') {
-               system 'cat minor-upgrade.html.in';
+       if (-f 'upgrade-double.html.in') {
+               system 'cat upgrade-double.html.in';
        }
 }