Rearrange decision for should_upgrade_srcarch

This should not change the logic in any way. It should allow adding policy
checks in a future commit.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
ubuntu/rebased
Ivo De Decker 6 years ago
parent d0b5cc2ce1
commit 4cf03bbdc5

@ -1012,25 +1012,27 @@ class Britney(object):
# reverse dependencies. # reverse dependencies.
anyworthdoing = True anyworthdoing = True
if anyworthdoing and same_source and not is_primary_source: if not anyworthdoing:
# nothing worth doing, we don't add an excuse to the list, we just return false
return False
# there is something worth doing
# we assume that this package will be ok, if not invalidated below
excuse.policy_verdict = PolicyVerdict.PASS
if same_source and not is_primary_source:
# support for binNMUs from *pu is currently broken, so disable it # support for binNMUs from *pu is currently broken, so disable it
# for now # for now
# see https://bugs.debian.org/916209 for more info # see https://bugs.debian.org/916209 for more info
excuse.addhtml("Ignoring binaries for %s from %s on %s (see https://bugs.debian.org/916209)" % (src, source_suite.name, arch)) excuse.addhtml("Ignoring binaries for %s from %s on %s (see https://bugs.debian.org/916209)" % (src, source_suite.name, arch))
self.excuses[excuse.name] = excuse excuse.policy_verdict = PolicyVerdict.REJECTED_PERMANENTLY
return False
# if there is nothing wrong and there is something worth doing, this is a valid candidate # if there is something something wrong, reject this package
if not anywrongver and anyworthdoing: if anywrongver:
excuse.policy_verdict = PolicyVerdict.PASS excuse.policy_verdict = PolicyVerdict.REJECTED_PERMANENTLY
self.excuses[excuse.name] = excuse
return True
# else if there is something worth doing (but something wrong, too) this package won't be considered
elif anyworthdoing:
self.excuses[excuse.name] = excuse
# otherwise, return False self.excuses[excuse.name] = excuse
return False return excuse.is_valid
def should_upgrade_src(self, src, source_suite): def should_upgrade_src(self, src, source_suite):
"""Check if source package should be upgraded """Check if source package should be upgraded

Loading…
Cancel
Save