5 Copyright (c) 2003-2010, Andrew Dunstan
7 See accompanying License file for license details
13 use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
15 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
17 use SOAP::Transport::HTTP;
19 SOAP::Transport::HTTP::CGI->dispatch_to('PGBuildFarm')->handle;
33 my $dsn="dbi:Pg:dbname=$::dbname";
34 $dsn .= ";host=$::dbhost" if $::dbhost;
35 $dsn .= ";port=$::dbport" if $::dbport;
37 my $db = DBI->connect($dsn,$::dbuser,$::dbpass) or
38 die("$dsn,$::dbuser,$::dbpass,$!");
40 # there is possibly some redundancy in this query, but it makes
41 # a lot of the processing simpler.
46 select (now() at time zone 'GMT')::timestamp(0) - snapshot as when_ago, dsh.*
47 from dashboard_mat dsh
48 order by branch = 'HEAD' desc,
58 my $sth=$db->prepare($statement);
60 while (my $row = $sth->fetchrow_hashref)
62 next if (@members && ! grep {$_ eq $row->{sysname} } @members);
63 $row->{build_flags} =~ s/^\{(.*)\}$/$1/;
64 $row->{build_flags} =~ s/,/ /g;
65 $row->{build_flags} =~ s/--((enable|with)-)?//g;
66 $row->{build_flags} =~ s/\S+=\S+//g;
67 push(@$statrows,$row);