as released as part of build91
[pspp] / results2html
index 4e3224fca3ba9589f147706469845ed5692612e0..9c73d12e31ef3d380297c551c4da14b48129958a 100755 (executable)
@@ -38,7 +38,6 @@ my (%vars) = read_vars ('VARS');
 
 my (@products);
 my (@steps);
-my ($new_page) = 0;
 my ($result) = "failure";
 my (%dist_files);
 my ($dist_dir);
@@ -47,13 +46,6 @@ while (<LOG>) {
     my $ln = $.;
     chomp;
 
-    if (/^\f$/) {
-       $new_page = 1;
-       @dirstack = ();
-       print LOG_HTML "</pre><hr><pre>\n";
-       next;
-    }
-
     if (/Entering directory `(.*)'$/) {
         push (@dirstack, $1);
     } elsif (/Leaving directory `(.*)'$/) {
@@ -61,11 +53,10 @@ while (<LOG>) {
     }
 
     my $log_class;
-    if ($new_page) {
-       $new_page = 0;
+    if (my ($title) = /^## (.*) ##$/) {
        $log_class = "step";
-       if (my ($name, $product) = /^Saving(?:\s+([^:]*):)?\s+(.*)$/) {
-           my $href = "$product/index.html";
+       if (my ($name, $product) = $title =~ /^Saving(?:\s+([^:]*):)?\s+(.*)$/) {
+           my $href = "$product/summary.html";
            $href = $product if ! -e $href;
 
            my (%p);
@@ -88,17 +79,21 @@ while (<LOG>) {
                }
                close (DIST);
            }
-       } else {
+       } elsif ($title eq 'Success') {
+           $result = 'success';
+       } elsif ($title !~ /^-+$/) {
            my (%s);
-           $s{TITLE} = $_;
+           $s{TITLE} = $title;
            $s{LN} = $ln;
            push (@steps, \%s);
        }
-       $result = 'success' if $_ eq 'Success';
     } else {
-       if (my ($diagnostic) = /(error|warning):/i) {
+       my $diagnostic;
+       $diagnostic = "error" if /error:/i || /FAILED/;
+       $diagnostic = "warning" if /warning:/i;
+       if ($diagnostic) {
            my (%d);
-           $d{DIAGNOSTIC} = lc ($diagnostic);
+           $d{DIAGNOSTIC} = $diagnostic;
            $d{MESSAGE} = $_;
            $d{LN} = $ln;
 
@@ -128,8 +123,6 @@ while (<LOG>) {
                }
            }
            push (@{$steps[$#steps]{CHILDREN}}, \%d);
-
-           $log_class = "$diagnostic";
        }
     }
     printf LOG_HTML "<a name=\"%d\"><tt>%4d</tt></a>  ", $ln, $ln;
@@ -140,7 +133,7 @@ while (<LOG>) {
     }
 }
 
-open (INDEX, '>','index.html');
+open (INDEX, '>','summary.html');
 
 print INDEX <<EOF;
 <html>
@@ -150,7 +143,7 @@ print INDEX <<EOF;
 <body>
 EOF
 
-print INDEX "<h1>Build ", $vars{"build_number"}, ": $result</h1>\n";
+print INDEX "<h1>Build ", $vars{"BUILD_NUMBER"}, ": $result</h1>\n";
 
 print INDEX "<h2>Build Properties</h2>\n";
 print INDEX "<table>\n";
@@ -227,6 +220,11 @@ print LOG_HTML <<EOF;
 </html>
 EOF
 
+open (HTACCESS, '>', '.htaccess');
+print HTACCESS <<EOF;
+DirectorySlash off
+EOF
+
 open (CSS, '>', "build.css");
 print CSS <<EOF;
 body {