* build-remote.pl: allow the system type to be a comma-separated list

of system types.  Don't treat the x86_64-linux system type
  specially.
This commit is contained in:
Eelco Dolstra 2009-09-17 13:51:04 +00:00
parent 0dbd4638e0
commit 57e0d73c77

View file

@ -62,7 +62,7 @@ while (<CONF>) {
/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s*$/ or die; /^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s*$/ or die;
push @machines, push @machines,
{ hostName => $1 { hostName => $1
, systemType => $2 , systemTypes => [split(/,/, $2)]
, sshKeys => $3 , sshKeys => $3
, maxJobs => $4 , maxJobs => $4
}; };
@ -82,16 +82,15 @@ my $rightType = 0;
my $machine; my $machine;
my $slotLock; my $slotLock;
LOOP: foreach my $cur (@machines) { LOOP: foreach my $cur (@machines) {
if ($neededSystem eq $cur->{systemType} print STDERR @{$cur->{systemTypes}}, "\n";
|| ($neededSystem eq "i686-linux" && $cur->{systemType} eq "x86_64-linux")) if (grep { $neededSystem eq $_ } @{$cur->{systemTypes}}) {
{
$rightType = 1; $rightType = 1;
# We have a machine of the right type. Try to get a lock on # We have a machine of the right type. Try to get a lock on
# one of the machine's lock files. # one of the machine's lock files.
my $slot = 0; my $slot = 0;
while ($slot < $cur->{maxJobs}) { while ($slot < $cur->{maxJobs}) {
my $slotLockFn = "$currentLoad/" . $cur->{systemType} . "-" . $cur->{hostName} . "-$slot"; my $slotLockFn = "$currentLoad/" . (join '+', @{$cur->{systemTypes}}) . "-" . $cur->{hostName} . "-$slot";
$slotLock = new IO::Handle; $slotLock = new IO::Handle;
open $slotLock, ">>$slotLockFn" or die; open $slotLock, ">>$slotLockFn" or die;
if (flock($slotLock, LOCK_EX | LOCK_NB)) { if (flock($slotLock, LOCK_EX | LOCK_NB)) {