8 use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
11 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
12 #require "BuildFarmWeb.pl";
14 die "no dbname" unless $dbname;
15 die "no dbuser" unless $dbuser;
17 my $dsn="dbi:Pg:dbname=$dbname";
18 $dsn .= ";host=$dbhost" if $dbhost;
19 $dsn .= ";port=$dbport" if $dbport;
21 my $db = DBI->connect($dsn,$dbuser,$dbpass);
23 die $DBI::errstr unless $db;
26 my $member = $query->param('nm');
27 my $branch = $query->param('br');
29 # we don't really need to do this join, since we only want
30 # one row from buildsystems. but it means we only have to run one
31 # query. If it gets heavy we'll split it up and run two
33 my $statement = <<EOS;
35 select (now() at time zone 'GMT')::timestamp(0) - snapshot as when_ago,
36 sysname, snapshot, b.status, stage,
37 operating_system, os_version, compiler, compiler_version, architecture
42 and s.status = 'approved'
44 order by snapshot desc
51 my $sth=$db->prepare($statement);
52 $sth->execute($member,$branch);
53 while (my $row = $sth->fetchrow_hashref)
55 push(@$statrows,$row);
61 my $template = new Template({EVAL_PERL => 1,
62 INCLUDE_PATH => "/home/community/pgbuildfarm/templates",
65 print "Content-Type: text/html\n\n";
67 $template->process("dyn/history.tt",
68 {statrows=>$statrows, branch=>$branch, member => $member});