die "$0: exactly one or two nonoption arguments are required\n"
if @ARGV != 1 && @ARGV != 2;
-my $builder = `hostname`;
-chomp $builder;
-
# Select build number.
if (!defined ($build_number)) {
$build_number = POSIX::strftime("%Y%m%d%H%M%S", localtime);
my $logfile = "$resultsdir/LOG";
open (LOG, '>', $logfile) or die "creating $logfile failed: $!\n";
-set_var ("builder", $builder);
+my $build_host = `hostname`;
+chomp $build_host;
+set_var ("build_host", $build_host);
set_var ("build_number", $build_number);
sub start_step {
}
sub saved_result {
- my ($product) = @_;
- start_step ("Saving $product");
+ my ($name, $product) = @_;
+ start_step ("Saving $name: $product");
}
sub save_result {
- my ($src, $rm_src) = @_;
+ my ($name, $src, $rm_src) = @_;
my ($basename) = $src;
$basename =~ s(^.*/)();
my ($dst) = "$resultsdir/$basename";
- saved_result ($basename);
+ saved_result ($name, $basename);
run ("cp -R $src $dst");
if (defined ($rm_src) && $rm_src) {
}
sub save_result_if_exists {
- my ($src, $rm_src) = @_;
+ my ($name, $src, $rm_src) = @_;
if (-e $src) {
save_result (@_);
} else {
start_step ("Make source tarball");
run ("cd $builddir/pspp$build_number/_build && make dist", "dist");
my $tarname = "pspp-$version.tar.gz";
- $tarball = save_result ("$builddir/pspp$build_number/_build/$tarname", 1);
+ $tarball = save_result ("source distribution", "$builddir/pspp$build_number/_build/$tarname", 1);
# Build user manual
start_step ("Build user manual");
run ("cd $builddir/pspp$build_number && cp _build/doc/*.texi doc/");
run ("cd $builddir/pspp$build_number && GENDOCS_TEMPLATE_DIR=$topdir $topdir/gendocs.sh -s doc/pspp.texinfo -o $abs_resultsdir/user-manual --email bug-gnu-pspp\@gnu.org pspp \"GNU PSPP User Manual\"", "user-manual");
- saved_result ("user-manual");
+ saved_result ("User Manual", "user-manual");
# Build developer's guide
start_step ("Build developers guide");
run ("cd $builddir/pspp$build_number && GENDOCS_TEMPLATE_DIR=$topdir $topdir/gendocs.sh -s doc/pspp-dev.texinfo -o $abs_resultsdir/dev-guide --email bug-gnu-pspp\@gnu.org pspp-dev \"GNU PSPP Developers Guide\"", "dev-guide");
- saved_result ("dev-guide");
+ saved_result ("Developers Guide", "dev-guide");
} else {
$tarball = $ARGV[0];
}
run ("chmod a-w $builddir/$tarball_dir");
my $ok = try_run ("cd $builddir/$tarball_dir/_build && ../configure --enable-relocatable --prefix=''", "bin-configure");
for my $basename ("config.h", "config.log") {
- save_result_if_exists ("$builddir/$tarball_dir/_build/$basename");
+ save_result_if_exists ("build configuration",
+ "$builddir/$tarball_dir/_build/$basename");
}
fail () if !$ok;
start_step ("Make binary distribution");
run ("cd $builddir/$tarball_dir/_build && tar cfz pspp-$binary_version.tar.gz pspp-$binary_version");
- save_result ("$builddir/$tarball_dir/_build/pspp-$binary_version.tar.gz", 1);
+ save_result ("binary distribution", "$builddir/$tarball_dir/_build/pspp-$binary_version.tar.gz", 1);
start_step ("Check");
$ok = try_run ("cd $builddir/$tarball_dir/_build && make check", "check");
for my $basename ("tests/testsuite.log", "tests/testsuite.dir") {
- save_result_if_exists ("$builddir/$tarball_dir/_build/$basename");
+ save_result_if_exists ("test logs", "$builddir/$tarball_dir/_build/$basename");
}
fail () if !$ok;
use HTML::Entities;
open (LOG, '<', "LOG");
-open (INDEX, '>','index.html');
open (LOG_HTML, '>', "log.html");
-print INDEX <<EOF;
-<html>
-<head>
- <link rel="stylesheet" href="build.css">
-</head>
-<body>
-EOF
-
print LOG_HTML <<EOF;
<html>
<head>
}
return %vars;
}
-
my (%vars) = read_vars ('VARS');
-print INDEX "<h2>Build Properties</h2>\n";
-print INDEX "<table>\n";
-print INDEX "<tr><th>Name</th><th>Value</th></tr>\n";
-foreach my $key (sort (keys (%vars))) {
- print INDEX "<tr>";
- print INDEX "<td>", encode_entities ($key), "</td>";
- print INDEX "<td>", encode_entities ($vars{$key}), "</td>";
- print INDEX "</tr>\n";
-}
-print INDEX "</table>\n";
my (@products);
my (@steps);
my ($new_page) = 0;
+my ($result) = "failure";
while (<LOG>) {
my $ln = $.;
chomp;
if ($new_page) {
$new_page = 0;
$log_class = "step";
- if (my ($product) = /^Saving (.*)$/) {
+ if (my ($name, $product) = /^Saving(?:([^:]*):)?\s+(.*)$/) {
my $href = "$product/index.html";
$href = $product if ! -e $href;
my (%p);
+ $p{NAME} = $name if defined ($name);
$p{PRODUCT} = $product;
$p{HREF} = $href;
$p{LN} = $ln;
$s{LN} = $ln;
push (@steps, \%s);
}
+ $result = 'success' if $_ eq 'Success';
} else {
- if (my ($diagnostic) = /(error|warning):/) {
+ if (my ($diagnostic) = /(error|warning):/i) {
my (%d);
- $d{DIAGNOSTIC} = $diagnostic;
+ $d{DIAGNOSTIC} = lc ($diagnostic);
$d{MESSAGE} = $_;
$d{LN} = $ln;
push (@{$steps[$#steps]{CHILDREN}}, \%d);
}
}
+open (INDEX, '>','index.html');
+
+print INDEX <<EOF;
+<html>
+<head>
+ <link rel="stylesheet" href="build.css">
+</head>
+<body>
+EOF
+
+print INDEX "<h1>Build ", $vars{"build_number"}, ": $result</h1>\n";
+
+print INDEX "<h2>Build Properties</h2>\n";
+print INDEX "<table>\n";
+print INDEX "<tr><th>Name</th><th>Value</th></tr>\n";
+foreach my $key (sort (keys (%vars))) {
+ print INDEX "<tr>";
+ print INDEX "<td>", encode_entities ($key), "</td>";
+ print INDEX "<td>", encode_entities ($vars{$key}), "</td>";
+ print INDEX "</tr>\n";
+}
+print INDEX "</table>\n";
+
print INDEX "<h2>Build Products</h2>\n";
print INDEX "<ul>\n";
foreach my $p (@products) {
- print INDEX "<li><a href=\"", encode_entities ($p->{HREF}), "\">";
+ print INDEX "<li>";
+ print INDEX encode_entities ($p->{NAME}), ": " if defined ($p->{NAME});
+ print INDEX "<a href=\"", encode_entities ($p->{HREF}), "\">";
print INDEX encode_entities ($p->{PRODUCT});
print INDEX "</a></li>\n";
}
} else {
print INDEX "<p>→ <a href=\"", encode_entities ($c->{HREF}), "\">";
print INDEX encode_entities ($c->{PRODUCT});
- print INDEX "</a></p>\n";
+ print INDEX "</a> ";
+ print INDEX log_link ($c->{LN});
+ print INDEX "</p>\n";
}
}
print INDEX "</li>\n";