From 1623828a48c2843ded3589a6ace98961af87d0f1 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Wed, 8 Aug 2018 13:37:05 +0000 Subject: [PATCH] SourcePackage: Add field for Build-Depends-Indep Signed-off-by: Niels Thykier --- britney.py | 36 +++++++++++++++++++----------------- britney2/__init__.py | 6 ++++-- britney2/utils.py | 4 ++++ tests/test_policy.py | 2 +- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/britney.py b/britney.py index 863c773..5d4af8d 100755 --- a/britney.py +++ b/britney.py @@ -598,14 +598,15 @@ class Britney(object): if component != 'main': faux_section = "%s/faux" % component src_data = SourcePackage(version, - sys.intern(faux_section), - [], - None, - True, - None, - [], - [], - ) + sys.intern(faux_section), + [], + None, + True, + None, + None, + [], + [], + ) target_suite.sources[pkg_name] = src_data pri_source_suite.sources[pkg_name] = src_data @@ -677,14 +678,15 @@ class Britney(object): pkg_list = [x.strip() for x in mandatory_field('Package-List').split("\n") if x.strip() != '' and not x.strip().startswith("#")] src_data = SourcePackage(faux_version, - faux_section, - [], - None, - True, - None, - [], - [], - ) + faux_section, + [], + None, + True, + None, + None, + [], + [], + ) target_suite.sources[pkg_name] = src_data pri_source_suite.sources[pkg_name] = src_data keep_installable.append(pkg_name) @@ -885,7 +887,7 @@ class Britney(object): srcdist[source].binaries.append(pkg_id) # if the source package doesn't exist, create a fake one else: - srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True, None, [], []) + srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True, None, None, [], []) # add the resulting dictionary to the package list packages[pkg] = dpkg diff --git a/britney2/__init__.py b/britney2/__init__.py index 90afa01..0327c30 100644 --- a/britney2/__init__.py +++ b/britney2/__init__.py @@ -87,15 +87,17 @@ class Suites(object): class SourcePackage(object): - __slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc', 'build_deps_arch', 'testsuite', 'testsuite_triggers'] + __slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc', 'build_deps_arch', 'build_deps_indep', + 'testsuite', 'testsuite_triggers'] - def __init__(self, version, section, binaries, maintainer, is_fakesrc, build_deps_arch, testsuite, testsuite_triggers): + def __init__(self, version, section, binaries, maintainer, is_fakesrc, build_deps_arch, build_deps_indep, testsuite, testsuite_triggers): self.version = version self.section = section self.binaries = binaries self.maintainer = maintainer self.is_fakesrc = is_fakesrc self.build_deps_arch = build_deps_arch + self.build_deps_indep = build_deps_indep self.testsuite = testsuite self.testsuite_triggers = testsuite_triggers diff --git a/britney2/utils.py b/britney2/utils.py index 5da7273..92d071f 100644 --- a/britney2/utils.py +++ b/britney2/utils.py @@ -741,12 +741,16 @@ def read_sources_file(filename, sources=None, intern=sys.intern): build_deps_arch = sys.intern(build_deps_arch) else: build_deps_arch = None + build_deps_indep = get_field('Build-Depends-Indep') + if build_deps_indep is not None: + build_deps_indep = sys.intern(build_deps_indep) sources[intern(pkg)] = SourcePackage(intern(ver), section, [], maint, False, build_deps_arch, + build_deps_indep, get_field('Testsuite', '').split(), get_field('Testsuite-Triggers', '').replace(',', '').split(), ) diff --git a/tests/test_policy.py b/tests/test_policy.py index ade4235..b56e4fa 100644 --- a/tests/test_policy.py +++ b/tests/test_policy.py @@ -41,7 +41,7 @@ def create_excuse(name): def create_source_package(version, section='devel', binaries=None): if binaries is None: binaries = [] - return SourcePackage(version, section, binaries, 'Random tester', False, None, '', '') + return SourcePackage(version, section, binaries, 'Random tester', False, None, None, [], []) def create_policy_objects(source_name, target_version, source_version):