diff options
author | Simon Glass <sjg@chromium.org> | 2023-07-19 17:49:16 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-07-24 09:34:11 -0600 |
commit | dab3a4a0e32e89001ba9cfaa790ca8fbf15d195b (patch) | |
tree | 42968eba712fcc19ed0cf6fe6686237f7c8ffddd /tools/buildman | |
parent | ed007bfa2f55859d59cfb4c343425775f7f3ec55 (diff) | |
download | u-boot-dab3a4a0e32e89001ba9cfaa790ca8fbf15d195b.zip u-boot-dab3a4a0e32e89001ba9cfaa790ca8fbf15d195b.tar.gz u-boot-dab3a4a0e32e89001ba9cfaa790ca8fbf15d195b.tar.bz2 |
buildman: Convert config_out to string IO
This is probably a little more efficient and it allows passing the object
to another function to write data. Convert config_out to use a string I/O
device.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman')
-rw-r--r-- | tools/buildman/builderthread.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 42af519..9c2938d 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -10,6 +10,7 @@ based on the jobs provided. import errno import glob +import io import os import shutil import sys @@ -292,7 +293,7 @@ class BuilderThread(threading.Thread): args, cwd, src_dir = self._build_args(brd, out_dir, out_rel_dir, work_dir, commit_upto) config_args = [f'{brd.target}_defconfig'] - config_out = '' + config_out = io.StringIO() # Remove any output targets. Since we use a build directory that # was previously used by another board, it may have produced an @@ -311,14 +312,14 @@ class BuilderThread(threading.Thread): if self.mrproper: result = self.make(commit, brd, 'mrproper', cwd, 'mrproper', *args, env=env) - config_out += result.combined + config_out.write(result.combined) cmd_list.append([self.builder.gnu_make, 'mrproper', *args]) result = self.make(commit, brd, 'config', cwd, *(args + config_args), env=env) cmd_list.append([self.builder.gnu_make] + args + config_args) - config_out += result.combined + config_out.write(result.combined) do_config = False # No need to configure next time if adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, adjust_cfg) @@ -340,7 +341,7 @@ class BuilderThread(threading.Thread): result.return_code = 1 result.stderr = result.stderr.replace(src_dir + '/', '') if self.builder.verbose_build: - result.stdout = config_out + result.stdout + result.stdout = config_out.getvalue() + result.stdout result.cmd_list = cmd_list else: result.return_code = 1 |