aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Iurt')
-rw-r--r--lib/Iurt/Emi.pm19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm
index 1df4f67..b1bc619 100644
--- a/lib/Iurt/Emi.pm
+++ b/lib/Iurt/Emi.pm
@@ -71,16 +71,25 @@ sub find_prefixes_ready_to_upload {
# We already have found universal finisher in that media, we're fine
next if exists $targets{$target}{$media}{arch_finisher}{noarch};
- if ($pkg_tree{$prefix}{media}{$media}{arch}{noarch}) {
+ my %arches_to_upload = {};
+ foreach (@{$pkg_tree{$prefix}{media}{$media}{rpms}}) {
+ next unless /\.([^.]*)\.rpm/;
+ my $arch = $1;
+ next if $arch eq 'src';
+ # If this is a secondary upload, noarch package will be dropped
+ next if ($arch eq 'noarch' && $pkg_tree{$prefix}{media}{$media}{uploaded});
+ $arches_to_upload{$arch} = 1;
+ }
+
+ if ($arches_to_upload{noarch}) {
# This package is noarch, genhdlist for it will touch all archs
$targets{$target}{$media}{arch_finisher} = { 'noarch' => $prefix };
} else {
- my $has_new_arch = scalar(difference2([ keys %{$pkg_tree{$prefix}{media}{$media}{arch}} ], [ keys %{$targets{$target}{$media}{arch_finisher}} ]));
+ my $has_new_arch = scalar(difference2([ keys %arches_to_upload ], [ keys %{$targets{$target}{$media}{arch_finisher}} ]));
if ($has_new_arch) {
# We need this package to cover the new arch
- # Set it for all, it may allow getting rid of some others
- foreach (keys %{$pkg_tree{$prefix}{media}{$media}{arch}}) {
- # BUG There may be no package to upload for this arch in this prefix if this is a secondary upload
+ # Set it for all, it may allow getting rid of some
+ foreach (keys %arches_to_upload) {
$targets{$target}{$media}{arch_finisher}{$_} = $prefix;
}
}