mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-16 21:11:37 +00:00
MigrationManager: Create a is_nuninst_worse
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
aa6dd4a0f3
commit
89fcccba13
@ -24,6 +24,16 @@ def compute_eqv_set(pkg_universe, updates, rms):
|
|||||||
return eqv_set
|
return eqv_set
|
||||||
|
|
||||||
|
|
||||||
|
def is_nuninst_worse(must_be_installable, nuninst_now_arch, nuninst_after_arch):
|
||||||
|
if len(nuninst_after_arch) > len(nuninst_now_arch):
|
||||||
|
return True
|
||||||
|
|
||||||
|
regression = nuninst_after_arch - nuninst_now_arch
|
||||||
|
if not regression.isdisjoint(must_be_installable):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
class MigrationManager(object):
|
class MigrationManager(object):
|
||||||
|
|
||||||
def __init__(self, options, suite_info, all_binaries, pkg_universe, constraints):
|
def __init__(self, options, suite_info, all_binaries, pkg_universe, constraints):
|
||||||
@ -406,13 +416,8 @@ class MigrationManager(object):
|
|||||||
|
|
||||||
# if the uninstallability counter is worse than before, break the loop
|
# if the uninstallability counter is worse than before, break the loop
|
||||||
if stop_on_first_regression:
|
if stop_on_first_regression:
|
||||||
worse = False
|
worse = is_nuninst_worse(must_be_installable, nuninst_now[arch], nuninst_after[arch])
|
||||||
if len(nuninst_after[arch]) > len(nuninst_now[arch]):
|
|
||||||
worse = True
|
|
||||||
else:
|
|
||||||
regression = nuninst_after[arch] - nuninst_now[arch]
|
|
||||||
if not regression.isdisjoint(must_be_installable):
|
|
||||||
worse = True
|
|
||||||
# ... except for a few special cases
|
# ... except for a few special cases
|
||||||
if worse and ((not is_source_migration and arch not in new_arches) or
|
if worse and ((not is_source_migration and arch not in new_arches) or
|
||||||
(arch not in break_arches)):
|
(arch not in break_arches)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user