Rewrite write_controlfiles to take a single suite as argument

Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
Niels Thykier 2018-07-23 15:13:48 +00:00
parent 97d707e5c0
commit 4a2fe3420a
2 changed files with 5 additions and 5 deletions

View File

@ -2577,8 +2577,7 @@ class Britney(object):
if self.options.control_files: if self.options.control_files:
self.logger.info("Writing new control files for the target suite to %s", self.logger.info("Writing new control files for the target suite to %s",
target_suite.path) target_suite.path)
write_controlfiles(self.sources, self.binaries, write_controlfiles(target_suite)
target_suite.name, target_suite.path)
for policy in self.policies: for policy in self.policies:
policy.save_state(self) policy.save_state(self)

View File

@ -421,7 +421,7 @@ def relation_atom_to_string(atom):
return pkg return pkg
def write_controlfiles(sources, packages, suite, basedir): def write_controlfiles(target_suite):
"""Write the control files """Write the control files
This method writes the control files for the binary packages of all This method writes the control files for the binary packages of all
@ -430,8 +430,9 @@ def write_controlfiles(sources, packages, suite, basedir):
these files may omit a lot of regular fields. these files may omit a lot of regular fields.
""" """
sources_s = sources[suite] basedir = target_suite.path
packages_s = packages[suite] sources_s = target_suite.sources
packages_s = target_suite.binaries
key_pairs = ((SECTION, 'Section'), (ARCHITECTURE, 'Architecture'), key_pairs = ((SECTION, 'Section'), (ARCHITECTURE, 'Architecture'),
(MULTIARCH, 'Multi-Arch'), (SOURCE, 'Source'), (MULTIARCH, 'Multi-Arch'), (SOURCE, 'Source'),