8 die "Must pass current and new sysnames\n" unless scalar @ARGV == 2;
10 use vars qw($dbhost $dbname $dbuser $dbpass $dbport
14 use FindBin qw($RealBin);
15 require "$RealBin/../BuildFarmWeb.pl";
17 die "no dbname" unless $dbname;
18 die "no dbuser" unless $dbuser;
20 my $dsn="dbi:Pg:dbname=$dbname";
21 $dsn .= ";host=$dbhost" if $dbhost;
22 $dsn .= ";port=$dbport" if $dbport;
24 my $db = DBI->connect($dsn,$dbuser,$dbpass);
26 die $DBI::errstr unless $db;
28 my $sth_up = $db->prepare(q[
29 UPDATE buildsystems AS b
33 $sth_up->execute($ARGV[1],$ARGV[0]);
35 my $sth = $db->prepare(q[
36 SELECT name, status, operating_system, os_version, sys_owner, owner_email
37 FROM buildsystems AS b
42 printf $user_list_format,
43 "SysName", "Status", "Owner", "Email", "Distro", "Version";
44 while (my $row = $sth->fetchrow_hashref)
46 printf $user_list_format,
47 $row->{name}, $row->{status}, $row->{sys_owner},
48 $row->{owner_email}, $row->{operating_system},