[PATCH v3 12/81] buildman: Refactor target handling in Boards.scan()
Simon Glass
sjg at chromium.org
Sun Jul 16 02:35:40 CEST 2023
Move the assert to the top of the function and provide an explicit
variables for the target name and base name.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v3:
- Add new patch to refactor target handling in Boards.scan()
tools/buildman/boards.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py
index a606ce27aef7..794e6fcf63bf 100644
--- a/tools/buildman/boards.py
+++ b/tools/buildman/boards.py
@@ -231,6 +231,10 @@ class KconfigScanner:
'config': <config_header_name>,
}
"""
+ leaf = os.path.basename(defconfig)
+ expect_target, match, rear = leaf.partition('_defconfig')
+ assert match and not rear, f'{leaf} : invalid defconfig'
+
self._conf.load_config(defconfig)
self._tmpfile = None
@@ -245,9 +249,7 @@ class KconfigScanner:
else:
params[key] = '-'
- defconfig = os.path.basename(defconfig)
- params['target'], match, rear = defconfig.partition('_defconfig')
- assert match and not rear, f'{defconfig} : invalid defconfig'
+ params['target'] = expect_target
# fix-up for aarch64
if params['arch'] == 'arm' and params['cpu'] == 'armv8':
--
2.41.0.455.g037347b96a-goog
More information about the U-Boot
mailing list