@ -1979,8 +1979,7 @@ class Britney(object):
"""
undo = { ' binaries ' : { } , ' sources ' : { } , ' virtual ' : { } , ' nvirtual ' : [ ] }
affected_pos = set ( )
affected_remain = set ( )
affected_direct = set ( )
# local copies for better performance
source_suite = item . suite
@ -2039,8 +2038,8 @@ class Britney(object):
if pkey not in eqv_set :
# all the reverse dependencies are affected by
# the change
affected_ pos . update ( inst_tester . reverse_dependencies_of ( rm_pkg_id ) )
affected_ remain . update ( inst_tester . negative_dependencies_of ( rm_pkg_id ) )
affected_ direct . update ( inst_tester . reverse_dependencies_of ( rm_pkg_id ) )
affected_ direct . update ( inst_tester . negative_dependencies_of ( rm_pkg_id ) )
# remove the provided virtual packages
for provided_pkg , prov_version , _ in pkg_data . provides :
@ -2066,7 +2065,7 @@ class Britney(object):
# obviously, added/modified packages are affected
if not equivalent_replacement :
affected_ pos . add ( updated_pkg_id )
affected_ direct . add ( updated_pkg_id )
# if the binary already exists in testing, it is currently
# built by another source package. we therefore remove the
# version built by the other source package, after marking
@ -2078,8 +2077,7 @@ class Britney(object):
undo [ ' binaries ' ] [ key ] = old_pkg_id
if not equivalent_replacement :
# all the reverse conflicts
affected_pos . update ( inst_tester . reverse_dependencies_of ( old_pkg_id ) )
affected_remain . update ( inst_tester . negative_dependencies_of ( old_pkg_id ) )
affected_direct . update ( inst_tester . reverse_dependencies_of ( old_pkg_id ) )
inst_tester . remove_testing_binary ( old_pkg_id )
elif hint_undo :
# the binary isn't in testing, but it may have been at
@ -2095,7 +2093,7 @@ class Britney(object):
for ( tundo , tpkg ) in hint_undo :
if key in tundo [ ' binaries ' ] :
tpkg_id = tundo [ ' binaries ' ] [ key ]
affected_ pos . update ( inst_tester . reverse_dependencies_of ( tpkg_id ) )
affected_ direct . update ( inst_tester . reverse_dependencies_of ( tpkg_id ) )
# add/update the binary package from the source suite
new_pkg_data = packages_s [ parch ] [ 0 ] [ binary ]
@ -2112,14 +2110,14 @@ class Britney(object):
provides_t_a [ provided_pkg ] . add ( ( binary , prov_version ) )
if not equivalent_replacement :
# all the reverse dependencies are affected by the change
affected_ pos . add ( updated_pkg_id )
affected_ remain . update ( inst_tester . negative_dependencies_of ( updated_pkg_id ) )
affected_ direct . add ( updated_pkg_id )
affected_ direct . update ( inst_tester . negative_dependencies_of ( updated_pkg_id ) )
# Also include the transitive rdeps of the packages found so far
compute_reverse_tree( inst_tester , affected_pos )
compute_reverse_tree ( inst_tester , affected_ remain )
affected_all = affected_direct . copy ( )
compute_reverse_tree ( inst_tester , affected_ all )
# return the package name, the suite, the list of affected packages and the undo dictionary
return ( affected_ pos, affected_remain , undo )
return ( affected_ direct, affected_all , undo )
def try_migration ( self , actions , nuninst_now , lundo = None , automatic_revert = True ) :
is_accepted = True
@ -2136,7 +2134,7 @@ class Britney(object):
if len ( actions ) == 1 :
item = actions [ 0 ]
# apply the changes
affected_ pos, affected_remain , undo = self . doop_source ( item , hint_undo = lundo )
affected_ direct, affected_all , undo = self . doop_source ( item , hint_undo = lundo )
undo_list = [ ( undo , item ) ]
if item . architecture == ' source ' :
affected_architectures = set ( self . options . architectures )
@ -2145,8 +2143,8 @@ class Britney(object):
else :
undo_list = [ ]
removals = set ( )
affected_ pos = set ( )
affected_ remain = set ( )
affected_ direct = set ( )
affected_ all = set ( )
for item in actions :
_ , rms , _ = self . _compute_groups ( item . package , item . suite ,
item . architecture ,
@ -2159,11 +2157,11 @@ class Britney(object):
affected_architectures = set ( self . options . architectures )
for item in actions :
item_affected_ pos, item_affected_remain , undo = self . doop_source ( item ,
item_affected_ direct, item_affected_all , undo = self . doop_source ( item ,
hint_undo = lundo ,
removals = removals )
affected_ pos. update ( item_affected_pos )
affected_ remain. update ( item_affected_remain )
affected_ direct. update ( item_affected_direct )
affected_ all. update ( item_affected_all )
undo_list . append ( ( undo , item ) )
# Optimise the test if we may revert directly.
@ -2171,10 +2169,9 @@ class Britney(object):
# accept the outcome of this migration and expect nuninst to be updated.
# (e.g. "force-hint" or "hint")
if automatic_revert :
affected_ remain - = affected_pos
affected_ all - = affected_direct
else :
affected_remain | = affected_pos
affected_pos = set ( )
affected_direct = set ( )
# Copy nuninst_comp - we have to deep clone affected
# architectures.
@ -2190,7 +2187,7 @@ class Britney(object):
for arch in affected_architectures :
check_archall = arch in nobreakall_arches
check_installability ( self . _inst_tester , packages_t , arch , affected_ pos, affected_remain ,
check_installability ( self . _inst_tester , packages_t , arch , affected_ direct, affected_all ,
check_archall , nuninst_after )
# if the uninstallability counter is worse than before, break the loop