From 29c66cc18db43a5f11ca0115459f7556429275bc Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 15 Feb 2016 19:48:32 +0000 Subject: Move something invariant out of a loop --- ulri | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'ulri') diff --git a/ulri b/ulri index 5cd8f1e..a6ca138 100755 --- a/ulri +++ b/ulri @@ -484,6 +484,11 @@ foreach my $prefix (sort keys %pkg_tree) { # count noarch todos only once even if searching multiple bots my $noarch_countflag = 0; + # If all packages in a group are noarch, consider the entire group + # as noarch + my $noarch = 1; + $noarch = 0 if any { !check_noarch("$todo_dir/${prefix}_$_") } @$srpms; + my $arch_list = find { ref($_) eq 'ARRAY' } $config->{arch}, (ref($config->{arch}) eq 'HASH' ? ($config->{arch}{$target}, $config->{arch}{default}) : ()); my @arch_list = $arch_list ? @$arch_list : keys %{$config->{bot}}; # need to find a bot for each arch @@ -494,14 +499,6 @@ foreach my $prefix (sort keys %pkg_tree) { next if $pkg_tree{$prefix}{media}{$media}{arch}{$arch}; next if $pkg_tree{$prefix}{media}{$media}{excluded_arch}{$arch}; - # If all packages in a group are noarch, consider the entire group - # as noarch - # - my $noarch = 1; - $noarch = 0 if any { !check_noarch("$todo_dir/${prefix}_$_") } @$srpms; - - #plog("@$srpms is noarch") if $noarch; - my $excluded = any { !check_arch("$todo_dir/${prefix}_$_", $arch) } @$srpms; if ($excluded) { plog('WARN', "excluding from $arch: $excluded"); -- cgit v1.2.1