mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-18 22:58:13 +01:00
buildman: Refactor target handling in Boards.scan()
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@chromium.org>
This commit is contained in:
parent
bc12d03493
commit
f99f34b14b
@ -231,6 +231,10 @@ class KconfigScanner:
|
|||||||
'config': <config_header_name>,
|
'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._conf.load_config(defconfig)
|
||||||
self._tmpfile = None
|
self._tmpfile = None
|
||||||
|
|
||||||
@ -245,9 +249,7 @@ class KconfigScanner:
|
|||||||
else:
|
else:
|
||||||
params[key] = '-'
|
params[key] = '-'
|
||||||
|
|
||||||
defconfig = os.path.basename(defconfig)
|
params['target'] = expect_target
|
||||||
params['target'], match, rear = defconfig.partition('_defconfig')
|
|
||||||
assert match and not rear, f'{defconfig} : invalid defconfig'
|
|
||||||
|
|
||||||
# fix-up for aarch64
|
# fix-up for aarch64
|
||||||
if params['arch'] == 'arm' and params['cpu'] == 'armv8':
|
if params['arch'] == 'arm' and params['cpu'] == 'armv8':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user