1 |
From 7d61f22b33ed9e0d69412020c08babd60da51490 Mon Sep 17 00:00:00 2001 |
2 |
From: Pascal Terjan <pterjan@gmail.com> |
3 |
Date: Wed, 5 Oct 2016 20:33:17 +0100 |
4 |
Subject: [PATCH 01/14] Fix wrongly skipped post |
5 |
|
6 |
When doing a secondary upload contaning a noarch it was considered |
7 |
finisher for all arches despite the noarch package not getting uploaded. |
8 |
This means we were not calling some posts (including genhdlist2) on |
9 |
primary arches. |
10 |
--- |
11 |
NEWS | 3 +++ |
12 |
lib/Iurt/Emi.pm | 19 ++++++++++++++----- |
13 |
2 files changed, 17 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/NEWS b/NEWS |
16 |
index b866e30..3d92b62 100644 |
17 |
--- a/NEWS |
18 |
+++ b/NEWS |
19 |
@@ -1,3 +1,6 @@ |
20 |
+- emi: fix a bug where genhdlist2 was skipped when doing a secondary upload |
21 |
+ containing a noarch at the same time as some other uploads |
22 |
+ |
23 |
0.6.26 |
24 |
- ulri: when failing to send a build to a machine do not try sending all the |
25 |
other pending builds there |
26 |
diff --git a/lib/Iurt/Emi.pm b/lib/Iurt/Emi.pm |
27 |
index 1df4f67..b1bc619 100644 |
28 |
--- a/lib/Iurt/Emi.pm |
29 |
+++ b/lib/Iurt/Emi.pm |
30 |
@@ -71,16 +71,25 @@ sub find_prefixes_ready_to_upload { |
31 |
# We already have found universal finisher in that media, we're fine |
32 |
next if exists $targets{$target}{$media}{arch_finisher}{noarch}; |
33 |
|
34 |
- if ($pkg_tree{$prefix}{media}{$media}{arch}{noarch}) { |
35 |
+ my %arches_to_upload = {}; |
36 |
+ foreach (@{$pkg_tree{$prefix}{media}{$media}{rpms}}) { |
37 |
+ next unless /\.([^.]*)\.rpm/; |
38 |
+ my $arch = $1; |
39 |
+ next if $arch eq 'src'; |
40 |
+ # If this is a secondary upload, noarch package will be dropped |
41 |
+ next if ($arch eq 'noarch' && $pkg_tree{$prefix}{media}{$media}{uploaded}); |
42 |
+ $arches_to_upload{$arch} = 1; |
43 |
+ } |
44 |
+ |
45 |
+ if ($arches_to_upload{noarch}) { |
46 |
# This package is noarch, genhdlist for it will touch all archs |
47 |
$targets{$target}{$media}{arch_finisher} = { 'noarch' => $prefix }; |
48 |
} else { |
49 |
- my $has_new_arch = scalar(difference2([ keys %{$pkg_tree{$prefix}{media}{$media}{arch}} ], [ keys %{$targets{$target}{$media}{arch_finisher}} ])); |
50 |
+ my $has_new_arch = scalar(difference2([ keys %arches_to_upload ], [ keys %{$targets{$target}{$media}{arch_finisher}} ])); |
51 |
if ($has_new_arch) { |
52 |
# We need this package to cover the new arch |
53 |
- # Set it for all, it may allow getting rid of some others |
54 |
- foreach (keys %{$pkg_tree{$prefix}{media}{$media}{arch}}) { |
55 |
- # BUG There may be no package to upload for this arch in this prefix if this is a secondary upload |
56 |
+ # Set it for all, it may allow getting rid of some |
57 |
+ foreach (keys %arches_to_upload) { |
58 |
$targets{$target}{$media}{arch_finisher}{$_} = $prefix; |
59 |
} |
60 |
} |
61 |
-- |
62 |
2.10.1 |
63 |
|