X-Git-Url: https://git.exim.org/buildfarm-server.git/blobdiff_plain/8300080b490ebbaa1d9b9176d864b0ea62e7fd2a..491ccf82d69eb51a6a4aeaff87e000e74cac313c:/cgi-bin/eximstatus.pl diff --git a/cgi-bin/eximstatus.pl b/cgi-bin/eximstatus.pl index b57655c..df25467 100755 --- a/cgi-bin/eximstatus.pl +++ b/cgi-bin/eximstatus.pl @@ -24,19 +24,21 @@ use CGI; use Digest::SHA1 qw(sha1_hex); use MIME::Base64; use DBI; -use DBD::mysql; +use DBD::Pg; use Data::Dumper; use Mail::Send; use Time::ParseDate; use Storable qw(thaw); -require "$ENV{BFConfDir}/BuildFarmWeb.pl"; -my $buildlogs = "$ENV{BFConfDir}/buildlogs"; +use FindBin qw($RealBin); +require "$RealBin/../BuildFarmWeb.pl"; + +my $buildlogs = "$RealBin/../buildlogs"; die "no dbname" unless $dbname; die "no dbuser" unless $dbuser; -my $dsn="dbi:mysql:dbname=$dbname"; +my $dsn="dbi:Pg:dbname=$dbname"; $dsn .= ";host=$dbhost" if $dbhost; $dsn .= ";port=$dbport" if $dbport; @@ -90,14 +92,15 @@ unless ($animal && $ts && $stage && $sig) } -unless ($branch =~ /^(HEAD|REL\d+_\d+_STABLE)$/) -{ - print - "Status: 492 bad branch parameter $branch\nContent-Type: text/plain\n\n", - "bad branch parameter $branch\n"; - exit; - -} +# Want to allow all kinds of named branches +#unless ($branch =~ /^(HEAD|REL\d+_\d+_STABLE)$/) +#{ +# print +# "Status: 492 bad branch parameter $branch\nContent-Type: text/plain\n\n", +# "bad branch parameter $branch\n"; +# exit; +# +#} my $db = DBI->connect($dsn,$dbuser,$dbpass); @@ -226,7 +229,7 @@ if ($log_archive) chomp $githeadref; close $githead; } - # unlink $archname; + unlink $archname; } my $config_flags; @@ -296,6 +299,10 @@ if (@config_flags) @config_flags = grep {! m/=/ } @config_flags; map {s/\s+//g; $_=qq("$_"); } @config_flags; push @config_flags,'git' if $client_conf->{scm} eq 'git'; + push(@config_flags, 'doc') + if (defined $client_conf->{'optional_steps'}->{'make-doc'}); + push(@config_flags, 'test') + if (defined $client_conf->{'optional_steps'}->{'test'}); $config_flags = '{' . join(',',@config_flags) . '}' ; } @@ -320,7 +327,7 @@ EOSQL my $sqlres; $db->begin_work; -$db->do("select set_local_error_terse()"); +#$db->do("select set_local_error_terse()"); $sth=$db->prepare($logst); @@ -335,13 +342,13 @@ $sth->bind_param(7,$branch); $sth->bind_param(8,$changed_this_run); $sth->bind_param(9,$changed_since_success); $sth->bind_param(10,$log_file_names); -#$sth->bind_param(11,$log_archive,{ pg_type => DBD::mysql::PG_BYTEA }); -$sth->bind_param(11,undef,{ pg_type => DBD::mysql::PG_BYTEA }); +#$sth->bind_param(11,$log_archive,{ pg_type => DBD::Pg::PG_BYTEA }); +$sth->bind_param(11,undef,{ pg_type => DBD::Pg::PG_BYTEA }); $sth->bind_param(12,$config_flags); $sth->bind_param(13,$scm); $sth->bind_param(14,$scmurl); $sth->bind_param(15,$githeadref); -$sth->bind_param(16,$frozen_sconf,{ pg_type => DBD::mysql::PG_BYTEA }); +$sth->bind_param(16,$frozen_sconf,{ pg_type => DBD::Pg::PG_BYTEA }); $sqlres = $sth->execute; @@ -528,7 +535,7 @@ my $me = `id -un`; chomp($me); my $host = `hostname`; chomp ($host); $host = $default_host unless ($host =~ m/[.]/ || !defined($default_host)); -my $from_addr = "PG Build Farm <$me\@$host>"; +my $from_addr = "Exim Build Farm <$me\@$host>"; $from_addr =~ tr /\r\n//d; my $msg = new Mail::Send; @@ -536,13 +543,13 @@ my $msg = new Mail::Send; $msg->to(@$mailto); $msg->bcc(@$bcc_stat) if (@$bcc_stat); -$msg->subject("PGBuildfarm member $animal Branch $branch $stat_type $stage"); +$msg->subject("Exim BuildFarm member $animal Branch $branch $stat_type $stage"); $msg->set('From',$from_addr); my $fh = $msg->open; print $fh <subject("PGBuildfarm member $animal Branch $branch Status $stat_type"); +$msg->subject("Exim BuildFarm member $animal Branch $branch Status $stat_type"); $msg->set('From',$from_addr); $fh = $msg->open; print $fh <