From e0c19b3adb3faa5200881d37e094f48dc0939f23 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Mon, 17 Dec 2018 20:55:04 +0000 Subject: [PATCH] Inline a call to _compute_groups The should_upgrade_srcarch method only needs _compute_groups for the purpose of computing smooth update candidates. In the concrete case, it is rather simple to inline that part directly (and fold away irrelevant code). This also enables us to rewrite _compute_groups to accept an migration item as all remaining callers simply unfold the migration item into the arguments required by _compute_groups. This change will come in a future commit. Signed-off-by: Niels Thykier --- britney.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/britney.py b/britney.py index fe9a9a8..a893404 100755 --- a/britney.py +++ b/britney.py @@ -980,10 +980,16 @@ class Britney(object): if not same_source or is_primary_source: smoothbins = set() if is_primary_source: - _, _, smoothbins = self._compute_groups(src, - primary_source_suite, - arch, - False) + binaries_t = target_suite.binaries + possible_smooth_updates = [p for p in source_u.binaries if p.architecture == arch] + smoothbins = find_smooth_updateable_binaries(possible_smooth_updates, + source_suite.sources[src], + self.pkg_universe, + target_suite, + binaries_t, + source_suite.binaries, + frozenset(), + self.options.smooth_updates) # for every binary package produced by this source in testing for this architecture for pkg_id in sorted(x for x in source_t.binaries if x.architecture == arch):