Skip to content

Commit

Permalink
[nrf fromlist] scripts: Undo Board.{dir -> directories[0]} renames
Browse files Browse the repository at this point in the history
Upstream PR: zephyrproject-rtos/zephyr#72857

`Board.dir` can be used in place of `Board.directories[0]` for brevity.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit 103f7b59548cf5d809d1f105c5c0e2e94396cdfc)
  • Loading branch information
57300 authored and nordicjm committed Jul 19, 2024
1 parent a51f1aa commit af38d0b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions doc/_extensions/zephyr/kconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def kconfig_load(app: Sphinx) -> Tuple[kconfiglib.Kconfig, Dict[str, str]]:
board_str = 'BOARD_' + re.sub(r"[^a-zA-Z0-9_]", "_", qualifier).upper()
f.write('config ' + board_str + '\n')
f.write('\t bool\n')
f.write('source "' +
(board.directories[0] / ('Kconfig.' + board.name)).as_posix() + '"\n\n')
f.write('source "' + (board.dir / ('Kconfig.' + board.name)).as_posix() + '"\n\n')

# base environment
os.environ["ZEPHYR_BASE"] = str(ZEPHYR_BASE)
Expand Down
8 changes: 3 additions & 5 deletions scripts/ci/check_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ def get_v2_model(self, kconfig_dir, settings_file):

with open(kconfig_defconfig_file, 'w') as fp:
for board in v2_boards:
fp.write('osource "' +
(board.directories[0] / 'Kconfig.defconfig').as_posix() + '"\n')
fp.write('osource "' + (Path(board.dir) / 'Kconfig.defconfig').as_posix() + '"\n')

with open(kconfig_boards_file, 'w') as fp:
for board in v2_boards:
Expand All @@ -493,16 +492,15 @@ def get_v2_model(self, kconfig_dir, settings_file):
fp.write('config ' + board_str + '\n')
fp.write('\t bool\n')
fp.write(
'source "' +
(board.directories[0] / ('Kconfig.' + board.name)).as_posix() + '"\n\n'
'source "' + (Path(board.dir) / ('Kconfig.' + board.name)).as_posix() + '"\n\n'
)

with open(kconfig_file, 'w') as fp:
fp.write(
'osource "' + (Path(kconfig_dir) / 'boards' / 'Kconfig.syms.v1').as_posix() + '"\n'
)
for board in v2_boards:
fp.write('osource "' + (Path(board.directories[0]) / 'Kconfig').as_posix() + '"\n')
fp.write('osource "' + (Path(board.dir) / 'Kconfig').as_posix() + '"\n')

kconfig_defconfig_file = os.path.join(kconfig_dir, 'soc', 'Kconfig.defconfig')
kconfig_soc_file = os.path.join(kconfig_dir, 'soc', 'Kconfig.soc')
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def find_boards(self):
for changed in changed_boards:
for board in known_boards:
c = (zephyr_base / changed).resolve()
if c.is_relative_to(board.directories[0].resolve()):
if c.is_relative_to(board.dir.resolve()):
for file in glob.glob(os.path.join(board.dir, f"{board.name}*.yaml")):
with open(file, 'r') as f:
b = yaml.load(f.read(), Loader=SafeLoader)
Expand Down
2 changes: 1 addition & 1 deletion scripts/list_boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def dump_boards(args):
if args.cmakeformat is not None:
info = args.cmakeformat.format(
NAME='NAME;' + board.name,
DIR='DIR;' + str(board.directories.as_posix()),
DIR='DIR;' + str(board.dir.as_posix()),
HWM='HWM;' + board.hwm,
VENDOR='VENDOR;NOTFOUND',
REVISION_DEFAULT='REVISION_DEFAULT;NOTFOUND',
Expand Down
3 changes: 1 addition & 2 deletions scripts/west_commands/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,5 @@ def do_run(self, args, _):
for board in list_boards.find_v2_boards(args).values():
if name_re is not None and not name_re.search(board.name):
continue
log.inf(args.format.format(name=board.name, arch='', dir=board.directories[0],
hwm=board.hwm,
log.inf(args.format.format(name=board.name, arch='', dir=board.dir, hwm=board.hwm,
qualifiers=list_boards.board_v2_qualifiers_csv(board)))

0 comments on commit af38d0b

Please sign in to comment.