7 use File::Temp qw(tempfile);
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;
26 my $stage = $query->param('stg');$stage =~ s/[^a-zA-Z0-9._ -]//g;
30 if ($system && $logdate && $stage)
32 my $db = DBI->connect($dsn,$dbuser,$dbpass);
34 die $DBI::errstr unless $db;
38 select branch, log_text
40 where sysname = ? and snapshot = ? and log_stage = ? || '.log'
46 my $sth=$db->prepare($statement);
47 $sth->execute($system,$logdate,$stage);
48 my $row=$sth->fetchrow_arrayref;
49 my ($branch, $logtext) = ("unknown","no log text found");
58 print "Content-Type: text/plain\n\n", $logtext,
60 "-------------------------------------------------\n\n",
61 "Hosting for the PostgreSQL Buildfarm is generously ",
62 "provided by: CommandPrompt, The PostgreSQL Company";
68 print "Status: 460 bad parameters\n",
69 "Content-Type: text/plain\n\n";