use CGI;
use URI::Escape;
-use vars qw($dbhost $dbname $dbuser $dbpass $dbport @log_file_names);
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport $template_dir @log_file_names);
require "$ENV{BFConfDir}/BuildFarmWeb.pl";
#require "BuildFarmWeb.pl";
+my $template_opts = { INCLUDE_PATH => $template_dir};
+my $template = new Template($template_opts);
+
die "no dbname" unless $dbname;
die "no dbuser" unless $dbuser;
my $log = "";
my $conf = "";
-my ($stage,$changed_this_run,$changed_since_success,$sysinfo,$branch);
+my ($stage,$changed_this_run,$changed_since_success,$sysinfo,$branch,$scmurl);
+my $scm;
use vars qw($info_row);
my $statement = <<EOS;
select log,conf_sum,stage, changed_this_run, changed_since_success,branch,
- log_archive_filenames
+ log_archive_filenames, scm, scmurl
from build_status
where sysname = ? and snapshot = ?
$changed_since_success = $row->[4];
$branch = $row->[5];
my $log_file_names = $row->[6];
+ $scm = $row->[7];
+ $scm ||= 'cvs'; # legacy scripts
+ $scmurl = $row->[8];
$log_file_names =~ s/^\{(.*)\}$/$1/;
@log_file_names=split(',',$log_file_names)
if $log_file_names;
select operating_system, os_version,
compiler, compiler_version,
architecture,
- replace(owner_email,'\@',' [ a t ] ') as owner_email
+ replace(owner_email,'\@',' [ a t ] ') as owner_email,
+ sys_notes_ts::date AS sys_notes_date, sys_notes
from buildsystems
where status = 'approved'
and name = ?
$sth=$db->prepare($statement);
$sth->execute($system);
$info_row=$sth->fetchrow_hashref;
- $sysinfo = join(" ",@$row);
+ # $sysinfo = join(" ",@$row);
$sth->finish;
$db->disconnect;
}
foreach my $chgd ($changed_this_run,$changed_since_success)
{
+ my $cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi';
+ my $giturl = $scmurl || 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=';
my @lines = split(/!/,$chgd);
foreach (@lines)
{
- next unless m!^pgsql/!;
- s!(^\S+)(\s+)(\S+)!<a href="http://developer.postgresql.org/cvsweb.cgi/$1?rev=$3">$1$2$3</a>!;
+ if ($scm eq 'git')
+ {
+ s!(^\S+)(\s+)(\S+)!<a href="$giturl$3">$1</a>!;
+ }
+ elsif ($scm eq 'cvs')
+ {
+ next unless m!^(pgsql|master|REL\d_\d_STABLE)/!;
+ s!(^\S+)(\s+)(\S+)!<a href="$cvsurl/$1?rev=$3">$1$2$3</a>!;
+ }
}
$chgd = join("\n",@lines);
$chgd ||= 'not recorded';
use POSIX qw(ceil);
-my $lrfactor = 7;
+my $lrfactor = 6;
my $logrows = ceil(scalar(@log_file_names)/$lrfactor);
my $logcells = $lrfactor * $logrows;
<li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
<li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
<li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
- <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
+ <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
<li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
</ul>
</div><!-- nav -->
</table>
EOHTML
+ if ($info_row->{sys_notes})
+ {
+ print <<EOHTML;
+ <br />
+ <table>
+ <tr>
+ <th class="head" rowspan="2">System Notes</th>
+ <th>Date</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td>$info_row->{sys_notes_date}</td>
+ <td>$info_row->{sys_notes}</td>
+ </tr>
+ </table>
+EOHTML
+
+ }
+
for my $logstage (@log_file_names)
{
- print "<br /> <table><tr><th class='head' rowspan='4'>Stage Logs</th>\n"
+ print "<br /> <table><tr><th class='head' rowspan='$logrows'>Stage Logs</th>\n"
unless $heading_done;
$heading_done = 1;
$cell++;
<li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
<li id="status"><a href="/cgi-bin/show_status.pl" title="Status Page">Status</a></li>
<li id="members"><a href="/cgi-bin/show_members.pl" title="Status Page">Members</a></li>
- <li id="register"><a href="/register.html" title="Register">Register</a></li>
+ <li id="register"><a href="/cgi-bin/register-form.pl" title="Register">Register</a></li>
<li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
</ul>
</div><!-- nav -->
<td>$info_row->{architecture}</td>
<td>$info_row->{owner_email}</td>
</tr>
- </table>
+ </table>
+EOHTML
+
+ if ($info_row->{sys_notes})
+ {
+ print <<EOHTML;
+ <br />
+ <table>
+ <tr>
+ <th class="head" rowspan="2">System Notes</th>
+ <th>Date</th>
+ <th>Notes</th>
+ </tr>
+ <tr>
+ <td>$info_row->{sys_notes_date}</td>
+ <td>$info_row->{sys_notes}</td>
+ </tr>
+ </table>
EOHTML
+ }
+
for my $logstage (@log_file_names)
{
print "<br /> <table><tr><th class='head' rowspan='4'>Stage Logs</th>\n"