From 9e5158caa8a406cd58a592b5d8bb201bb2bb358c Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sat, 23 Jan 2016 18:33:00 +0000 Subject: Modify one less global variable in the tree callbacks --- ulri | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'ulri') diff --git a/ulri b/ulri index 148479c..120b4b0 100755 --- a/ulri +++ b/ulri @@ -217,10 +217,6 @@ my $reject = "$config->{queue}/reject"; plog('MSG', "check uploads tree"); -# A list of what is currently building so we can report at the end -# -my %build_list; - plog('DEBUG', "input queue is $todo"); sub todo_func { @@ -250,10 +246,6 @@ sub todo_func { $arch = $config->{arch_translation}{$arch} if $config->{arch_translation}{$arch}; plog('DEBUG', "found lock on $host/$arch for $prefix"); - # Only for build status reporting - # - push @{$build_list{"$host/$arch"}}, $prefix; - if ($arch =~ /noarch/) { plog('DEBUG', "... and $prefix is noarch"); $pkg_tree{$prefix}{media}{$media}{arch}{noarch} = 1; @@ -746,9 +738,22 @@ foreach my $prefix (sort keys %pkg_tree) { plog('MSG', "Current status"); +my %build_list; + +foreach my $prefix (keys %pkg_tree) { + my $ent = $pkg_tree{$prefix}; + foreach my $media (keys %{$ent->{media}}) { + foreach my $bot (keys %{$ent->{media}{$media}{bot}}) { + my $host = $bot->{host}; + my $arch = $bot->{arch}; + push @{$build_list{"$host/$arch"}}, $prefix; + } + } +} + if (keys %build_list) { plog('INFO', "currently building:"); - map { plog('INFO', " $_: " . join('', @{$build_list{$_}})) } keys %build_list; + map { plog('INFO', " $_: " . join('', @{$build_list{$_}})) } sort keys %build_list; } plog('INFO', "jobs in queue:", %to_compile ? -- cgit v1.2.1