WHERE flight=?
END
- if (defined $htmlout) {
- my ($title,$url);
- ensuredir "$htmlout/history";
- ensuredir "$htmlout/history/$j";
- if (defined $bra) {
- $title= "$j (branch $bra)";
- } else {
- $title= "$j (all branches)";
- }
- $html_file= "$htmlout/$html_file";
- open H, "> $html_file.new" or die "$html_file $!";
- $title= encode_entities($title);
- print H "<html><head><title>$title</title></head><body>\n";
- print H "<h1>$title</h1>\n";
- print H "<table rules=all>";
- print H "<tr><th>started</th><th>flight</th>",
- "<th>branch</th><th>failure</th>\n";
- print H "<th>", (join ", ", @hostvarcols), "</th>\n";
- print H "<th>osstest</th>";
- foreach my $c (@rev_grid_cols) {
- print H "<th>".encode_entities($c)."</th>\n";
- }
- print H "</tr>\n";
- my $alternate= 0;
- my @last_revs;
- my @alt_revs;
- my $alt_hosts;
- my $alt_osstest;
- foreach my $r (@test_rows) {
- my $altcolour= report_altcolour($alternate);
- print H "<tr $altcolour>";
- my $started = $r->{Flight}{started};
- print H "<td>";
- print H show_abs_time $started if $started;
- print H "</td>\n";
- my $flt= $r->{Flight}{flight};
- $url= "$c{ReportHtmlPubBaseUrl}/$flt";
- print H "<td><a href=\"$url\">$flt</a></td>\n";
- print H "<td>".encode_entities($r->{Flight}{branch})."</td>\n";
- $url= "$c{ReportHtmlPubBaseUrl}/$flt/".encode_entities($j).
- "/info.html";
- print H "<td $r->{ColourAttr}><a href=\"$url\">".
- $r->{Content}."</a></td>\n";
- my $lastrev;
- my $hosts = join ", ", map { $_ // "-" } @{ $r->{Hosts} };
- my $hosts_colour = report_altchangecolour(\$alt_hosts, $hosts);
- print H "<td $hosts_colour>".encode_entities($hosts)."</td>\n";
- $osstestverq->execute($r->{Flight}{flight});
- my $osstestrevs = join ' ',
- map {
- $_ = $_->{harness};
- s/^([0-9a-f]{12})[0-9a-f]+\b/$1/;
- "<kbd>".encode_entities($_)."</kbd>";
- }
- @{ $osstestverq->fetchall_arrayref({}) };
- my $osstest_colour = report_altchangecolour(\$alt_osstest, $osstestrevs);
- print H "<td $osstest_colour>$osstestrevs</td>\n";
- foreach my $i (0..$#rev_grid_cols) {
- my $v= $r->{Revisions}[$i];
- my $rev_colour = report_altchangecolour(\$alt_revs[$i], $v);
- print H "<td $rev_colour>";
- if (defined $v) {
- my $vp= $v;
- if (defined $lastrev && $v eq $lastrev) {
- $vp= '<-';
- } else {
- $vp =~ s/^((?:\d+\:)?[0-9a-f]{12})([0-9a-f].*)$/$1/;
- }
- print H "<kbd>".encode_entities($vp)."</kbd>";
- }
- $lastrev= $v;
- $last_revs[$i]= $v;
- print H "</td>";
- }
- print H "</tr>\n";
- $alternate ^= 1;
- }
- print H "</table></body></html>\n";
- H->error and die $!;
- close H or die $!;
- rename "$html_file.new", $html_file or die "$html_file $!";
- #print "wrote $html_file\n";
+ my ($title,$url);
+ ensuredir "$htmlout/history";
+ ensuredir "$htmlout/history/$j";
+ if (defined $bra) {
+ $title= "$j (branch $bra)";
+ } else {
+ $title= "$j (all branches)";
+ }
+ $html_file= "$htmlout/$html_file";
+ open H, "> $html_file.new" or die "$html_file $!";
+ $title= encode_entities($title);
+ print H "<html><head><title>$title</title></head><body>\n";
+ print H "<h1>$title</h1>\n";
+ print H "<table rules=all>";
+ print H "<tr><th>started</th><th>flight</th>",
+ "<th>branch</th><th>failure</th>\n";
+ print H "<th>", (join ", ", @hostvarcols), "</th>\n";
+ print H "<th>osstest</th>";
+ foreach my $c (@rev_grid_cols) {
+ print H "<th>".encode_entities($c)."</th>\n";
+ }
+ print H "</tr>\n";
+ my $alternate= 0;
+ my @last_revs;
+ my @alt_revs;
+ my $alt_hosts;
+ my $alt_osstest;
+ foreach my $r (@test_rows) {
+ my $altcolour= report_altcolour($alternate);
+ print H "<tr $altcolour>";
+ my $started = $r->{Flight}{started};
+ print H "<td>";
+ print H show_abs_time $started if $started;
+ print H "</td>\n";
+ my $flt= $r->{Flight}{flight};
+ $url= "$c{ReportHtmlPubBaseUrl}/$flt";
+ print H "<td><a href=\"$url\">$flt</a></td>\n";
+ print H "<td>".encode_entities($r->{Flight}{branch})."</td>\n";
+ $url= "$c{ReportHtmlPubBaseUrl}/$flt/".encode_entities($j).
+ "/info.html";
+ print H "<td $r->{ColourAttr}><a href=\"$url\">".
+ $r->{Content}."</a></td>\n";
+ my $lastrev;
+ my $hosts = join ", ", map { $_ // "-" } @{ $r->{Hosts} };
+ my $hosts_colour = report_altchangecolour(\$alt_hosts, $hosts);
+ print H "<td $hosts_colour>".encode_entities($hosts)."</td>\n";
+ $osstestverq->execute($r->{Flight}{flight});
+ my $osstestrevs = join ' ',
+ map {
+ $_ = $_->{harness};
+ s/^([0-9a-f]{12})[0-9a-f]+\b/$1/;
+ "<kbd>".encode_entities($_)."</kbd>";
+ }
+ @{ $osstestverq->fetchall_arrayref({}) };
+ my $osstest_colour = report_altchangecolour(\$alt_osstest, $osstestrevs);
+ print H "<td $osstest_colour>$osstestrevs</td>\n";
+ foreach my $i (0..$#rev_grid_cols) {
+ my $v= $r->{Revisions}[$i];
+ my $rev_colour = report_altchangecolour(\$alt_revs[$i], $v);
+ print H "<td $rev_colour>";
+ if (defined $v) {
+ my $vp= $v;
+ if (defined $lastrev && $v eq $lastrev) {
+ $vp= '<-';
+ } else {
+ $vp =~ s/^((?:\d+\:)?[0-9a-f]{12})([0-9a-f].*)$/$1/;
+ }
+ print H "<kbd>".encode_entities($vp)."</kbd>";
+ }
+ $lastrev= $v;
+ $last_revs[$i]= $v;
+ print H "</td>";
+ }
+ print H "</tr>\n";
+ $alternate ^= 1;
}
+ print H "</table></body></html>\n";
+ H->error and die $!;
+ close H or die $!;
+ rename "$html_file.new", $html_file or die "$html_file $!";
+ #print "wrote $html_file\n";
}
my @tasks;