diff options
-rwxr-xr-x | emi | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -253,7 +253,7 @@ sub upload_prefix_in_section { my $path = $pkg_tree{$prefix}{section}{$section}{path}; - plog('OK', "all archs done: $prefix"); + plog('OK', "all mandatory archs done: $prefix"); foreach my $rpm (@{$pkg_tree{$prefix}{section}{$section}{rpms}}) { push @packages, "$done/$path/${prefix}_$rpm"; plog('OK', " uploading $rpm in $done/$path"); @@ -293,14 +293,24 @@ sub upload_prefix_in_section { # delete the files which should have heen either put in queue or rejected unlink(@packages); - # keep the log file for debugging - # unlink("$done/$path/$prefix.youri"); - - # unlink the sources rpm, other arch will be able to grab it into - # the repository - foreach (@{$pkg_tree{$prefix}{todo}}) { - plog('DEBUG', "unlink $todo/$path/${prefix}_$_"); - unlink("$todo/$path/${prefix}_$_"); + # unlink the sources rpm unless some non mandatory arch still need to be done + my $all_done = 1; + if (!defined($pkg_tree{$prefix}{section}{$section}{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 = find { ref($_) eq 'ARRAY' } $config->{mandatory_arch}, + (ref($config->{mandatory_arch}) eq 'HASH' ? ($config->{mandatory_arch}{$target}, $config->{mandatory_arch}{default}) : ()), []; + foreach my $arch (difference2(@arch_list, $mandatory_arch)) { + next if $pkg_tree{$prefix}{section}{$section}{arch}{$arch}; + $all_done = 0; + } + } + if ($all_done) { + foreach (@{$pkg_tree{$prefix}{todo}}) { + plog('DEBUG', "unlink $todo/$path/${prefix}_$_"); + unlink("$todo/$path/${prefix}_$_"); + } } } |