From 5c33fb028865bdc490aa0db2980987149786b00f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 9 Feb 2025 14:26:00 -0700 Subject: u_boot_pylib: Move gitutil into the library Move this file into U-Boot's Python library, so that it is no-longer part of patman. This makes a start on: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35 Signed-off-by: Simon Glass --- tools/buildman/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/buildman/builder.py') diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index cbf1345281b..2568e4e8423 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -19,8 +19,8 @@ import time from buildman import builderthread from buildman import toolchain -from patman import gitutil from u_boot_pylib import command +from u_boot_pylib import gitutil from u_boot_pylib import terminal from u_boot_pylib import tools from u_boot_pylib.terminal import tprint -- cgit v1.2.3 From 6e628c221ebf19a869542d31187e3ac29dba20fb Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 19 Feb 2025 08:11:16 -0700 Subject: tools: Fix pylint 3.3.4 errors This newer pylint produces errors about variables possibly being used before being set. Adjust the code to pass these checks. Signed-off-by: Simon Glass Reported-by: Tom Rini --- tools/buildman/builder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/buildman/builder.py') diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 2568e4e8423..23b1016d0f9 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1095,14 +1095,13 @@ class Builder: diff = result[name] if name.startswith('_'): continue - if diff != 0: - color = self.col.RED if diff > 0 else self.col.GREEN + colour = self.col.RED if diff > 0 else self.col.GREEN msg = ' %s %+d' % (name, diff) if not printed_target: tprint('%10s %-15s:' % ('', result['_target']), newline=False) printed_target = True - tprint(msg, colour=color, newline=False) + tprint(msg, colour=colour, newline=False) if printed_target: tprint() if show_bloat: @@ -1353,6 +1352,7 @@ class Builder: for line in lines: if not line: continue + col = None if line[0] == '+': col = self.col.GREEN elif line[0] == '-': -- cgit v1.2.3 From 3d094ce28a22690c3d672988af5f161310822603 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 3 Feb 2025 09:26:45 -0700 Subject: u_boot_pylib: Add a function to run a single command Add a helper to avoid needing to use a list within a list for this simple case. Update existing users of runpipe() to use this where possible. Signed-off-by: Simon Glass --- tools/buildman/builder.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools/buildman/builder.py') diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index cbf1345281b..3eac17ac212 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -510,7 +510,7 @@ class Builder: stage: Stage that we are at (mrproper, config, oldconfig, build) cwd: Directory where make should be run args: Arguments to pass to make - kwargs: Arguments to pass to command.run_pipe() + kwargs: Arguments to pass to command.run_one() """ def check_output(stream, data): @@ -531,11 +531,12 @@ class Builder: return False self._restarting_config = False - self._terminated = False + self._terminated = False cmd = [self.gnu_make] + list(args) - result = command.run_pipe([cmd], capture=True, capture_stderr=True, - cwd=cwd, raise_on_error=False, infile='/dev/null', - output_func=check_output, **kwargs) + result = command.run_one(*cmd, capture=True, capture_stderr=True, + cwd=cwd, raise_on_error=False, + infile='/dev/null', output_func=check_output, + **kwargs) if self._terminated: # Try to be helpful -- cgit v1.2.3