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);
32 use vars qw($info_row);
34 if ($system && $logdate)
37 my $db = DBI->connect($dsn,$dbuser,$dbpass);
39 die $DBI::errstr unless $db;
41 my $statement = <<EOS;
43 select log,conf_sum,stage, changed_this_run, changed_since_success,branch,
44 log_archive_filenames, scm
46 where sysname = ? and snapshot = ?
50 my $sth=$db->prepare($statement);
51 $sth->execute($system,$logdate);
52 my $row=$sth->fetchrow_arrayref;
54 $conf=$row->[1] || "not recorded" ;
55 $stage=$row->[2] || "unknown";
56 $changed_this_run = $row->[3];
57 $changed_since_success = $row->[4];
59 my $log_file_names = $row->[6];
61 $scm ||= 'cvs'; # legacy scripts
62 $log_file_names =~ s/^\{(.*)\}$/$1/;
63 @log_file_names=split(',',$log_file_names)
69 select operating_system, os_version,
70 compiler, compiler_version,
72 replace(owner_email,'\@',' [ a t ] ') as owner_email,
73 sys_notes_ts::date AS sys_notes_date, sys_notes
75 where status = 'approved'
80 $sth=$db->prepare($statement);
81 $sth->execute($system);
82 $info_row=$sth->fetchrow_hashref;
83 # $sysinfo = join(" ",@$row);
88 foreach my $chgd ($changed_this_run,$changed_since_success)
90 my $cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi';
91 my $giturl = 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;';
92 my @lines = split(/!/,$chgd);
97 s!(^\S+)(\s+)(\S+)!<a href="$giturl;h=$3">$1</a>!;
101 next unless m!^pgsql/!;
102 s!(^\S+)(\s+)(\S+)!<a href="$cvsurl/$1?rev=$3">$1$2$3</a>!;
105 $chgd = join("\n",@lines);
106 $chgd ||= 'not recorded';
110 $conf =~ s/\@/ [ a t ] /g;
111 map {s/&/&/g; s/</</g; s/>/>/g; s/\"/"/g;} ($log,$conf);
112 # map {s/!/\n/g} ($changed_this_run,$changed_since_success);
117 my $logrows = ceil(scalar(@log_file_names)/$lrfactor);
118 my $logcells = $lrfactor * $logrows;
121 my $urldt = uri_escape($logdate);
127 print "Content-Type: text/html\n\n";
132 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
133 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
134 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
136 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
137 <title>PostgreSQL BuildFarm | Configuration summary for system "$system"</title>
138 <link rel="icon" type="image/png" href="/elephant-icon.png" />
139 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
144 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
147 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
148 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
149 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
150 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
151 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
154 </div><!-- banner -->
156 <h1>PostgreSQL Build Farm Log</h1>
157 <table align="top" cellspacing="0">
159 <th class="head" rowspan="2">System Information</th>
164 <th>Architecture</th>
169 <td><a href="/cgi-bin/show_history.pl?nm=$system&br=$branch">$branch</a></td>
170 <td>$info_row->{operating_system} $info_row->{os_version}</td>
171 <td>$info_row->{compiler} $info_row->{compiler_version}</td>
172 <td>$info_row->{architecture}</td>
173 <td>$info_row->{owner_email}</td>
178 if ($info_row->{sys_notes})
184 <th class="head" rowspan="2">System Notes</th>
189 <td>$info_row->{sys_notes_date}</td>
190 <td>$info_row->{sys_notes}</td>
197 for my $logstage (@log_file_names)
199 print "<br /> <table><tr><th class='head' rowspan='$logrows'>Stage Logs</th>\n"
200 unless $heading_done;
203 $logstage =~ s/\.log$//;
204 print "<tr>\n" if ($cell > 1 && $cell % $lrfactor == 1);
205 print "<td><a href='show_stage_log.pl?nm=$system&dt=$urldt&stg=$logstage'>$logstage</a></td>\n";
206 print "</tr>\n" if ($cell % $lrfactor == 0);
211 foreach my $rcell ($cell+1 .. $logcells)
213 print "<tr>\n" if ($rcell > 1 && $rcell % $lrfactor == 1);
214 print "<td> </td>\n";
215 print "</tr>\n" if ($rcell % $lrfactor == 0);
222 <h2>Configuration summary for system "$system"</h2>
223 <h3>Status 'OK' on snapshot taken $logdate</h3>
227 <h3>Files changed this run</h3>
232 print <<EOHTML if ($log);
241 <p style="text-align: center;">
242 Hosting for the PostgreSQL Buildfarm is generously
244 <a href="http://www.commandprompt.com">CommandPrompt,
245 The PostgreSQL Company</a>
247 </div><!-- wrapper -->
257 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
258 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
259 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
261 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
262 <title>PostgreSQL BuildFarm | Log for system "$system" failure on snapshot taken $logdate</title>
263 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
268 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
271 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
272 <li id="status"><a href="/cgi-bin/show_status.pl" title="Status Page">Status</a></li>
273 <li id="members"><a href="/cgi-bin/show_members.pl" title="Status Page">Members</a></li>
274 <li id="register"><a href="/register.html" title="Register">Register</a></li>
275 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
278 </div><!-- banner -->
280 <h1>PostgreSQL Build Farm Log</h1>
281 <h1>Details for system "$system" failure at stage $stage on snapshot taken $logdate</h1>
282 <table cellspacing="0">
284 <th class="head" rowspan="2">System Information</th>
289 <th>Architecture</th>
294 <td><a href="/cgi-bin/show_history.pl?nm=$system&br=$branch">$branch</a></td>
295 <td>$info_row->{operating_system} $info_row->{os_version}</td>
296 <td>$info_row->{compiler} $info_row->{compiler_version}</td>
297 <td>$info_row->{architecture}</td>
298 <td>$info_row->{owner_email}</td>
303 if ($info_row->{sys_notes})
309 <th class="head" rowspan="2">System Notes</th>
314 <td>$info_row->{sys_notes_date}</td>
315 <td>$info_row->{sys_notes}</td>
322 for my $logstage (@log_file_names)
324 print "<br /> <table><tr><th class='head' rowspan='4'>Stage Logs</th>\n"
325 unless $heading_done;
328 $logstage =~ s/\.log$//;
329 print "<tr>\n" if ($cell > 1 && $cell % $lrfactor == 1);
330 print "<td><a href='show_stage_log.pl?nm=$system&dt=$urldt&stg=$logstage'>$logstage</a></td>\n";
331 print "</tr>\n" if ($cell % $lrfactor == 0);
336 foreach my $rcell ($cell+1 .. $logcells)
338 print "<tr>\n" if ($rcell > 1 && $rcell % $lrfactor == 1);
339 print "<td> </td>\n";
340 print "</tr>\n" if ($rcell % $lrfactor == 0);
346 <h3>Configuration summary</h3>
350 <h3>Files changed this run</h3>
354 <h3>Files changed since last success</h3>
356 $changed_since_success
364 <p style="text-align: center;">
365 Hosting for the PostgreSQL Buildfarm is generously
367 <a href="http://www.commandprompt.com">CommandPrompt,
368 The PostgreSQL Company</a>
370 </div><!-- wrapper -->