mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-29 03:11:33 +00:00
britney: Take more care with hijacked binaries
This updates the doop_source and _compute_groups functions so that binary packages that are built from a different source aren't included as part of an update to the original source. In the event that it's a binary-only update, also don't remove the hijacked packages from testing. This change also removes an obsolete comment regardarding pre-conditions for the _compute_groups function.
This commit is contained in:
parent
d911314c2d
commit
c7fbe91b2a
39
britney.py
39
britney.py
@ -1866,11 +1866,6 @@ class Britney(object):
|
|||||||
InstallabilityTester.
|
InstallabilityTester.
|
||||||
|
|
||||||
|
|
||||||
Pre-Conditions: The source package must be in testing and this
|
|
||||||
should only be used when considering to do an upgrade
|
|
||||||
migration from the input suite. (e.g. do not use this for
|
|
||||||
removals).
|
|
||||||
|
|
||||||
Unlike doop_source, this will not modify any data structure.
|
Unlike doop_source, this will not modify any data structure.
|
||||||
"""
|
"""
|
||||||
# local copies for better performances
|
# local copies for better performances
|
||||||
@ -1988,11 +1983,24 @@ class Britney(object):
|
|||||||
if migration_architecture not in ['source', parch]:
|
if migration_architecture not in ['source', parch]:
|
||||||
continue
|
continue
|
||||||
version = self.binaries[suite][parch][0][binary][VERSION]
|
version = self.binaries[suite][parch][0][binary][VERSION]
|
||||||
|
|
||||||
|
if (not include_hijacked
|
||||||
|
and self.binaries[suite][parch][0][binary][SOURCE] != source_name):
|
||||||
|
# This binary package has been hijacked by some other source.
|
||||||
|
# So don't add it as part of this update.
|
||||||
|
#
|
||||||
|
# Also, if this isn't a source update, don't remove
|
||||||
|
# the package that's been hijacked if it's present.
|
||||||
|
if migration_architecture != 'source':
|
||||||
|
for rm_b, rm_v, rm_p in list(rms):
|
||||||
|
if (rm_b, rm_p) == (binary, parch):
|
||||||
|
rms.remove((rm_b, rm_v, rm_p))
|
||||||
|
continue
|
||||||
|
|
||||||
adds.add((binary, version, parch))
|
adds.add((binary, version, parch))
|
||||||
|
|
||||||
return (adds, rms, set(smoothbins.values()))
|
return (adds, rms, set(smoothbins.values()))
|
||||||
|
|
||||||
|
|
||||||
def doop_source(self, item, hint_undo=None, removals=frozenset()):
|
def doop_source(self, item, hint_undo=None, removals=frozenset()):
|
||||||
"""Apply a change to the testing distribution as requested by `pkg`
|
"""Apply a change to the testing distribution as requested by `pkg`
|
||||||
|
|
||||||
@ -2023,16 +2031,19 @@ class Britney(object):
|
|||||||
inst_tester = self._inst_tester
|
inst_tester = self._inst_tester
|
||||||
eqv_set = set()
|
eqv_set = set()
|
||||||
|
|
||||||
# remove all binary packages (if the source already exists)
|
|
||||||
if item.architecture == 'source' or not item.is_removal:
|
|
||||||
if item.package in sources['testing']:
|
|
||||||
source = sources['testing'][item.package]
|
|
||||||
|
|
||||||
updates, rms, _ = self._compute_groups(item.package,
|
updates, rms, _ = self._compute_groups(item.package,
|
||||||
item.suite,
|
item.suite,
|
||||||
item.architecture,
|
item.architecture,
|
||||||
item.is_removal,
|
item.is_removal,
|
||||||
removals=removals)
|
removals=removals)
|
||||||
|
#print("+++ %s" % (sorted(updates)))
|
||||||
|
#print("--- %s" % (sorted(rms)))
|
||||||
|
|
||||||
|
# remove all binary packages (if the source already exists)
|
||||||
|
if item.architecture == 'source' or not item.is_removal:
|
||||||
|
if item.package in sources['testing']:
|
||||||
|
source = sources['testing'][item.package]
|
||||||
|
|
||||||
|
|
||||||
eqv_table = {}
|
eqv_table = {}
|
||||||
|
|
||||||
@ -2098,9 +2109,9 @@ class Britney(object):
|
|||||||
if not item.is_removal:
|
if not item.is_removal:
|
||||||
source = sources[item.suite][item.package]
|
source = sources[item.suite][item.package]
|
||||||
packages_s = self.binaries[item.suite]
|
packages_s = self.binaries[item.suite]
|
||||||
for p in source[BINARIES]:
|
|
||||||
binary, parch = p.split("/")
|
for binary, version, parch in updates:
|
||||||
if item.architecture not in ['source', parch]: continue
|
p = "%s/%s" % (binary, parch)
|
||||||
key = (binary, parch)
|
key = (binary, parch)
|
||||||
binaries_t_a, provides_t_a = packages_t[parch]
|
binaries_t_a, provides_t_a = packages_t[parch]
|
||||||
equivalent_replacement = key in eqv_set
|
equivalent_replacement = key in eqv_set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user