From 0fe559ec91d908e6c8ae97e00aad5ac27ff4a11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=BF=94=E5=AE=87a?= Date: Tue, 27 Dec 2022 08:01:56 +0000 Subject: [PATCH] =?UTF-8?q?update=20LibChecker/lib=5Fchecker.py.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9json=E6=96=87=E4=BB=B6=E5=86=99=E5=85=A5?= =?UTF-8?q?=E7=AD=96=E7=95=A5=EF=BC=8C=E8=A7=A3=E5=86=B3json=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=BE=93=E5=87=BA=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王翔宇a --- LibChecker/lib_checker.py | 71 ++++++--------------------------------- 1 file changed, 10 insertions(+), 61 deletions(-) diff --git a/LibChecker/lib_checker.py b/LibChecker/lib_checker.py index 27d7885..fc601b7 100755 --- a/LibChecker/lib_checker.py +++ b/LibChecker/lib_checker.py @@ -326,6 +326,9 @@ def libchecker_checking_loop(): g_test_dict.update({key4 : "wwww"}) g_genresults_to_json.update({ key4 : "gen" }) + with open("Outputs/libchecker-output.json","w") as f: + json.dump(g_genresults_to_json,f) + for last_key in g_storejsondict: if (g_storejsondict[last_key]['necessity'][g_ostype]['level'] == "L1"): g_counter_flags['pkg_counter']['total']['l1'] += 1 @@ -372,70 +375,16 @@ def libchecker_checking_loop(): else: g_counter_flags['lib_counter']['warning'] += 1 g_subresults_to_json[list1_item] = "compatible bigger" - #g_test_dict.update({last_key : g_subresults_to_json}) - #print("G_Subresults_To_Json") - #print(g_subresults_to_json) - - #g_genresults_to_json[last_key] = g_test_dict.pop(last_key) - #print("last_key") - #print(last_key) - g_genresults_to_json[last_key] = g_subresults_to_json - #g_test_list.append(g_subresults_to_json) - - #print("G_Subresults_to_Json") - #print(g_subresults_to_json) - - #print("Last Key") - #print(last_key) - - #g_genresults_to_json.update({last_key : g_subresults_to_json}) - #print(g_genresults_to_json) - - - - #print(g_genresults_to_json) - #g_genresults_to_json.update({key_b : g_subresults_to_json}) - #g_test_list.append({ key_b : g_subresults_to_json })i - #g_test_list.append({ key_b : g_subresults_to_json })i - - #print(g_test_dict) - #g_genresults_to_json[last_key] = g_subresults_to_json - - #del g_test_dict[last_key] - #print(g_test_dict.keys()) - - #if last_key in g_test_dict: - # g_genresults_to_json.update({last_key : g_subresults_to_json}) - #g_test_list.append(g_test_dict.pop(last_key)) - - #print("g_test_dict") - #print(g_test_dict) - - #print("g_test_list") - #print(g_test_list) - #print(g_genresults_to_json) + g_genresults_to_json.update({last_key:g_subresults_to_json}) - #print(g_pkgflag_dict) + with open("Outputs/libchecker-output.json", 'r') as fr: + json_all = json.load(fr) + json_all[last_key]=g_subresults_to_json + with open("Outputs/libchecker-output.json", 'w+') as fw: + json.dump(json_all,fw,ensure_ascii=False,indent=4) - #g_test_list.append({ last_key : g_subresults_to_json }) - #g_genresults_to_json.update({last_key : g_subresults_to_json}) - #print("G_Test_List") - #print(g_test_list) - - #g_test_dict = g_pkgversiodict - #g_pkgversiodict[g_storejsondict[last_key]['lib_name']] = g_storejsondict[last_key]['version'][g_ostype] - - - - - - - - - #print("G_Genbresults_to_Json") - #print(g_genresults_to_json) print("=============================================================================================================") print("结束检查 ",time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())) print("") @@ -1332,7 +1281,7 @@ def libchecker_json_file_output(): libchecker_environment_init() libchecker_checking_loop() -libchecker_output_json_file() +#libchecker_output_json_file() libchecker_over_jobs() #check_sharelib_info('/lib', 'libanl.so.1' ) -- Gitee