#!/usr/bin/perl =comment Copyright (c) 2003-2010, Andrew Dunstan See accompanying License file for license details =cut use strict; use vars qw($dbhost $dbname $dbuser $dbpass $dbport); use FindBin qw($RealBin); require "$RealBin/../BuildFarmWeb.pl"; use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI->dispatch_to('EximBuildFarm')->handle; exit; package EximBuildFarm; use DBI; sub get_status { my $class = shift; my @members = @_; my $dsn="dbi:Pg:dbname=$::dbname"; $dsn .= ";host=$::dbhost" if $::dbhost; $dsn .= ";port=$::dbport" if $::dbport; my $db = DBI->connect($dsn,$::dbuser,$::dbpass) or die("$dsn,$::dbuser,$::dbpass,$!"); # there is possibly some redundancy in this query, but it makes # a lot of the processing simpler. my $statement =<prepare($statement); $sth->execute; while (my $row = $sth->fetchrow_hashref) { next if (@members && ! grep {$_ eq $row->{sysname} } @members); $row->{build_flags} =~ s/^\{(.*)\}$/$1/; $row->{build_flags} =~ s/,/ /g; $row->{build_flags} =~ s/--((enable|with)-)?//g; $row->{build_flags} =~ s/\S+=\S+//g; push(@$statrows,$row); } $sth->finish; $db->disconnect; return $statrows; } 1;