mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-01 12:51:43 +00:00
Make write_excuses suite agnostic
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
9a7394c89d
commit
382ced2a68
26
britney.py
26
britney.py
@ -1592,14 +1592,14 @@ class Britney(object):
|
|||||||
self.logger.info("Update Excuses generation started")
|
self.logger.info("Update Excuses generation started")
|
||||||
|
|
||||||
# list of local methods and variables (for better performance)
|
# list of local methods and variables (for better performance)
|
||||||
sources = self.sources
|
suite_info = self.suite_info
|
||||||
architectures = self.options.architectures
|
architectures = self.options.architectures
|
||||||
should_remove_source = self.should_remove_source
|
should_remove_source = self.should_remove_source
|
||||||
should_upgrade_srcarch = self.should_upgrade_srcarch
|
should_upgrade_srcarch = self.should_upgrade_srcarch
|
||||||
should_upgrade_src = self.should_upgrade_src
|
should_upgrade_src = self.should_upgrade_src
|
||||||
|
|
||||||
unstable = sources['unstable']
|
sources_s = suite_info.primary_source_suite.sources
|
||||||
testing = sources['testing']
|
sources_t = suite_info.target_suite.sources
|
||||||
|
|
||||||
# this list will contain the packages which are valid candidates;
|
# this list will contain the packages which are valid candidates;
|
||||||
# if a package is going to be removed, it will have a "-" prefix
|
# if a package is going to be removed, it will have a "-" prefix
|
||||||
@ -1609,16 +1609,17 @@ class Britney(object):
|
|||||||
excuses = self.excuses = {}
|
excuses = self.excuses = {}
|
||||||
|
|
||||||
# for every source package in testing, check if it should be removed
|
# for every source package in testing, check if it should be removed
|
||||||
for pkg in testing:
|
for pkg in sources_t:
|
||||||
if should_remove_source(pkg):
|
if should_remove_source(pkg):
|
||||||
upgrade_me_add("-" + pkg)
|
upgrade_me_add("-" + pkg)
|
||||||
|
|
||||||
# for every source package in unstable check if it should be upgraded
|
# for every source package in unstable check if it should be upgraded
|
||||||
for pkg in unstable:
|
for pkg in sources_s:
|
||||||
if unstable[pkg].is_fakesrc: continue
|
if sources_s[pkg].is_fakesrc:
|
||||||
|
continue
|
||||||
# if the source package is already present in testing,
|
# if the source package is already present in testing,
|
||||||
# check if it should be upgraded for every binary package
|
# check if it should be upgraded for every binary package
|
||||||
if pkg in testing and not testing[pkg].is_fakesrc:
|
if pkg in sources_t and not sources_t[pkg].is_fakesrc:
|
||||||
for arch in architectures:
|
for arch in architectures:
|
||||||
if should_upgrade_srcarch(pkg, arch, 'unstable'):
|
if should_upgrade_srcarch(pkg, arch, 'unstable'):
|
||||||
upgrade_me_add("%s/%s" % (pkg, arch))
|
upgrade_me_add("%s/%s" % (pkg, arch))
|
||||||
@ -1629,10 +1630,10 @@ class Britney(object):
|
|||||||
|
|
||||||
# for every source package in the additional source suites, check if it should be upgraded
|
# for every source package in the additional source suites, check if it should be upgraded
|
||||||
for suite in self.suite_info.additional_source_suites:
|
for suite in self.suite_info.additional_source_suites:
|
||||||
for pkg in sources[suite.name]:
|
for pkg in suite.sources:
|
||||||
# if the source package is already present in testing,
|
# if the source package is already present in testing,
|
||||||
# check if it should be upgraded for every binary package
|
# check if it should be upgraded for every binary package
|
||||||
if pkg in testing:
|
if pkg in sources_t:
|
||||||
for arch in architectures:
|
for arch in architectures:
|
||||||
if should_upgrade_srcarch(pkg, arch, suite.name):
|
if should_upgrade_srcarch(pkg, arch, suite.name):
|
||||||
upgrade_me_add("%s/%s_%s" % (pkg, arch, suite.name))
|
upgrade_me_add("%s/%s_%s" % (pkg, arch, suite.name))
|
||||||
@ -1646,10 +1647,11 @@ class Britney(object):
|
|||||||
src = hint.package
|
src = hint.package
|
||||||
if src in upgrade_me: continue
|
if src in upgrade_me: continue
|
||||||
if ("-"+src) in upgrade_me: continue
|
if ("-"+src) in upgrade_me: continue
|
||||||
if src not in testing: continue
|
if src not in sources_t:
|
||||||
|
continue
|
||||||
|
|
||||||
# check if the version specified in the hint is the same as the considered package
|
# check if the version specified in the hint is the same as the considered package
|
||||||
tsrcv = testing[src].version
|
tsrcv = sources_t[src].version
|
||||||
if tsrcv != hint.version:
|
if tsrcv != hint.version:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -1705,7 +1707,7 @@ class Britney(object):
|
|||||||
invalidate_excuses(excuses, upgrade_me, unconsidered)
|
invalidate_excuses(excuses, upgrade_me, unconsidered)
|
||||||
|
|
||||||
# sort the list of candidates
|
# sort the list of candidates
|
||||||
self.upgrade_me = sorted( make_migrationitem(x, self.sources) for x in upgrade_me )
|
self.upgrade_me = sorted(make_migrationitem(x, suite_info) for x in upgrade_me)
|
||||||
|
|
||||||
# write excuses to the output file
|
# write excuses to the output file
|
||||||
if not self.options.dry_run:
|
if not self.options.dry_run:
|
||||||
|
@ -348,7 +348,7 @@ def write_heidi_delta(filename, all_selected):
|
|||||||
item.version, item.architecture))
|
item.version, item.architecture))
|
||||||
|
|
||||||
|
|
||||||
def make_migrationitem(package, sources):
|
def make_migrationitem(package, suite_info):
|
||||||
"""Convert a textual package specification to a MigrationItem
|
"""Convert a textual package specification to a MigrationItem
|
||||||
|
|
||||||
sources is a list of source packages in each suite, used to determine
|
sources is a list of source packages in each suite, used to determine
|
||||||
@ -356,7 +356,7 @@ def make_migrationitem(package, sources):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
item = UnversionnedMigrationItem(package)
|
item = UnversionnedMigrationItem(package)
|
||||||
return MigrationItem("%s/%s" % (item.uvname, sources[item.suite.name][item.package].version))
|
return MigrationItem("%s/%s" % (item.uvname, suite_info[item.suite.name].sources[item.package].version))
|
||||||
|
|
||||||
|
|
||||||
def write_excuses(excuselist, dest_file, output_format="yaml"):
|
def write_excuses(excuselist, dest_file, output_format="yaml"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user