5 Copyright (c) 2003-2010, Andrew Dunstan
7 See accompanying License file for license details
16 use vars qw($dbhost $dbname $dbuser $dbpass $dbport $template_dir);
18 use FindBin qw($RealBin);
19 require "$RealBin/../BuildFarmWeb.pl";
21 die "no dbname" unless $dbname;
22 die "no dbuser" unless $dbuser;
24 my $dsn="dbi:Pg:dbname=$dbname";
25 $dsn .= ";host=$dbhost" if $dbhost;
26 $dsn .= ";port=$dbport" if $dbport;
28 my $db = DBI->connect($dsn,$dbuser,$dbpass);
30 die $DBI::errstr unless $db;
33 my $member = $query->param('nm'); $member =~ s/[^a-zA-Z0-9_ -]//g;
34 my $branch = $query->param('br'); $branch =~ s/[^a-zA-Z0-9_ -]//g;
35 my $hm = $query->param('hm'); $hm =~ s/[^a-zA-Z0-9_ -]//g;
36 $hm = '240' unless $hm =~ /^\d+$/;
38 my $latest_personality = $db->selectrow_arrayref(q{
39 select os_version, compiler_version
42 order by effective_date desc limit 1
46 select operating_system, os_version, compiler, compiler_version, architecture,
47 owner_email, sys_notes_ts::date AS sys_notes_date, sys_notes
49 where b.status = 'approved'
56 from build_status_recent_500
60 select (now() at time zone 'GMT')::timestamp(0) - snapshot as when_ago,
61 sysname, snapshot, status, stage
63 order by snapshot desc
68 my $sth = $db->prepare($systemdata);
69 $sth->execute($member);
70 my $sysrow = $sth->fetchrow_hashref;
72 $sth=$db->prepare($statement);
73 $sth->execute($member,$branch);
74 while (my $row = $sth->fetchrow_hashref)
77 while (my($k,$v) = each %$sysrow) { $row->{$k} = $v; }
78 $row->{owner_email} =~ s/\@/ [ a t ] /;
79 if ($latest_personality)
81 $row->{os_version} = $latest_personality->[0];
82 $row->{compiler_version} = $latest_personality->[1];
84 push(@$statrows,$row);
91 my $template_opts = { INCLUDE_PATH => $template_dir, EVAL_PERL => 1 };
92 my $template = new Template($template_opts);
94 print "Content-Type: text/html\n\n";
96 $template->process('history.tt',