diff --git a/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py b/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py index 1cb6557f946f4561ceb496621d6ee73f3a7614f0..c2fa6ee0b098d1c6bce199ef930d9b0bce2afdc1 100755 --- a/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py +++ b/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py @@ -27,7 +27,10 @@ class HdiParser(object): hdi_tool = os.path.join(product_out_path, "obj/drivers/hdf_core/framework/tools/hc-gen/hc-gen") hcs_file = os.path.join(product_out_path, "packages/phone/vendor/etc/hdfconfig/hdf_default.hcb") out_file = os.path.join(product_out_path, "device_info.hcs") - subprocess.Popen('%s -d "%s" -o "%s"' % (hdi_tool, hcs_file, out_file), shell=True).wait() + if os.path.exists(hcs_file) and os.path.exists(hdi_tool): + subprocess.Popen([hdi_tool, "-d", hcs_file, "-o", out_file]).wait() + else: + print("{} or {} not exist".format(hcs_file, hdi_tool)) try: with open(out_file) as f: lines = f.readlines()