Store Testsuite-Triggers: list in sources

Compute an inverse trigger → sources map, as that's usually the direction that
britney is interested in.
pre-rebase-2016-12-12
Martin Pitt 8 years ago
parent 26df12182f
commit dac3bb3044

@ -236,16 +236,17 @@ check_fields = sorted(check_field_name)
class SourcePackage(object): class SourcePackage(object):
__slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc', __slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc',
'testsuite'] 'testsuite', 'testsuite_triggers']
def __init__(self, version, section, binaries, maintainer, is_fakesrc, def __init__(self, version, section, binaries, maintainer, is_fakesrc,
testsuite): testsuite, testsuite_triggers):
self.version = version self.version = version
self.section = section self.section = section
self.binaries = binaries self.binaries = binaries
self.maintainer = maintainer self.maintainer = maintainer
self.is_fakesrc = is_fakesrc self.is_fakesrc = is_fakesrc
self.testsuite = testsuite self.testsuite = testsuite
self.testsuite_triggers = testsuite_triggers
def __getitem__(self, item): def __getitem__(self, item):
return getattr(self, self.__slots__[item]) return getattr(self, self.__slots__[item])
@ -336,6 +337,14 @@ class Britney(object):
self.binaries['tpu'] = {} self.binaries['tpu'] = {}
self.binaries['pu'] = {} self.binaries['pu'] = {}
# compute inverse Testsuite-Triggers: map, unifying all series
self.log('Building inverse testsuite_triggers map')
self.testsuite_triggers = {}
for suitemap in self.sources.values():
for src, data in suitemap.items():
for trigger in data.testsuite_triggers:
self.testsuite_triggers.setdefault(trigger, set()).add(src)
self.binaries['unstable'] = self.read_binaries(self.options.unstable, "unstable", self.options.architectures) self.binaries['unstable'] = self.read_binaries(self.options.unstable, "unstable", self.options.architectures)
for suite in ('tpu', 'pu'): for suite in ('tpu', 'pu'):
if hasattr(self.options, suite): if hasattr(self.options, suite):
@ -587,6 +596,7 @@ class Britney(object):
None, None,
True, True,
[], [],
[],
) )
self.sources['testing'][pkg_name] = src_data self.sources['testing'][pkg_name] = src_data
@ -662,6 +672,7 @@ class Britney(object):
None, None,
True, True,
[], [],
[],
) )
self.sources['testing'][pkg_name] = src_data self.sources['testing'][pkg_name] = src_data
self.sources['unstable'][pkg_name] = src_data self.sources['unstable'][pkg_name] = src_data
@ -844,6 +855,7 @@ class Britney(object):
maint, maint,
False, False,
get_field('Testsuite', '').split(), get_field('Testsuite', '').split(),
get_field('Testsuite-Triggers', '').replace(',', '').split(),
) )
return sources return sources
@ -993,7 +1005,7 @@ class Britney(object):
srcdist[source].binaries.append(pkg_id) srcdist[source].binaries.append(pkg_id)
# if the source package doesn't exist, create a fake one # if the source package doesn't exist, create a fake one
else: else:
srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True, []) srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True, [], [])
# add the resulting dictionary to the package list # add the resulting dictionary to the package list
packages[pkg] = dpkg packages[pkg] = dpkg

Loading…
Cancel
Save