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 use FindBin qw($RealBin);
16 require "$RealBin/../BuildFarmWeb.pl";
18 use SOAP::Transport::HTTP;
20 SOAP::Transport::HTTP::CGI->dispatch_to('EximBuildFarm')->handle;
24 package EximBuildFarm;
34 my $dsn="dbi:Pg:dbname=$::dbname";
35 $dsn .= ";host=$::dbhost" if $::dbhost;
36 $dsn .= ";port=$::dbport" if $::dbport;
38 my $db = DBI->connect($dsn,$::dbuser,$::dbpass) or
39 die("$dsn,$::dbuser,$::dbpass,$!");
41 # there is possibly some redundancy in this query, but it makes
42 # a lot of the processing simpler.
47 select (now() at time zone 'GMT')::timestamp(0) - snapshot as when_ago, dsh.*
48 from dashboard_mat dsh
49 order by branch = 'HEAD' desc,
59 my $sth=$db->prepare($statement);
61 while (my $row = $sth->fetchrow_hashref)
63 next if (@members && ! grep {$_ eq $row->{sysname} } @members);
64 $row->{build_flags} =~ s/^\{(.*)\}$/$1/;
65 $row->{build_flags} =~ s/,/ /g;
66 $row->{build_flags} =~ s/--((enable|with)-)?//g;
67 $row->{build_flags} =~ s/\S+=\S+//g;
68 push(@$statrows,$row);