From 8da6fc83142882f4257133d3a8b168cecdea90ba Mon Sep 17 00:00:00 2001 From: MtTsai <7930801+MtTsai@users.noreply.github.com> Date: Sat, 18 Jun 2022 00:09:28 +0800 Subject: [PATCH] Support to return software_version_string with : on linux platform (#19710) --- examples/chef/chef.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index fcdd5e4f37a777..0978893f73467d 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -489,6 +489,10 @@ def main(argv: Sequence[str]) -> None: # if options.do_build: + branch = shell.run_cmd( + "git branch | awk -v FS=' ' '/\*/{print $NF}' | sed 's|[()]||g'", return_cmd_output=True).replace("\n", "") + commit_id = shell.run_cmd("git rev-parse HEAD", return_cmd_output=True).replace("\n", "") + if options.use_zzz: flush_print("Using pre-generated ZAP output") zzz_dir = os.path.join(_CHEF_SCRIPT_PATH, @@ -574,7 +578,7 @@ def main(argv: Sequence[str]) -> None: chip_shell_cmd_server = false chip_build_libshell = true chip_config_network_layer_ble = false - target_defines = ["CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID={options.vid}", "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID={options.pid}", "CONFIG_ENABLE_PW_RPC={'1' if options.do_rpc else '0'}"] + target_defines = ["CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID={options.vid}", "CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID={options.pid}", "CONFIG_ENABLE_PW_RPC={'1' if options.do_rpc else '0'}", "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\\"{branch}:{commit_id}\\""] """)) with open(f"{_CHEF_SCRIPT_PATH}/linux/sample.gni", "w") as f: f.write(textwrap.dedent(f"""\