Store Testsuite-Triggers: list in sources

Compute an inverse trigger → sources map, as that's usually the direction that
britney is interested in.
email-direct-upload-sponsor
Martin Pitt 8 years ago
parent 0d43a20471
commit 15aab3348a

@ -297,6 +297,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.suite_info['unstable'].path, "unstable", self.options.architectures) self.binaries['unstable'] = self.read_binaries(self.suite_info['unstable'].path, "unstable", self.options.architectures)
for suite in ('tpu', 'pu'): for suite in ('tpu', 'pu'):
if suite in self.suite_info: if suite in self.suite_info:
@ -576,6 +584,7 @@ class Britney(object):
None, None,
True, True,
[], [],
[],
) )
self.sources['testing'][pkg_name] = src_data self.sources['testing'][pkg_name] = src_data
@ -651,6 +660,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
@ -852,7 +862,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

@ -9,15 +9,16 @@ SuiteInfo = namedtuple('SuiteInfo', [
class SourcePackage(object): class SourcePackage(object):
__slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc', 'testsuite'] __slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc', 'testsuite', 'testsuite_triggers']
def __init__(self, version, section, binaries, maintainer, is_fakesrc, testsuite): def __init__(self, version, section, binaries, maintainer, is_fakesrc, 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])

@ -739,6 +739,7 @@ def read_sources_file(filename, sources=None, intern=sys.intern):
maint, maint,
False, False,
get_field('Testsuite', '').split(), get_field('Testsuite', '').split(),
get_field('Testsuite-Triggers', '').replace(',', '').split(),
) )
return sources return sources

Loading…
Cancel
Save