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
71 where status = 'approved'
76 $sth=$db->prepare($statement);
77 $sth->execute($system);
78 $info_row=$sth->fetchrow_hashref;
79 $sysinfo = join(" ",@$row);
84 foreach my $chgd ($changed_this_run,$changed_since_success)
86 my @lines = split(/!/,$chgd);
89 next unless m!^pgsql/!;
90 s!(^\S+)(\s+)(\S+)!<a href="http://anoncvs.postgresql.org/cvsweb.cgi/$1?rev=$3">$1$2$3</a>!;
92 $chgd = join("\n",@lines);
93 $chgd ||= 'not recorded';
97 $conf =~ s/\@/ [ a t ] /g;
98 map {s/&/&/g; s/</</g; s/>/>/g; s/\"/"/g;} ($log,$conf);
99 # map {s/!/\n/g} ($changed_this_run,$changed_since_success);
104 my $logrows = ceil(scalar(@log_file_names)/$lrfactor);
105 my $logcells = $lrfactor * $logrows;
108 my $urldt = uri_escape($logdate);
114 print "Content-Type: text/html\n\n";
119 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
120 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
121 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
123 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
124 <title>PostgreSQL BuildFarm | Configuration summary for system "$system"</title>
125 <link rel="icon" type="image/png" href="/elephant-icon.png" />
126 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
131 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
134 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
135 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
136 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
137 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
138 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
141 </div><!-- banner -->
143 <h1>PostgreSQL Build Farm Log</h1>
144 <table align="top" cellspacing="0">
146 <th class="head" rowspan="2">System Information</th>
151 <th>Architecture</th>
156 <td><a href="/cgi-bin/show_history.pl?nm=$system&br=$branch">$branch</a></td>
157 <td>$info_row->{operating_system} $info_row->{os_version}</td>
158 <td>$info_row->{compiler} $info_row->{compiler_version}</td>
159 <td>$info_row->{architecture}</td>
160 <td>$info_row->{owner_email}</td>
165 for my $logstage (@log_file_names)
167 print "<br /> <table><tr><th class='head' rowspan='4'>Stage Logs</th>\n"
168 unless $heading_done;
171 $logstage =~ s/\.log$//;
172 print "<tr>\n" if ($cell > 1 && $cell % $lrfactor == 1);
173 print "<td><a href='show_stage_log.pl?nm=$system&dt=$urldt&stg=$logstage'>$logstage</a></td>\n";
174 print "</tr>\n" if ($cell % $lrfactor == 0);
179 foreach my $rcell ($cell+1 .. $logcells)
181 print "<tr>\n" if ($rcell > 1 && $rcell % $lrfactor == 1);
182 print "<td> </td>\n";
183 print "</tr>\n" if ($rcell % $lrfactor == 0);
190 <h2>Configuration summary for system "$system"</h2>
191 <h3>Status 'OK' on snapshot taken $logdate</h3>
195 <h3>Files changed this run</h3>
200 print <<EOHTML if ($log);
209 <p style="text-align: center;">
210 Hosting for the PostgreSQL Buildfarm is generously
212 <a href="http://www.commandprompt.com">CommandPrompt,
213 The PostgreSQL Company</a>
215 </div><!-- wrapper -->
225 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
226 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
227 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
229 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
230 <title>PostgreSQL BuildFarm | Log for system "$system" failure on snapshot taken $logdate</title>
231 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
236 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
239 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
240 <li id="status"><a href="/cgi-bin/show_status.pl" title="Status Page">Status</a></li>
241 <li id="members"><a href="/cgi-bin/show_members.pl" title="Status Page">Members</a></li>
242 <li id="register"><a href="/register.html" title="Register">Register</a></li>
243 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
246 </div><!-- banner -->
248 <h1>PostgreSQL Build Farm Log</h1>
249 <h1>Details for system "$system" failure at stage $stage on snapshot taken $logdate</h1>
250 <table cellspacing="0">
252 <th class="head" rowspan="2">System Information</th>
257 <th>Architecture</th>
262 <td><a href="/cgi-bin/show_history.pl?nm=$system&br=$branch">$branch</a></td>
263 <td>$info_row->{operating_system} $info_row->{os_version}</td>
264 <td>$info_row->{compiler} $info_row->{compiler_version}</td>
265 <td>$info_row->{architecture}</td>
266 <td>$info_row->{owner_email}</td>
271 for my $logstage (@log_file_names)
273 print "<br /> <table><tr><th class='head' rowspan='4'>Stage Logs</th>\n"
274 unless $heading_done;
277 $logstage =~ s/\.log$//;
278 print "<tr>\n" if ($cell > 1 && $cell % $lrfactor == 1);
279 print "<td><a href='show_stage_log.pl?nm=$system&dt=$urldt&stg=$logstage'>$logstage</a></td>\n";
280 print "</tr>\n" if ($cell % $lrfactor == 0);
285 foreach my $rcell ($cell+1 .. $logcells)
287 print "<tr>\n" if ($rcell > 1 && $rcell % $lrfactor == 1);
288 print "<td> </td>\n";
289 print "</tr>\n" if ($rcell % $lrfactor == 0);
295 <h3>Configuration summary</h3>
299 <h3>Files changed this run</h3>
303 <h3>Files changed since last success</h3>
305 $changed_since_success
313 <p style="text-align: center;">
314 Hosting for the PostgreSQL Buildfarm is generously
316 <a href="http://www.commandprompt.com">CommandPrompt,
317 The PostgreSQL Company</a>
319 </div><!-- wrapper -->