These are the sources for the tinderbox summary page.
This commit is contained in:
parent
2983398f57
commit
8bde6a5ce1
148
tools/tools/tinderbox/www/index.cgi
Normal file
148
tools/tools/tinderbox/www/index.cgi
Normal file
@ -0,0 +1,148 @@
|
||||
#!/usr/bin/perl -Tw
|
||||
#-
|
||||
# Copyright (c) 2003 Dag-Erling Coïdan Smørgrav
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer
|
||||
# in this position and unchanged.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
use strict;
|
||||
use POSIX qw(strftime);
|
||||
|
||||
my @BRANCHES = (
|
||||
'RELENG_4',
|
||||
'CURRENT'
|
||||
);
|
||||
|
||||
my %ARCHES = (
|
||||
'alpha' => [ 'alpha' ],
|
||||
'amd64' => [ 'amd64' ],
|
||||
'i386' => [ 'i386', 'pc98' ],
|
||||
'ia64' => [ 'ia64' ],
|
||||
'powerpc' => [ 'powerpc' ],
|
||||
'sparc64' => [ 'sparc64' ],
|
||||
);
|
||||
|
||||
sub success($) {
|
||||
my $log = shift;
|
||||
|
||||
local *FILE;
|
||||
if (open(FILE, "<", $log)) {
|
||||
while (<FILE>) {
|
||||
if (m/tinderbox run completed/) {
|
||||
close(FILE);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
MAIN:{
|
||||
if ($ENV{'GATEWAY_INTERFACE'}) {
|
||||
$| = 1;
|
||||
print "Content-Type: text/html\n\n";
|
||||
} else {
|
||||
open(STDOUT, ">", "index.html")
|
||||
or die("index.html: $!\n");
|
||||
}
|
||||
print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
|
||||
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
|
||||
<head>
|
||||
<title>FreeBSD tinderbox logs</title>
|
||||
<meta name=\"robots\" content=\"nofollow\" />
|
||||
<meta http-equiv=\"refresh\" content=\"600\" />
|
||||
<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"tb.css\" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>FreeBSD tinderbox logs</h1>
|
||||
|
||||
<table border=\"1\" cellpadding=\"3\">
|
||||
<tr>
|
||||
<th>Architecture</th>
|
||||
<th>Machine</th>
|
||||
";
|
||||
foreach my $branch (@BRANCHES) {
|
||||
print(" <th>$branch</th>\n");
|
||||
}
|
||||
print " </tr>\n";
|
||||
|
||||
foreach my $arch (sort(keys(%ARCHES))) {
|
||||
foreach my $machine (sort(@{$ARCHES{$arch}})) {
|
||||
print " <tr>
|
||||
<td>$arch</td>
|
||||
<td>$machine</td>
|
||||
";
|
||||
foreach my $branch (@BRANCHES) {
|
||||
my $log = "tinderbox-$branch-$arch-$machine";
|
||||
my $links = "";
|
||||
if (-f "$log.brief") {
|
||||
my @stat = stat("$log.brief");
|
||||
my $class = success("$log.brief") ? "ok" : "fail";
|
||||
$links .= "<span class=\"$class\">" .
|
||||
strftime("%Y-%m-%d %H:%M", gmtime($stat[9])) .
|
||||
"</span><br />";
|
||||
my $size = sprintf("[%.1f kB]", $stat[7] / 1024);
|
||||
$links .= " <span class=\"tiny\">" .
|
||||
"<a href=\"$log.brief\">summary $size</a>" .
|
||||
"</span><br />";
|
||||
}
|
||||
if (-f "$log.full") {
|
||||
my @stat = stat("$log.full");
|
||||
my $size = sprintf("[%.1f MB]", $stat[7] / 1048576);
|
||||
$links .= " <span class=\"tiny\">" .
|
||||
"<a href=\"$log.full\">full log $size</a>" .
|
||||
"</span><br />";
|
||||
}
|
||||
if ($links eq "") {
|
||||
print(" <td>n/a</td>\n");
|
||||
} else {
|
||||
print(" <td>$links</td>\n");
|
||||
}
|
||||
}
|
||||
print " </tr>\n";
|
||||
}
|
||||
}
|
||||
my $date = strftime("%Y-%m-%d %H:%M GMT", gmtime());
|
||||
print " </table>
|
||||
<p class=\"update\">Last updated: $date</p>
|
||||
<p>
|
||||
<a href=\"http://validator.w3.org/check/referer\"><img
|
||||
src=\"valid-xhtml10.png\"
|
||||
alt=\"Valid XHTML 1.0!\" height=\"31\" width=\"88\" /></a>
|
||||
<a href=\"http://jigsaw.w3.org/css-validator/check/referer\"><img
|
||||
src=\"valid-css.gif\"
|
||||
alt=\"Valid CSS!\" height=\"31\" width=\"88\" /></a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
";
|
||||
exit(0);
|
||||
}
|
51
tools/tools/tinderbox/www/tb.css
Normal file
51
tools/tools/tinderbox/www/tb.css
Normal file
@ -0,0 +1,51 @@
|
||||
// $FreeBSD$
|
||||
|
||||
BODY, H1, H2, H3, H4, H5, H6, LI {
|
||||
font-family: Helvetica, sans-serif;
|
||||
font-style: normal;
|
||||
background-color: white;
|
||||
color: navy;
|
||||
}
|
||||
|
||||
A:link {
|
||||
background-color: white;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
A:visited {
|
||||
background-color: white;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
A:active {
|
||||
background-color: white;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.tiny {
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
.update {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.ok {
|
||||
background-color: white;
|
||||
color: green;
|
||||
}
|
||||
|
||||
.fail {
|
||||
background-color: white;
|
||||
color: red;
|
||||
}
|
||||
|
||||
TD, TH {
|
||||
width: 16ex;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
IMG {
|
||||
border: none;
|
||||
}
|
BIN
tools/tools/tinderbox/www/valid-css.gif
Normal file
BIN
tools/tools/tinderbox/www/valid-css.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
tools/tools/tinderbox/www/valid-xhtml10.png
Normal file
BIN
tools/tools/tinderbox/www/valid-xhtml10.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Loading…
Reference in New Issue
Block a user