diff options
author | Pascal Terjan <pterjan@gmail.com> | 2016-10-05 20:33:17 +0100 |
---|---|---|
committer | Pascal Terjan <pterjan@gmail.com> | 2016-10-05 20:33:17 +0100 |
commit | 7d61f22b33ed9e0d69412020c08babd60da51490 (patch) | |
tree | 7f37b744834f8326e42d0a2c947027fb5c2877a3 /lib/Iurt | |
parent | 6bbc19756488738dc851604986afde258e38cb05 (diff) | |
download | iurt-7d61f22b33ed9e0d69412020c08babd60da51490.tar iurt-7d61f22b33ed9e0d69412020c08babd60da51490.tar.gz iurt-7d61f22b33ed9e0d69412020c08babd60da51490.tar.bz2 iurt-7d61f22b33ed9e0d69412020c08babd60da51490.tar.xz iurt-7d61f22b33ed9e0d69412020c08babd60da51490.zip |
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.
Diffstat (limited to 'lib/Iurt')
-rw-r--r-- | lib/Iurt/Emi.pm | 19 |
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; } } |