mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-24 11:51:13 +00:00
MigrationManager: Precompute a set of all architectures
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
89fcccba13
commit
d3b391aed1
@ -43,6 +43,7 @@ class MigrationManager(object):
|
|||||||
self.pkg_universe = pkg_universe
|
self.pkg_universe = pkg_universe
|
||||||
self.constraints = constraints
|
self.constraints = constraints
|
||||||
self._transactions = []
|
self._transactions = []
|
||||||
|
self._all_architectures = frozenset(self.options.architectures)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_transaction(self):
|
def current_transaction(self):
|
||||||
@ -343,18 +344,18 @@ class MigrationManager(object):
|
|||||||
return (affected_direct, affected_all)
|
return (affected_direct, affected_all)
|
||||||
|
|
||||||
def _apply_multiple_items_to_target_suite(self, items):
|
def _apply_multiple_items_to_target_suite(self, items):
|
||||||
affected_architectures = set()
|
|
||||||
is_source_migration = False
|
is_source_migration = False
|
||||||
if len(items) == 1:
|
if len(items) == 1:
|
||||||
item = items[0]
|
item = items[0]
|
||||||
# apply the changes
|
# apply the changes
|
||||||
affected_direct, affected_all = self._apply_item_to_target_suite(item)
|
affected_direct, affected_all = self._apply_item_to_target_suite(item)
|
||||||
if item.architecture == 'source':
|
if item.architecture == 'source':
|
||||||
affected_architectures = set(self.options.architectures)
|
affected_architectures = self._all_architectures
|
||||||
is_source_migration = True
|
is_source_migration = True
|
||||||
else:
|
else:
|
||||||
affected_architectures.add(item.architecture)
|
affected_architectures = {item.architecture}
|
||||||
else:
|
else:
|
||||||
|
affected_architectures = set()
|
||||||
removals = set()
|
removals = set()
|
||||||
affected_direct = set()
|
affected_direct = set()
|
||||||
affected_all = set()
|
affected_all = set()
|
||||||
@ -364,7 +365,7 @@ class MigrationManager(object):
|
|||||||
affected_architectures.add(item.architecture)
|
affected_architectures.add(item.architecture)
|
||||||
|
|
||||||
if 'source' in affected_architectures:
|
if 'source' in affected_architectures:
|
||||||
affected_architectures = set(self.options.architectures)
|
affected_architectures = self._all_architectures
|
||||||
is_source_migration = True
|
is_source_migration = True
|
||||||
|
|
||||||
for item in items:
|
for item in items:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user