aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2016-01-22 17:55:25 +0000
committerPascal Terjan <pterjan@gmail.com>2016-01-22 17:55:25 +0000
commit351f891c10520c9deebb065f8565c6ba3b6a260b (patch)
tree539a79bc3c082772de964347a410dbcf4cd748e4
parent8830dafdc8e8003b6b116af823e05f7a6d923fbf (diff)
downloadiurt-351f891c10520c9deebb065f8565c6ba3b6a260b.tar
iurt-351f891c10520c9deebb065f8565c6ba3b6a260b.tar.gz
iurt-351f891c10520c9deebb065f8565c6ba3b6a260b.tar.bz2
iurt-351f891c10520c9deebb065f8565c6ba3b6a260b.tar.xz
iurt-351f891c10520c9deebb065f8565c6ba3b6a260b.zip
Reduce the use of global variables
-rwxr-xr-xulri18
1 files changed, 6 insertions, 12 deletions
diff --git a/ulri b/ulri
index bd677ff..0fc586e 100755
--- a/ulri
+++ b/ulri
@@ -212,9 +212,6 @@ my $failure = "$config->{queue}/failure";
my $done = "$config->{queue}/done";
my $reject = "$config->{queue}/reject";
-# Raise this when the noarch package starts to build on any bot
-my %noarch_build;
-
#
# Part 0: gather data from upload tree
#
@@ -260,7 +257,7 @@ sub todo_func {
if ($arch =~ /noarch/) {
plog('DEBUG', "... and $prefix is noarch");
- $noarch_build{$prefix} = 1;
+ $compildone->{$prefix}{$media}{noarch} = 1;
$arch =~ s/-.*//;
}
@@ -307,7 +304,7 @@ sub done_func {
}
sub exclude_machine {
- my ($host) = @_;
+ my ($config, $host) = @_;
plog('INFO', "Excluding build host $host");
foreach my $arch (keys %{$config->{bot}}) {
delete $config->{bot}{$arch}{$host};
@@ -589,10 +586,8 @@ foreach my $prefix (sort keys %pkg_tree) {
# need to find a bot for each arch
foreach my $arch (@arch_list) {
- # Skip this arch if package is building as noarch
+ # Skip this arch if package is already building as noarch or for this arch
#
- next if $noarch_build{$prefix};
-
next if $compildone->{$prefix}{$media}{noarch};
next if $compildone->{$prefix}{$media}{$arch};
@@ -635,7 +630,7 @@ foreach my $prefix (sort keys %pkg_tree) {
#
# create also the log dir for botcmd.log
if (ssh($remote, "mkdir -p $prefix_dir/log")) {
- exclude_machine($host);
+ exclude_machine($config, $host);
next;
}
my $pkgs;
@@ -647,15 +642,14 @@ foreach my $prefix (sort keys %pkg_tree) {
$pkgs .= " $prefix_dir/$srpm";
}
if (!$ok) {
- exclude_machine($host);
+ exclude_machine($config, $host);
next;
}
# Register that the package is building
$run{bot}{$host}{$bot} = $prefix;
$compildone->{$prefix}{$media}{$arch} = 1;
- # Enable noarch lock after the first bot snarfs the package
- $noarch_build{$prefix} = 1 if $noarch;
+ $compildone->{$prefix}{$media}{noarch} = 1 if $noarch;
# spawn remote build bot and save output on local file
# (remove status.log before building, otherwise we can have