From 82fad57aa996cc8e4aacfe5995ee242602283299 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 6 Oct 2021 12:54:11 -0700 Subject: [PATCH] Don't use expensive 'remove' hints Since we've never used remove hints in Ubuntu and never will, we shouldn't pay the cost for them in britney runs. Remove references to them entirely, to speed up britney runs. This is an Ubuntu delta not expected to be upstreamed, and can be dropped at some future point when we don't have 11,000 active hints. (This count of hints is expected to drop dramatically once we have autopkgtest baseline retesting.) --- britney2/excusefinder.py | 13 ------------- britney2/policies/policy.py | 5 ----- 2 files changed, 18 deletions(-) diff --git a/britney2/excusefinder.py b/britney2/excusefinder.py index 2b2b2ec..0395303 100644 --- a/britney2/excusefinder.py +++ b/britney2/excusefinder.py @@ -237,19 +237,6 @@ class ExcuseFinder(object): # nothing worth doing, we don't add an excuse to the list, we just return false return False - # if there is a `remove' hint and the requested version is the same as the - # version in testing, then stop here and return False - # (as a side effect, a removal may generate such excuses for both the source - # package and its binary packages on each architecture) - for hint in self.hints.search('remove', package=src, version=source_t.version): - excuse = Excuse(item) - excuse.add_hint(hint) - excuse.policy_verdict = PolicyVerdict.REJECTED_PERMANENTLY - excuse.add_verdict_info(excuse.policy_verdict, "Removal request by %s" % (hint.user)) - excuse.add_verdict_info(excuse.policy_verdict, "Trying to remove package, not update it") - self.excuses[excuse.name] = excuse - return False - # there is something worth doing # we assume that this package will be ok, if not invalidated below excuse.policy_verdict = PolicyVerdict.PASS diff --git a/britney2/policies/policy.py b/britney2/policies/policy.py index 226ff50..a30f06d 100644 --- a/britney2/policies/policy.py +++ b/britney2/policies/policy.py @@ -1523,11 +1523,6 @@ class ImplicitDependencyPolicy(BasePolicy): # source for pkg not in unstable: candidate for removal return True - source_t = target_suite.sources[src] - for hint in self.hints.search('remove', package=src, version=source_t.version): - # removal hint for the source in testing: candidate for removal - return True - if target_suite.is_cruft(pkg): # if pkg is cruft in testing, removal will be tried return True