X-Git-Url: https://git.exim.org/buildfarm-server.git/blobdiff_plain/a19a7c8ebfe9459a0d5521c5ba3366658b24989f..4bd92ca9427fbd4677e0adad3ad3a14dc1df6017:/cgi-bin/eximstatus.pl diff --git a/cgi-bin/eximstatus.pl b/cgi-bin/eximstatus.pl index 7e7b900..38a7d96 100755 --- a/cgi-bin/eximstatus.pl +++ b/cgi-bin/eximstatus.pl @@ -9,6 +9,7 @@ See accompanying License file for license details =cut use strict; +use URI::Escape; use vars qw($dbhost $dbname $dbuser $dbpass $dbport $all_stat $fail_stat $change_stat $green_stat @@ -30,8 +31,10 @@ 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; @@ -74,7 +77,7 @@ if (open($brhandle,"../htdocs/branches_of_interest.txt")) my $content = - "branch=$branch&res=$res&stage=$stage&animal=$animal&". + 'branch=' . uri_escape($branch) . "&res=$res&stage=$stage&animal=$animal&". "ts=$ts&log=$log&conf=$conf"; my $extra_content = @@ -90,14 +93,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 +230,7 @@ if ($log_archive) chomp $githeadref; close $githead; } - # unlink $archname; + unlink $archname; } my $config_flags; @@ -296,6 +300,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) . '}' ; } @@ -304,10 +312,10 @@ my $scmurl = $client_conf->{scm_url}; my $logst = <do("delete from dashboard_mat"); $db->do("insert into dashboard_mat select * from dashboard_mat_data"); $db->commit; -if ($stage ne 'OK') -{ - $db->begin_work; - # prevent occasional duplication by forcing serialization of this operation - $db->do("lock table nrecent_failures in share row exclusive mode"); - $db->do("delete from nrecent_failures"); - $db->do("insert into nrecent_failures select bs.sysname, bs.snapshot, bs.branch from build_status bs where bs.stage <> 'OK' and bs.snapshot > now() - interval '90 days'"); - $db->commit; -} + +#if ($stage ne 'OK') # On Exim build farm nrecent_failures is a view, not table... comment out +#{ +# $db->begin_work; +# # prevent occasional duplication by forcing serialization of this operation +# $db->do("lock table nrecent_failures in share row exclusive mode"); +# $db->do("delete from nrecent_failures"); +# $db->do("insert into nrecent_failures select bs.sysname, bs.snapshot, bs.branch from build_status bs where bs.stage <> 'OK' and bs.snapshot > now() - interval '90 days'"); +# $db->commit; +#} $db->disconnect;