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 <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent 78d120114f
commit 97abb6f467
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

@ -548,21 +548,24 @@ class ExcuseFinder(object):
sources_s = suite.sources sources_s = suite.sources
item_suffix = "_%s" % suite.excuses_suffix if suite.excuses_suffix else '' item_suffix = "_%s" % suite.excuses_suffix if suite.excuses_suffix else ''
for pkg in sources_s: for pkg in sources_s:
if sources_s[pkg].is_fakesrc: src_s_data = sources_s[pkg]
if src_s_data.is_fakesrc:
continue continue
# if the source package is already present in the target suite, src_t_data = sources_t.get(pkg)
# check if it should be upgraded for every binary package
if pkg in sources_t:
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)
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) item = mi_factory.parse_item("%s%s" % (pkg, item_suffix), versioned=False, auto_correct=False)
# check if the source package should be upgraded # check if the source package should be upgraded
if should_upgrade_src(item): if should_upgrade_src(item):
actionable_items_add(item.name) 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)
# process the `remove' hints, if the given package is not yet in actionable_items # process the `remove' hints, if the given package is not yet in actionable_items
for hint in self.hints['remove']: for hint in self.hints['remove']:

Loading…
Cancel
Save