buildman: Extract arch fixups from scan() into separate function

Move the architecture fixup logic (aarch64 and riscv adjustments) into
a new _fixup_arch() method to reduce complexity of scan().

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Simon Glass
2026-01-03 11:23:04 -07:00
committed by Simon Glass
parent 1680c7ba7f
commit 7250a9bc97

View File

@@ -301,6 +301,19 @@ class KconfigScanner:
params['target'] = expect_target
self._fixup_arch(params)
return params, warnings
def _fixup_arch(self, params):
"""Fix up architecture names
Handle cases where the architecture name needs adjustment based on
CPU type or other configuration.
Args:
params (dict): Board parameters to update in place
"""
# fix-up for aarch64
if params['arch'] == 'arm' and params['cpu'] == 'armv8':
params['arch'] = 'aarch64'
@@ -316,8 +329,6 @@ class KconfigScanner:
else:
params['arch'] = 'riscv64'
return params, warnings
class MaintainersDatabase: