Another instance of virtual bug that would strip plus from branch names.
[buildfarm-server.git] / cgi-bin / show_failures.pl
index 3169b845191174dd64a3fa04c56c68d56edcd48f..5b14cccf367087df08e803fba3fde199dbd44791 100755 (executable)
@@ -15,17 +15,17 @@ use CGI;
 
 use vars qw($dbhost $dbname $dbuser $dbpass $dbport $template_dir);
 
-
-require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+use FindBin qw($RealBin);
+require "$RealBin/../BuildFarmWeb.pl";
 
 my $query = new CGI;
-my @members = grep {$_ ne "" } $query->param('member');
+my @members = grep {$_ ne "" } $query->multi_param('member');
 map { s/[^a-zA-Z0-9_ -]//g; } @members;
 my $max_days =  $query->param('max_days') + 0 || 10;
-my @branches = grep {$_ ne "" } $query->param('branch');
-map { s/[^a-zA-Z0-9-]//g; } @branches;
-my @stages = grep {$_ ne "" } $query->param('stage');
-map { s/[^a-zA-Z0-9_ -]//g; } @stages;
+my @branches = grep {$_ ne "" } $query->multi_param('branch');
+map { s/[^a-zA-Z0-9+_ .-]//g; } @branches;
+my @stages = grep {$_ ne "" } $query->multi_param('stage');
+map { s/[^a-zA-Z0-9_ :-]//g; } @stages;
 
 my $dsn="dbi:Pg:dbname=$dbname";
 $dsn .= ";host=$dbhost" if $dbhost;
@@ -71,7 +71,7 @@ my $all_members = $db->selectcol_arrayref($get_all_members);
 
 my $get_all_stages = qq{
 
-  select distinct stage 
+  select distinct build_status.stage 
   from build_status 
     join nrecent_failures using (sysname,snapshot,branch)
 
@@ -109,18 +109,18 @@ while (my $row = $sth->fetchrow_hashref)
     next if (@branches && ! grep {$_ eq $row->{branch} } @branches);
     $row->{build_flags}  =~ s/^\{(.*)\}$/$1/;
     $row->{build_flags}  =~ s/,/ /g;
-       # enable-integer-datetimes is now the default
-       if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_3_STABLE')
-       {
-               $row->{build_flags} .= " --enable-integer-datetimes "
-                       unless ($row->{build_flags} =~ /--(en|dis)able-integer-datetimes/);
-       }
-       # enable-thread-safety is now the default
-       if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_5_STABLE')
-       {
-               $row->{build_flags} .= " --enable-thread-safety "
-                       unless ($row->{build_flags} =~ /--(en|dis)able-thread-safety/);
-       }
+##     # enable-integer-datetimes is now the default
+##     if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_3_STABLE')
+##     {
+##             $row->{build_flags} .= " --enable-integer-datetimes "
+##                     unless ($row->{build_flags} =~ /--(en|dis)able-integer-datetimes/);
+##     }
+##     # enable-thread-safety is now the default
+##     if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_5_STABLE')
+##     {
+##             $row->{build_flags} .= " --enable-thread-safety "
+##                     unless ($row->{build_flags} =~ /--(en|dis)able-thread-safety/);
+##     }
     $row->{build_flags}  =~ s/--((enable|with)-)?//g;
        $row->{build_flags} =~ s/libxml/xml/;
     $row->{build_flags}  =~ s/\S+=\S+//g;
@@ -149,4 +149,3 @@ $template->process('fstatus.tt',
                 qstages => \@stages} );
 
 exit;
-