aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-09-23 13:44:07 -0600
committerSimon Glass <sjg@chromium.org>2023-10-04 09:25:21 -0600
commit9461bf0d65acb1b758c94dd722b10d471b2c8675 (patch)
treeff8d1694eb6a8e0497d0eb20b066a2a01e414425 /tools
parent5aba58cf3bc4c1a094416b1ed5f2e5e9790b6f61 (diff)
downloadu-boot-9461bf0d65acb1b758c94dd722b10d471b2c8675.zip
u-boot-9461bf0d65acb1b758c94dd722b10d471b2c8675.tar.gz
u-boot-9461bf0d65acb1b758c94dd722b10d471b2c8675.tar.bz2
moveconfig: Reduce the amount of output
Output a single line in the case where the defconfig only has one line of output. Show the name without the _defconfig suffix, since that is the same for all boards. Use a list for the log so it is easier to process at the end. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/moveconfig.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 568386f..9d22872 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -410,7 +410,7 @@ class Slot:
self.state = STATE_IDLE
self.failed_boards = set()
self.defconfig = None
- self.log = ''
+ self.log = []
self.current_src_dir = None
self.proc = None
@@ -446,7 +446,7 @@ class Slot:
return False
self.defconfig = defconfig
- self.log = ''
+ self.log = []
self.current_src_dir = self.reference_src_dir
self.do_defconfig()
return True
@@ -498,11 +498,12 @@ class Slot:
def handle_error(self):
"""Handle error cases."""
- self.log += color_text(self.args.color, COLOR_LIGHT_RED,
- 'Failed to process.\n')
+ self.log.append(color_text(self.args.color, COLOR_LIGHT_RED,
+ 'Failed to process'))
if self.args.verbose:
- self.log += color_text(self.args.color, COLOR_LIGHT_CYAN,
- self.proc.stderr.read().decode())
+ for line in self.proc.stderr.read().decode().splitlines():
+ self.log.append(color_text(self.args.color, COLOR_LIGHT_CYAN,
+ line))
self.finish(False)
def do_defconfig(self):
@@ -522,8 +523,8 @@ class Slot:
try:
tchain = self.toolchains.Select(arch)
except ValueError:
- self.log += color_text(self.args.color, COLOR_YELLOW,
- f"Tool chain for '{arch}' is missing. Do nothing.\n")
+ self.log.append(color_text(self.args.color, COLOR_YELLOW,
+ f"Tool chain for '{arch}' is missing: do nothing"))
self.finish(False)
return
env = tchain.MakeEnvironment(False)
@@ -565,8 +566,8 @@ class Slot:
updated = not filecmp.cmp(orig_defconfig, new_defconfig)
if updated:
- self.log += color_text(self.args.color, COLOR_LIGHT_BLUE,
- 'defconfig was updated.\n')
+ self.log.append(color_text(self.args.color, COLOR_LIGHT_BLUE,
+ 'defconfig updated'))
if not self.args.dry_run and updated:
shutil.move(new_defconfig, orig_defconfig)
@@ -581,9 +582,13 @@ class Slot:
"""
# output at least 30 characters to hide the "* defconfigs out of *".
if self.log:
- log = self.defconfig.ljust(30) + '\n'
+ name = self.defconfig[:-len('_defconfig')]
- log += '\n'.join([ ' ' + s for s in self.log.split('\n') ])
+ # Put the first log line on the first line
+ log = name.ljust(20) + ' ' + self.log[0]
+
+ if len(self.log) > 1:
+ log += '\n' + '\n'.join([' ' + s for s in self.log[1:]])
# Some threads are running in parallel.
# Print log atomically to not mix up logs from different threads.
print(log, file=(sys.stdout if success else sys.stderr))