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 <niels@thykier.net>
This commit is contained in:
Niels Thykier 2018-12-17 20:55:04 +00:00
parent 82ff8010e2
commit e0c19b3adb
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

View File

@ -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):