diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | lib/Iurt/Emi.pm | 19 |
2 files changed, 17 insertions, 5 deletions
@@ -1,3 +1,6 @@ +- emi: fix a bug where genhdlist2 was skipped when doing a secondary upload + containing a noarch at the same time as some other uploads + 0.6.26 - ulri: when failing to send a build to a machine do not try sending all the other pending builds there 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; } } |