9 open (LOG, '<', "LOG");
10 open (LOG_HTML, '>', "log.html");
15 <link rel="stylesheet" href="build.css">
19 print LOG_HTML "<pre>";
24 if (open (VARS, "<", $file)) {
27 my ($key, $value) = /^([^=]+)=(.*)/ or next;
34 my (%vars) = read_vars ('VARS');
39 my ($result) = "failure";
48 print LOG_HTML "</pre><hr><pre>\n";
52 if (/Entering directory `(.*)'$/) {
54 } elsif (/Leaving directory `(.*)'$/) {
62 if (my ($name, $product) = /^Saving(?:([^:]*):)?\s+(.*)$/) {
63 my $href = "$product/index.html";
64 $href = $product if ! -e $href;
67 $p{NAME} = $name if defined ($name);
68 $p{PRODUCT} = $product;
71 push (@products, \%p);
72 push (@{$steps[$#steps]{CHILDREN}}, \%p);
79 $result = 'success' if $_ eq 'Success';
81 if (my ($diagnostic) = /(error|warning):/i) {
83 $d{DIAGNOSTIC} = lc ($diagnostic);
87 if (@dirstack && (my ($file, $line) = /^([^\s:]+):(\d+):\s/)) {
88 $file = File::Spec->rel2abs ($file, $dirstack[$#dirstack]);
89 my (@path) = grep ($_ ne '' && $_ ne '.', split ('/', $file));
90 for (my $i = 0; $i < $#path; ) {
91 if ($path[$i + 1] eq '..') {
92 splice (@path, $i, 2);
99 $d{FILE} = join ('/', @path);
101 push (@{$steps[$#steps]{CHILDREN}}, \%d);
103 $log_class = "$diagnostic";
106 printf LOG_HTML "<a name=\"%d\"><tt>%4d</tt></a> ", $ln, $ln;
107 if (defined ($log_class)) {
108 print LOG_HTML "<span class=\"$log_class\">", encode_entities ($_), "</span>\n";
110 print LOG_HTML encode_entities ($_), "\n";
114 open (INDEX, '>','index.html');
119 <link rel="stylesheet" href="build.css">
124 print INDEX "<h1>Build ", $vars{"build_number"}, ": $result</h1>\n";
126 print INDEX "<h2>Build Properties</h2>\n";
127 print INDEX "<table>\n";
128 print INDEX "<tr><th>Name</th><th>Value</th></tr>\n";
129 foreach my $key (sort (keys (%vars))) {
131 print INDEX "<td>", encode_entities ($key), "</td>";
132 print INDEX "<td>", encode_entities ($vars{$key}), "</td>";
133 print INDEX "</tr>\n";
135 print INDEX "</table>\n";
137 print INDEX "<h2>Build Products</h2>\n";
138 print INDEX "<ul>\n";
139 foreach my $p (@products) {
141 print INDEX encode_entities ($p->{NAME}), ": " if defined ($p->{NAME});
142 print INDEX "<a href=\"", encode_entities ($p->{HREF}), "\">";
143 print INDEX encode_entities ($p->{PRODUCT});
144 print INDEX "</a></li>\n";
146 print INDEX "</ul>\n";
150 return "<small><a href=\"log.html#$ln\">(log)</a></small>";
153 print INDEX "<h2>Build Summary</h2>\n";
154 print INDEX "<ol>\n";
155 foreach my $s (@steps) {
156 print INDEX "<li>", encode_entities ($s->{TITLE});
157 print INDEX " ", log_link ($s->{LN});
158 foreach my $c (@{$s->{CHILDREN}}) {
159 if (defined ($c->{DIAGNOSTIC})) {
160 print INDEX "<p class=\"$c->{DIAGNOSTIC}\">";
161 print INDEX "<a href=\"log.html#$c->{LN}\">";
162 print INDEX encode_entities ($c->{MESSAGE});
164 if (exists $c->{FILE}) {
165 print INDEX " in $c->{FILE}";
167 print INDEX "</p>\n";
169 print INDEX "<p>→ <a href=\"", encode_entities ($c->{HREF}), "\">";
170 print INDEX encode_entities ($c->{PRODUCT});
172 print INDEX log_link ($c->{LN});
173 print INDEX "</p>\n";
176 print INDEX "</li>\n";
178 print INDEX "</ol>\n";
185 print LOG_HTML <<EOF;
191 open (CSS, '>', "build.css");
196 padding: 0em 3em 0em 3em;
200 margin: 0pt 0pt 0pt 0em
222 H1, H2, H3, H4, H5, H6 {
223 font-family: sans-serif;
232 text-decoration: none;
236 text-decoration: none;
240 text-decoration: none;
243 text-decoration: underline