2 # Update the ompiler version for a system
9 die "Must pass current sysname and new version-string\n" unless scalar @ARGV == 2;
11 use vars qw($dbhost $dbname $dbuser $dbpass $dbport
15 use FindBin qw($RealBin);
16 require "$RealBin/../BuildFarmWeb.pl";
18 die "no dbname" unless $dbname;
19 die "no dbuser" unless $dbuser;
21 my $dsn="dbi:Pg:dbname=$dbname";
22 $dsn .= ";host=$dbhost" if $dbhost;
23 $dsn .= ";port=$dbport" if $dbport;
25 my $db = DBI->connect($dsn,$dbuser,$dbpass);
27 die $DBI::errstr unless $db;
29 my $sth_up = $db->prepare(q[
30 UPDATE buildsystems AS b
31 SET compiler_version = ?
34 $sth_up->execute($ARGV[1],$ARGV[0]);
36 my $sth = $db->prepare(q[
37 SELECT name, status, compiler, compiler_version, sys_owner, owner_email
38 FROM buildsystems AS b
43 printf $user_list_format,
44 "SysName", "Status", "Owner", "Email", "Compiler", "Version";
45 while (my $row = $sth->fetchrow_hashref)
47 printf $user_list_format,
48 $row->{name}, $row->{status}, $row->{sys_owner},
49 $row->{owner_email}, $row->{compiler}, $row->{compiler_version};