From 8b8717d273a203bc2612a14d840470859bb6657c Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Tue, 9 Apr 2024 16:33:51 +0800 Subject: [PATCH] =?UTF-8?q?issues:#I9F7VG=20=E6=B6=88=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E6=BB=A1=E8=B6=B3=E8=AF=AD=E8=A8=80=E8=A7=84=E8=8C=83=E7=9A=84?= =?UTF-8?q?=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- tools/deps_guard/elf_file_mgr/elf_file_mgr.py | 6 +++--- tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py | 2 +- tools/deps_guard/rules_checker/chipsetsdk.py | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/deps_guard/elf_file_mgr/elf_file_mgr.py b/tools/deps_guard/elf_file_mgr/elf_file_mgr.py index 6e65f2b..131911f 100755 --- a/tools/deps_guard/elf_file_mgr/elf_file_mgr.py +++ b/tools/deps_guard/elf_file_mgr/elf_file_mgr.py @@ -221,15 +221,15 @@ class ElfFileMgr(object): if not path.startswith("/"): path = "/" + path if path.find("/lib64/") > 0: - pathOrder = "/system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib:/vendor/lib:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib64:/lib:/usr/local/lib:/usr/lib" + path_order = "/system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib:/vendor/lib:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib64:/lib:/usr/local/lib:/usr/lib" else: - pathOrder = "/system/lib:/vendor/lib:/vendor/lib/chipsetsdk:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib:/usr/local/lib:/usr/lib" + path_order = "/system/lib:/vendor/lib:/vendor/lib/chipsetsdk:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib:/usr/local/lib:/usr/lib" if path.rfind("/") < 0: return 1000 path = path[:path.rfind("/")] - paths = pathOrder.split(':') + paths = path_order.split(':') idx = 0 for p in paths: if p == path: 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 1cb6557..6e60106 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,7 @@ 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() + subprocess.Popen([hdi_tool, "-d", hcs_file, "-o", out_file]).wait() try: with open(out_file) as f: lines = f.readlines() diff --git a/tools/deps_guard/rules_checker/chipsetsdk.py b/tools/deps_guard/rules_checker/chipsetsdk.py index 0d64f41..a40c599 100755 --- a/tools/deps_guard/rules_checker/chipsetsdk.py +++ b/tools/deps_guard/rules_checker/chipsetsdk.py @@ -138,7 +138,9 @@ class ChipsetSDKRule(BaseRule): headers.append(item) try: - with open(os.path.join(self.get_mgr().get_product_images_path(), "chipsetsdk_info.json"), "w") as f: + with os.fdopen(os.open(os.path.join(self.get_mgr().get_product_images_path(), + "chipsetsdk_info.json"), + os.O_WRONLY | os.O_CREAT, 0o644), "w") as f: json.dump(headers, f, indent=4) except: pass -- Gitee