X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=results2html;h=abc520d3db5033cad7701e7725f29a09c7113adf;hb=0a04c891c69cc5851b657208c958c68d1336b977;hp=0e39cb4ed7b1d43b81d10f9d1a2daadc144d644c;hpb=32512097fa8fd103d842f3fe1573d3dc3b209439;p=pspp diff --git a/results2html b/results2html index 0e39cb4ed7..abc520d3db 100755 --- a/results2html +++ b/results2html @@ -6,17 +6,8 @@ use warnings; use HTML::Entities; open (LOG, '<', "LOG"); -open (INDEX, '>','index.html'); open (LOG_HTML, '>', "log.html"); -print INDEX < - - - - -EOF - print LOG_HTML < @@ -39,25 +30,12 @@ sub read_vars { } return %vars; } - my (%vars) = read_vars ('VARS'); -print INDEX "

Build Properties

\n"; -print INDEX "\n"; -print INDEX "\n"; -foreach my $key (sort (keys (%vars))) { - print INDEX ""; - print INDEX ""; - print INDEX ""; - print INDEX "\n"; -} -print INDEX "
NameValue
", encode_entities ($key), "", encode_entities ($vars{$key}), "
\n"; -print INDEX "

Build Summary

\n"; -print INDEX "
    \n"; - -my ($n_products) = 0; -my ($n_steps) = 0; +my (@products); +my (@steps); my ($new_page) = 0; +my ($result) = "failure"; while () { my $ln = $.; chomp; @@ -72,30 +50,32 @@ while () { if ($new_page) { $new_page = 0; $log_class = "step"; - if (my ($product) = /^Saving (.*)$/) { - print INDEX "\n
      \n" if !$n_products++; + if (my ($name, $product) = /^Saving(?:([^:]*):)?\s+(.*)$/) { my $href = "$product/index.html"; $href = $product if ! -e $href; - print INDEX "
    • "; - print INDEX encode_entities ($product), ""; - print INDEX " (log)"; - print INDEX "
    • \n"; + + my (%p); + $p{NAME} = $name if defined ($name); + $p{PRODUCT} = $product; + $p{HREF} = $href; + $p{LN} = $ln; + push (@products, \%p); + push (@{$steps[$#steps]{CHILDREN}}, \%p); } else { - print INDEX "
    " if !$n_steps; - print INDEX "
  1. ", encode_entities ($_); - print INDEX " (log)"; - $n_products = 0; + my (%s); + $s{TITLE} = $_; + $s{LN} = $ln; + push (@steps, \%s); } + $result = 'success' if $_ eq 'Success'; } else { - if (my ($diagnostic) = /(error|warning):/) { - if ($n_products) { - print INDEX " \n"; - $n_products = 0; - } - print INDEX "

    "; - print INDEX ""; - print INDEX encode_entities ($_); - print INDEX "

    \n"; + if (my ($diagnostic) = /(error|warning):/i) { + my (%d); + $d{DIAGNOSTIC} = lc ($diagnostic); + $d{MESSAGE} = $_; + $d{LN} = $ln; + push (@{$steps[$#steps]{CHILDREN}}, \%d); + $log_class = "$diagnostic"; } } @@ -106,10 +86,70 @@ while () { print LOG_HTML encode_entities ($_), "\n"; } } -print INDEX " \n" if $n_products; -print INDEX "
  2. \n" if $n_steps; + +open (INDEX, '>','index.html'); + +print INDEX < + + + + +EOF + +print INDEX "

    Build ", $vars{"build_number"}, ": $result

    \n"; + +print INDEX "

    Build Properties

    \n"; +print INDEX "\n"; +print INDEX "\n"; +foreach my $key (sort (keys (%vars))) { + print INDEX ""; + print INDEX ""; + print INDEX ""; + print INDEX "\n"; +} +print INDEX "
    NameValue
    ", encode_entities ($key), "", encode_entities ($vars{$key}), "
    \n"; + +print INDEX "

    Build Products

    \n"; +print INDEX "\n"; + +sub log_link { + my ($ln) = @_; + return "(log)"; +} + +print INDEX "

    Build Summary

    \n"; +print INDEX "
      \n"; +foreach my $s (@steps) { + print INDEX "
    1. ", encode_entities ($s->{TITLE}); + print INDEX " ", log_link ($s->{LN}); + foreach my $c (@{$s->{CHILDREN}}) { + if (defined ($c->{DIAGNOSTIC})) { + print INDEX "

      {DIAGNOSTIC}\">"; + print INDEX "{LN}\">"; + print INDEX encode_entities ($c->{MESSAGE}); + print INDEX "

      \n"; + } else { + print INDEX "

      {HREF}), "\">"; + print INDEX encode_entities ($c->{PRODUCT}); + print INDEX " "; + print INDEX log_link ($c->{LN}); + print INDEX "

      \n"; + } + } + print INDEX "
    2. \n"; +} +print INDEX "
    \n"; + print INDEX < EOF @@ -125,7 +165,7 @@ print CSS <p { @@ -175,17 +215,17 @@ a:hover { text-decoration: underline } +ol>li>p { + margin-top: 0; + margin-bottom: 0 +} .step { font-weight: bold } .warning { - background: yellow; - margin-top: 0; - margin-bottom: 0 + background: yellow } .error { - background: orange; - margin-top: 0; - margin-bottom: 0 + background: orange } EOF