8 die "Must pass sysname and status\n" unless scalar @ARGV == 2;
10 use vars qw($dbhost $dbname $dbuser $dbpass $dbport
12 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
14 die "no dbname" unless $dbname;
15 die "no dbuser" unless $dbuser;
17 my $dsn="dbi:Pg:dbname=$dbname";
18 $dsn .= ";host=$dbhost" if $dbhost;
19 $dsn .= ";port=$dbport" if $dbport;
21 my $db = DBI->connect($dsn,$dbuser,$dbpass);
23 die $DBI::errstr unless $db;
25 my $sth_up = $db->prepare(q[
26 UPDATE buildsystems AS b
30 $sth_up->execute($ARGV[1],$ARGV[0]);
32 my $sth = $db->prepare(q[
33 SELECT name, status, operating_system, os_version, sys_owner, owner_email
34 FROM buildsystems AS b
39 my $format = "%-10s %-10s %-18s %-20s %-18s %-s\n";
40 printf $format, "SysName", "Status", "Owner", "Email", "Distro", "Version";
41 while (my $row = $sth->fetchrow_hashref)
43 printf $format, $row->{name}, $row->{status}, $row->{sys_owner},
44 $row->{owner_email}, $row->{operating_system},