From 530bf66ce4967b34338450ac30259b147cccce40 Mon Sep 17 00:00:00 2001 From: caojiale1 Date: Tue, 21 Mar 2023 14:53:11 +0800 Subject: [PATCH] Signed-off-by:caojiale1 --- localCoverage/resident_service/init_gcov.py | 5 ++--- .../restore_comment/build_before_generate.py | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/localCoverage/resident_service/init_gcov.py b/localCoverage/resident_service/init_gcov.py index 3c93c20..6e7c99b 100644 --- a/localCoverage/resident_service/init_gcov.py +++ b/localCoverage/resident_service/init_gcov.py @@ -81,11 +81,10 @@ def modify_faultloggerd_file(developer_path, device_sn, device_ip): hdc_str = "hdc -s %s:8710 -t %s" % (device_ip, device_sn) _, enforce = subprocess.getstatusoutput("%s shell getenforce" % hdc_str) if_reboot = False + print("%s shell mount -o rw,remount /" % hdc_str) + subprocess.Popen("%s shell mount -o rw,remount /" % hdc_str, shell=True).communicate() if enforce != "Permissive": if_reboot = True - print("%s shell mount -o rw,remount /" % hdc_str) - subprocess.Popen("%s shell mount -o rw,remount /" % hdc_str, - shell=True).communicate() subprocess.Popen("%s shell sed -i 's/enforcing/permissive/g' /system/etc/selinux/config" % hdc_str, shell=True).communicate() diff --git a/localCoverage/restore_comment/build_before_generate.py b/localCoverage/restore_comment/build_before_generate.py index 529f1ff..086c79c 100644 --- a/localCoverage/restore_comment/build_before_generate.py +++ b/localCoverage/restore_comment/build_before_generate.py @@ -53,12 +53,11 @@ def get_source_file_list(path): file_path_list = [] file_path_list_append = file_path_list.append for root, dirs, files in os.walk(path): - if files: - for file_name in files: - file_path = os.path.join(root, file_name) - _, suffix = os.path.splitext(file_name) - if suffix in [".c", ".h", ".cpp"]: - file_path_list_append(file_path) + for file_name in files: + file_path = os.path.join(root, file_name) + _, suffix = os.path.splitext(file_name) + if suffix in [".c", ".h", ".cpp"]: + file_path_list_append(file_path) return file_path_list -- Gitee