mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-12 20:01:08 +00:00
split off is_smooth_update_allowed() function
This commit is contained in:
parent
4e49ce9d70
commit
2d34f8220e
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user