From 63c867995b65f0637e29e3a09a0197ff340f359f Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 22 Jul 2018 15:37:55 +0000 Subject: [PATCH] write_heidi: Accept a target suite instead of sources+packages Signed-off-by: Niels Thykier --- britney.py | 5 +++-- britney2/utils.py | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/britney.py b/britney.py index 399a086..a3cc506 100755 --- a/britney.py +++ b/britney.py @@ -2564,6 +2564,7 @@ class Britney(object): # output files if not self.options.dry_run: + target_suite = self.suite_info.target_suite # re-write control files if self.options.control_files: self.logger.info("Writing new testing control files to %s", @@ -2576,8 +2577,8 @@ class Britney(object): # write HeidiResult self.logger.info("Writing Heidi results to %s", self.options.heidi_output) - write_heidi(self.options.heidi_output, self.sources["testing"], - self.binaries["testing"], + write_heidi(self.options.heidi_output, + target_suite, outofsync_arches=self.options.outofsync_arches) self.logger.info("Writing delta to %s", self.options.heidi_delta_output) diff --git a/britney2/utils.py b/britney2/utils.py index 114ad7f..9a1879e 100644 --- a/britney2/utils.py +++ b/britney2/utils.py @@ -264,7 +264,7 @@ def format_and_log_uninst(logger, architectures, nuninst, *, loglevel=logging.IN logger.log(loglevel, msg) -def write_heidi(filename, sources_t, packages_t, *, outofsync_arches=frozenset(), sorted=sorted): +def write_heidi(filename, target_suite, *, outofsync_arches=frozenset(), sorted=sorted): """Write the output HeidiResult This method write the output for Heidi, which contains all the @@ -273,9 +273,8 @@ def write_heidi(filename, sources_t, packages_t, *, outofsync_arches=frozenset() source - The file is written as "filename", it assumes all sources and - packages in "sources_t" and "packages_t" to be the packages in - "testing". + The file is written as "filename" using the sources and packages + from the "target_suite" parameter. outofsync_arches: If given, it is a set of architectures marked as "out of sync". The output file may exclude some out of date @@ -284,6 +283,9 @@ def write_heidi(filename, sources_t, packages_t, *, outofsync_arches=frozenset() The "X=X" parameters are optimizations to avoid "load global" in the loops. """ + sources_t = target_suite.sources + packages_t = target_suite.binaries + with open(filename, 'w', encoding='ascii') as f: # write binary packages