From 97abb6f46742f7988e50296dfa3a958e5580a312 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 26 Jan 2019 17:19:04 +0000 Subject: [PATCH] ExcuseFinder: Reduce the number of migration items created With this change, we reduce the number of migration items creted only to be discarded because the item is not relevant/actionable. Signed-off-by: Niels Thykier --- britney2/excusefinder.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/britney2/excusefinder.py b/britney2/excusefinder.py index 6c444a6..f61840c 100644 --- a/britney2/excusefinder.py +++ b/britney2/excusefinder.py @@ -548,22 +548,25 @@ class ExcuseFinder(object): sources_s = suite.sources item_suffix = "_%s" % suite.excuses_suffix if suite.excuses_suffix else '' for pkg in sources_s: - if sources_s[pkg].is_fakesrc: + src_s_data = sources_s[pkg] + if src_s_data.is_fakesrc: continue - # if the source package is already present in the target suite, - # check if it should be upgraded for every binary package - if pkg in sources_t: + src_t_data = sources_t.get(pkg) + + if src_t_data is None or apt_pkg.version_compare(src_s_data.version, src_t_data.version) != 0: + item = mi_factory.parse_item("%s%s" % (pkg, item_suffix), versioned=False, auto_correct=False) + # check if the source package should be upgraded + if should_upgrade_src(item): + actionable_items_add(item.name) + else: + # package has same version in source and target suite; check if any of the + # binaries have changed on the various architectures for arch in architectures: item = mi_factory.parse_item("%s/%s%s" % (pkg, arch, item_suffix), versioned=False, auto_correct=False) if should_upgrade_srcarch(item): actionable_items_add(item.name) - item = mi_factory.parse_item("%s%s" % (pkg, item_suffix), versioned=False, auto_correct=False) - # check if the source package should be upgraded - if should_upgrade_src(item): - actionable_items_add(item.name) - # process the `remove' hints, if the given package is not yet in actionable_items for hint in self.hints['remove']: src = hint.package