9 use vars qw($dbhost $dbname $dbuser $dbpass $dbport @log_file_names);
12 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
13 #require "BuildFarmWeb.pl";
15 die "no dbname" unless $dbname;
16 die "no dbuser" unless $dbuser;
18 my $dsn="dbi:Pg:dbname=$dbname";
19 $dsn .= ";host=$dbhost" if $dbhost;
20 $dsn .= ";port=$dbport" if $dbport;
24 my $system = $query->param('nm'); $system =~ s/[^a-zA-Z0-9_ -]//g;
25 my $logdate = $query->param('dt'); $logdate =~ s/[^a-zA-Z0-9_ -]//g;
29 my ($stage,$changed_this_run,$changed_since_success,$sysinfo,$branch);
31 use vars qw($info_row);
33 if ($system && $logdate)
36 my $db = DBI->connect($dsn,$dbuser,$dbpass);
38 die $DBI::errstr unless $db;
40 my $statement = <<EOS;
42 select log,conf_sum,stage, changed_this_run, changed_since_success,branch,
45 where sysname = ? and snapshot = ?
49 my $sth=$db->prepare($statement);
50 $sth->execute($system,$logdate);
51 my $row=$sth->fetchrow_arrayref;
53 $conf=$row->[1] || "not recorded" ;
54 $stage=$row->[2] || "unknown";
55 $changed_this_run = $row->[3];
56 $changed_since_success = $row->[4];
58 my $log_file_names = $row->[6];
59 $log_file_names =~ s/^\{(.*)\}$/$1/;
60 @log_file_names=split(',',$log_file_names)
66 select operating_system, os_version,
67 compiler, compiler_version,
69 replace(owner_email,'\@',' [ a t ] ') as owner_email,
70 sys_notes_ts::date AS sys_notes_date, sys_notes
72 where status = 'approved'
77 $sth=$db->prepare($statement);
78 $sth->execute($system);
79 $info_row=$sth->fetchrow_hashref;
80 # $sysinfo = join(" ",@$row);
85 foreach my $chgd ($changed_this_run,$changed_since_success)
87 my @lines = split(/!/,$chgd);
90 next unless m!^pgsql/!;
91 s!(^\S+)(\s+)(\S+)!<a href="http://anoncvs.postgresql.org/cvsweb.cgi/$1?rev=$3">$1$2$3</a>!;
93 $chgd = join("\n",@lines);
94 $chgd ||= 'not recorded';
98 $conf =~ s/\@/ [ a t ] /g;
99 map {s/&/&/g; s/</</g; s/>/>/g; s/\"/"/g;} ($log,$conf);
100 # map {s/!/\n/g} ($changed_this_run,$changed_since_success);
105 my $logrows = ceil(scalar(@log_file_names)/$lrfactor);
106 my $logcells = $lrfactor * $logrows;
109 my $urldt = uri_escape($logdate);
115 print "Content-Type: text/html\n\n";
120 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
121 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
122 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
124 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
125 <title>PostgreSQL BuildFarm | Configuration summary for system "$system"</title>
126 <link rel="icon" type="image/png" href="/elephant-icon.png" />
127 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
132 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
135 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
136 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
137 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
138 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
139 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
142 </div><!-- banner -->
144 <h1>PostgreSQL Build Farm Log</h1>
145 <table align="top" cellspacing="0">
147 <th class="head" rowspan="2">System Information</th>
152 <th>Architecture</th>
157 <td><a href="/cgi-bin/show_history.pl?nm=$system&br=$branch">$branch</a></td>
158 <td>$info_row->{operating_system} $info_row->{os_version}</td>
159 <td>$info_row->{compiler} $info_row->{compiler_version}</td>
160 <td>$info_row->{architecture}</td>
161 <td>$info_row->{owner_email}</td>
166 if ($info_row->{sys_notes})
172 <th class="head" rowspan="2">System Notes</th>
177 <td>$info_row->{sys_notes_date}</td>
178 <td>$info_row->{sys_notes}</td>
185 for my $logstage (@log_file_names)
187 print "<br /> <table><tr><th class='head' rowspan='$logrows'>Stage Logs</th>\n"
188 unless $heading_done;
191 $logstage =~ s/\.log$//;
192 print "<tr>\n" if ($cell > 1 && $cell % $lrfactor == 1);
193 print "<td><a href='show_stage_log.pl?nm=$system&dt=$urldt&stg=$logstage'>$logstage</a></td>\n";
194 print "</tr>\n" if ($cell % $lrfactor == 0);
199 foreach my $rcell ($cell+1 .. $logcells)
201 print "<tr>\n" if ($rcell > 1 && $rcell % $lrfactor == 1);
202 print "<td> </td>\n";
203 print "</tr>\n" if ($rcell % $lrfactor == 0);
210 <h2>Configuration summary for system "$system"</h2>
211 <h3>Status 'OK' on snapshot taken $logdate</h3>
215 <h3>Files changed this run</h3>
220 print <<EOHTML if ($log);
229 <p style="text-align: center;">
230 Hosting for the PostgreSQL Buildfarm is generously
232 <a href="http://www.commandprompt.com">CommandPrompt,
233 The PostgreSQL Company</a>
235 </div><!-- wrapper -->
245 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
246 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
247 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
249 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
250 <title>PostgreSQL BuildFarm | Log for system "$system" failure on snapshot taken $logdate</title>
251 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
256 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
259 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
260 <li id="status"><a href="/cgi-bin/show_status.pl" title="Status Page">Status</a></li>
261 <li id="members"><a href="/cgi-bin/show_members.pl" title="Status Page">Members</a></li>
262 <li id="register"><a href="/register.html" title="Register">Register</a></li>
263 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
266 </div><!-- banner -->
268 <h1>PostgreSQL Build Farm Log</h1>
269 <h1>Details for system "$system" failure at stage $stage on snapshot taken $logdate</h1>
270 <table cellspacing="0">
272 <th class="head" rowspan="2">System Information</th>
277 <th>Architecture</th>
282 <td><a href="/cgi-bin/show_history.pl?nm=$system&br=$branch">$branch</a></td>
283 <td>$info_row->{operating_system} $info_row->{os_version}</td>
284 <td>$info_row->{compiler} $info_row->{compiler_version}</td>
285 <td>$info_row->{architecture}</td>
286 <td>$info_row->{owner_email}</td>
291 if ($info_row->{sys_notes})
297 <th class="head" rowspan="2">System Notes</th>
302 <td>$info_row->{sys_notes_date}</td>
303 <td>$info_row->{sys_notes}</td>
310 for my $logstage (@log_file_names)
312 print "<br /> <table><tr><th class='head' rowspan='4'>Stage Logs</th>\n"
313 unless $heading_done;
316 $logstage =~ s/\.log$//;
317 print "<tr>\n" if ($cell > 1 && $cell % $lrfactor == 1);
318 print "<td><a href='show_stage_log.pl?nm=$system&dt=$urldt&stg=$logstage'>$logstage</a></td>\n";
319 print "</tr>\n" if ($cell % $lrfactor == 0);
324 foreach my $rcell ($cell+1 .. $logcells)
326 print "<tr>\n" if ($rcell > 1 && $rcell % $lrfactor == 1);
327 print "<td> </td>\n";
328 print "</tr>\n" if ($rcell % $lrfactor == 0);
334 <h3>Configuration summary</h3>
338 <h3>Files changed this run</h3>
342 <h3>Files changed since last success</h3>
344 $changed_since_success
352 <p style="text-align: center;">
353 Hosting for the PostgreSQL Buildfarm is generously
355 <a href="http://www.commandprompt.com">CommandPrompt,
356 The PostgreSQL Company</a>
358 </div><!-- wrapper -->