From 7d61f22b33ed9e0d69412020c08babd60da51490 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 5 Oct 2016 20:33:17 +0100 Subject: Fix wrongly skipped post When doing a secondary upload contaning a noarch it was considered finisher for all arches despite the noarch package not getting uploaded. This means we were not calling some posts (including genhdlist2) on primary arches. --- lib/Iurt/Emi.pm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lib/Iurt') 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; } } -- cgit v1.2.1