From 3d42b01c8087f16aadfe98644a55b8d3fdbcdf0d Mon Sep 17 00:00:00 2001 From: kirankha Date: Tue, 22 Aug 2023 11:09:22 +0530 Subject: [PATCH] aws ota silabs submodules changes --- scripts/checkout_submodules.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/checkout_submodules.py b/scripts/checkout_submodules.py index 22ac0fa754bbe9..e67d6814a2f821 100755 --- a/scripts/checkout_submodules.py +++ b/scripts/checkout_submodules.py @@ -90,7 +90,7 @@ def make_chip_root_safe_directory() -> None: subprocess.check_call(['git', 'config', '--global', '--add', 'safe.directory', CHIP_ROOT]) -def checkout_modules(modules: list, shallow: bool, force: bool, recursive: bool) -> None: +def checkout_modules(modules: list, shallow: bool, force: bool, recursive: bool, checkout: bool) -> None: names = ', '.join([module.name for module in modules]) logging.info(f'Checking out: {names}') @@ -98,6 +98,7 @@ def checkout_modules(modules: list, shallow: bool, force: bool, recursive: bool) cmd += ['--depth', '1'] if shallow else [] cmd += ['--force'] if force else [] cmd += ['--recursive'] if recursive else [] + cmd += ['--checkout'] if checkout else [] cmd += [module.path for module in modules] subprocess.check_call(cmd) @@ -127,6 +128,7 @@ def main(): parser.add_argument('--deinit-unmatched', action='store_true', help='Deinitialize submodules for non-matching platforms') parser.add_argument('--recursive', action='store_true', help='Recursive init of the listed submodules') + parser.add_argument('--checkout', action='store_true', help='Checkout the submodules') args = parser.parse_args() modules = list(load_module_info()) @@ -137,7 +139,7 @@ def main(): if args.allow_changing_global_git_config: make_chip_root_safe_directory() # ignore directory ownership issues for sub-modules - checkout_modules(selected_modules, args.shallow, args.force, args.recursive) + checkout_modules(selected_modules, args.shallow, args.force, args.recursive, args.checkout) if args.deinit_unmatched and unmatched_modules: deinit_modules(unmatched_modules, args.force)