From 276c1fc4a09a80499c07808abe2a2fcb9b3c832c Mon Sep 17 00:00:00 2001 From: Grzegorz Swiderski Date: Thu, 18 Jul 2024 15:08:35 +0200 Subject: [PATCH] scripts: Undo Board.{dir -> directories[0]} renames `Board.dir` can be used in place of `Board.directories[0]` for brevity. Signed-off-by: Grzegorz Swiderski --- doc/_extensions/zephyr/kconfig/__init__.py | 3 +-- scripts/ci/test_plan.py | 2 +- scripts/list_boards.py | 2 +- scripts/west_commands/boards.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index abbdcc1b9be..905376d8168 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -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) diff --git a/scripts/ci/test_plan.py b/scripts/ci/test_plan.py index 4bb428ee5b1..dfc87368198 100755 --- a/scripts/ci/test_plan.py +++ b/scripts/ci/test_plan.py @@ -244,7 +244,7 @@ class Filters: 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', encoding='utf-8') as f: b = yaml.load(f.read(), Loader=SafeLoader) diff --git a/scripts/list_boards.py b/scripts/list_boards.py index 44247b450ff..443e18a1980 100755 --- a/scripts/list_boards.py +++ b/scripts/list_boards.py @@ -447,7 +447,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', diff --git a/scripts/west_commands/boards.py b/scripts/west_commands/boards.py index 9cb6182a7a7..6c4ee168466 100644 --- a/scripts/west_commands/boards.py +++ b/scripts/west_commands/boards.py @@ -104,7 +104,7 @@ class Boards(WestCommand): args.format.format( name=board.name, full_name=board.full_name, - dir=board.directories[0], + dir=board.dir, hwm=board.hwm, vendor=board.vendor, qualifiers=list_boards.board_v2_qualifiers_csv(board),