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