diff options
-rw-r--r-- | lib/Iurt/Emi.pm | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm index 9e98125..b0e5597 100644 --- a/lib/Iurt/Emi.pm +++ b/lib/Iurt/Emi.pm @@ -4,6 +4,7 @@ use base qw(Exporter); use File::Path qw(make_path); use Iurt::Config qw(get_author_email get_mandatory_arch); use Iurt::Mail qw(sendmail); +use Iurt::Queue qw(check_if_all_archs_processed); use Iurt::Util qw(plog); use MDK::Common::Func qw(find); use MDK::Common::DataStructure qw(difference2); @@ -174,18 +175,7 @@ sub upload_prefix_in_media { unlink(@packages, @duplicate_packages); # unlink the sources rpm unless some non mandatory arch still need to be done - my $all_done = 1; - if (!defined($pkg_tree->{$prefix}{media}{$media}{arch}{noarch})) { - 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}}; - # If we are here, mandatory arches are done, no need to check them - my $mandatory_arch = get_mandatory_arch($config, $target); - foreach my $arch (difference2(\@arch_list, $mandatory_arch)) { - next if $pkg_tree->{$prefix}{media}{$media}{done_arch}{$arch}; - $all_done = 0; - } - } - if ($all_done) { + if (check_if_all_archs_processed($media, $prefix, $pkg_tree->{$prefix}, $config)) { foreach (@{$pkg_tree->{$prefix}{srpms}}) { plog('DEBUG', "unlink $todo$path/${prefix}_$_"); unlink("$todo$path/${prefix}_$_"); |