From: František Dvořák Date: Wed, 13 Nov 2013 09:50:48 +0000 (+0100) Subject: Use report.html instead f report.twiki, create a symlink if needed. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=d56469876a130b32e3c56178799205c7e5141df0;p=meta-dashboard.git Use report.html instead f report.twiki, create a symlink if needed. --- diff --git a/dashboard.pl b/dashboard.pl index a0e25be..80a0e9f 100755 --- a/dashboard.pl +++ b/dashboard.pl @@ -67,20 +67,20 @@ foreach my $s (keys %list) { #printf STDERR "$item->{component}, $item->{platform}\n"; undef $result; - if (-f "$item->{dir}/report.twiki") { + if (-f "$item->{dir}/report.html") { my ($section, $err, $yaim_used, $yaim_finished, $missing_deps); - `grep -- 'TESTS END HERE' $item->{dir}/report.twiki >/dev/null 2>&1`; + `grep -- 'TESTS END HERE' $item->{dir}/report.html >/dev/null 2>&1`; $section=$?; - `grep -- 'Installed YAIM versions' $item->{dir}/report.twiki >/dev/null 2>&1`; + `grep -- 'Installed YAIM versions' $item->{dir}/report.html >/dev/null 2>&1`; $yaim_used=$?; - `grep -- 'YAIM terminated succesfully' $item->{dir}/report.twiki >/dev/null 2>&1`; + `grep -- 'YAIM terminated succesfully' $item->{dir}/report.html >/dev/null 2>&1`; $yaim_finished=$?; - $missing_deps=`grep -- 'Missing Dependency:' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`; - `grep -- 'ERROR:' $item->{dir}/report.twiki >/dev/null 2>&1`; + $missing_deps=`grep -- 'Missing Dependency:' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`; + `grep -- 'ERROR:' $item->{dir}/report.html >/dev/null 2>&1`; $err=$?; printf STDERR " sec: $section, err: $err, missing_deps: $missing_deps\n"; if ($section == 0 && $missing_deps == 0 && ($yaim_used != 0 || $yaim_finished == 0)) { - $result=`grep -- '-TEST FAILED-' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`; + $result=`grep -- '-TEST FAILED-' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`; chomp $result; } else { if ($missing_deps != 0 ) { $result = "$missing_deps missing deps"; } @@ -111,28 +111,6 @@ print STDERR "$item->{dir}: $item->{result}, $item->{result2}\n"; } -# ==== glue reports ==== -if (0) { -foreach my $c (sort keys %components) { - my $cmd; - - for my $s ('install', 'upgrade') { - if (exists $list{$s}) { - for my $p (keys %{$list{$s}{$c}}) { - $item = $list{$s}{$c}{$p}; - if (exists $item->{result} and $item->{result} eq "0") { - $cmd = "cat $item->{dir}/report.twiki >> /tmp/report-$c-$s.twiki.part"; - `$cmd`; - } - } - } - } - `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 ==== my %fancy = ("lb", "L&B", "px", "PX", diff --git a/matrixgen.pl b/matrixgen.pl index ba983bd..779e858 100755 --- a/matrixgen.pl +++ b/matrixgen.pl @@ -116,27 +116,36 @@ foreach my $s (keys %list) { #printf STDERR "$item->{component}, $item->{platform}\n"; undef $result; undef $done; - if (-f "$item->{dir}/report.twiki" or -f "$item->{dir}/report.twiki.bz2") { + if (-f "$item->{dir}/report.twiki" or -f "$item->{dir}/report.twiki.bz2" or -f "$item->{dir}/report.html" or -f "$item->{dir}/report.html.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`; + `ln -sf report.twiki $item->{dir}/report.html`; } - `grep -- 'TESTS END HERE' $item->{dir}/report.twiki >/dev/null 2>&1`; + if (-f "$item->{dir}/report.html.bz2") { + # we have an older report to use - unpack and touch it + `bunzip2 $item->{dir}/report.html.bz2`; + `touch $item->{dir}/report.html`; + } + if (-f "$item->{dir}/report.twiki" && ! -f "$item->{dir}/report.html") { + `ln -sf report.twiki $item->{dir}/report.html`; + } + `grep -- 'TESTS END HERE' $item->{dir}/report.html >/dev/null 2>&1`; $section=$?; - `grep -- 'Installed YAIM versions' $item->{dir}/report.twiki >/dev/null 2>&1`; + `grep -- 'Installed YAIM versions' $item->{dir}/report.html >/dev/null 2>&1`; $yaim_used=$?; - `grep -- 'YAIM terminated succesfully' $item->{dir}/report.twiki >/dev/null 2>&1`; + `grep -- 'YAIM terminated succesfully' $item->{dir}/report.html >/dev/null 2>&1`; $yaim_finished=$?; - `grep -- 'ERROR:' $item->{dir}/report.twiki >/dev/null 2>&1`; + `grep -- 'ERROR:' $item->{dir}/report.html >/dev/null 2>&1`; $err=$?; #printf STDERR " sec: $section, err: $err\n"; if ($section == 0 && ($yaim_used != 0 || $yaim_finished == 0)) { - $result=`grep -- '-TEST FAILED-' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`; + $result=`grep -- '-TEST FAILED-' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`; chomp $result; - $done=`grep -- 'done' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`; - $skipped=`grep -- 'skipped' $item->{dir}/report.twiki 2>/dev/null| wc -l | sed 's/ *//g'`; + $done=`grep -- 'done' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`; + $skipped=`grep -- 'skipped' $item->{dir}/report.html 2>/dev/null| wc -l | sed 's/ *//g'`; chomp $done; chomp $skipped; } else { @@ -181,10 +190,6 @@ foreach my $c (sort keys %components) { for my $p (sort keys %{$list{$s}{$c}}) { $item = $list{$s}{$c}{$p}; if (exists $item->{result} and $item->{result} eq "0") { - if (-f "$item->{dir}/report.twiki") { - $cmd = "cat $item->{dir}/report.twiki >> /tmp/report-$c-$s.part"; - `$cmd`; - } if (-f "$item->{dir}/report.html") { $cmd = "cat $item->{dir}/report.html >> /tmp/report-$c-$s.part"; `$cmd`; @@ -193,7 +198,9 @@ foreach my $c (sort keys %components) { } } } - `cat /tmp/report-$c-install.part /tmp/report-$c-minor-upgrade.part /tmp/report-$c-major-upgrade.part /tmp/report-$c-double-upgrade.part /tmp/report-$c-update.part > /tmp/report-$c.html 2>/dev/null`; + `cat ../template.header.html | sed 's/\@TITLE\@/$c/' > /tmp/report-$c.html`; + `cat /tmp/report-$c-install.part /tmp/report-$c-minor-upgrade.part /tmp/report-$c-major-upgrade.part /tmp/report-$c-double-upgrade.part /tmp/report-$c-update.part >> /tmp/report-$c.html 2>/dev/null`; + `cat ../template.footer.html >> /tmp/report-$c.html`; `rm -f /tmp/report-$c-*.part`; } diff --git a/template.footer.html b/template.footer.html new file mode 100644 index 0000000..0180684 --- /dev/null +++ b/template.footer.html @@ -0,0 +1,4 @@ + + + + diff --git a/template.header.html b/template.header.html new file mode 100644 index 0000000..e41121e --- /dev/null +++ b/template.header.html @@ -0,0 +1,11 @@ + + + + + + @TITLE@ + + + +