diff --git a/britney2/policies/policy.py b/britney2/policies/policy.py index f982ce7..5c1b3cd 100644 --- a/britney2/policies/policy.py +++ b/britney2/policies/policy.py @@ -13,7 +13,7 @@ from britney2 import SuiteClass, PackageId from britney2.hints import Hint, split_into_one_hint_per_package from britney2.inputs.suiteloader import SuiteContentLoader from britney2.policies import PolicyVerdict, ApplySrcPolicy -from britney2.utils import get_dependency_solvers, find_newer_binaries +from britney2.utils import get_dependency_solvers, find_newer_binaries, is_smooth_update_allowed from britney2 import DependencyType from britney2.excusedeps import DependencySpec @@ -1691,9 +1691,8 @@ class ImplicitDependencyPolicy(BasePolicy): else: pkg_id_s = None - if not pkg_id_s and ( - 'ALL' in self._smooth_updates or - binaries_t_a[mypkg].section in self._smooth_updates): + if not pkg_id_s and \ + is_smooth_update_allowed(binaries_t_a[mypkg], self._smooth_updates): # the binary isn't in the new version (or is cruft there), and # smooth updates are allowed: the binary can stay around if # that is necessary to satisfy dependencies, so we don't need diff --git a/britney2/utils.py b/britney2/utils.py index 4cf0ce2..5be0e5f 100644 --- a/britney2/utils.py +++ b/britney2/utils.py @@ -761,6 +761,14 @@ def compile_nuninst(target_suite, architectures, nobreakall_arches): return nuninst +def is_smooth_update_allowed(binary, smooth_updates): + if 'ALL' in smooth_updates: + return True + if binary.section in smooth_updates: + return True + return False + + def find_smooth_updateable_binaries(binaries_to_check, source_data, pkg_universe, @@ -784,7 +792,7 @@ def find_smooth_updateable_binaries(binaries_to_check, cruftbins.add(binaries_s[parch][binary].pkg_id) # Maybe a candidate (cruft or removed binary): check if config allows us to smooth update it. - if 'ALL' in smooth_updates or binaries_t[parch][binary].section in smooth_updates: + if is_smooth_update_allowed(binaries_t[parch][binary], smooth_updates): # if the package has reverse-dependencies which are # built from other sources, it's a valid candidate for # a smooth update. if not, it may still be a valid