From d9f9c6d4a9c02f8b88464ea215ffc06e32478046 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 26 Jan 2019 15:06:06 +0000 Subject: [PATCH] Let ExcuseFinder create migration items Signed-off-by: Niels Thykier --- britney.py | 6 +++--- britney2/excusefinder.py | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/britney.py b/britney.py index 37c5089..6421653 100755 --- a/britney.py +++ b/britney.py @@ -741,15 +741,15 @@ class Britney(object): self.logger.info("Update Excuses generation started") + mi_factory = self._migration_item_factory excusefinder = ExcuseFinder(self.options, self.suite_info, self.all_binaries, - self.pkg_universe, self._policy_engine, self.hints) + self.pkg_universe, self._policy_engine, mi_factory, self.hints) excuses, upgrade_me = excusefinder.find_actionable_excuses() self.excuses = excuses # sort the list of candidates - mi_factory = self._migration_item_factory - self.upgrade_me = sorted(mi_factory.parse_item(x, versioned=False, auto_correct=False) for x in upgrade_me) + self.upgrade_me = sorted(upgrade_me) self.upgrade_me.extend(old_libraries(mi_factory, self.suite_info, self.options.outofsync_arches)) # write excuses to the output file diff --git a/britney2/excusefinder.py b/britney2/excusefinder.py index 8b46d10..2b6eb9d 100644 --- a/britney2/excusefinder.py +++ b/britney2/excusefinder.py @@ -12,12 +12,13 @@ from britney2.utils import (invalidate_excuses, find_smooth_updateable_binaries, class ExcuseFinder(object): - def __init__(self, options, suite_info, all_binaries, pkg_universe, policy_engine, hints): + def __init__(self, options, suite_info, all_binaries, pkg_universe, policy_engine, mi_factory, hints): self.options = options self.suite_info = suite_info self.all_binaries = all_binaries self.pkg_universe = pkg_universe self._policy_engine = policy_engine + self._migration_item_factory = mi_factory self.hints = hints self.excuses = {} @@ -653,4 +654,7 @@ class ExcuseFinder(object): e.addreason(deptype.get_reason()) invalidate_excuses(excuses, actionable_items, unconsidered) + + mi_factory = self._migration_item_factory + actionable_items = {mi_factory.parse_item(x, versioned=False, auto_correct=False) for x in actionable_items} return excuses, actionable_items