From 7d3f544620495012977d2a7050cf704754a12d48 Mon Sep 17 00:00:00 2001 From: xuyongliang_01 Date: Fri, 8 Sep 2023 01:48:15 +0000 Subject: [PATCH] =?UTF-8?q?update=20cve-agency-manager/cve=5Ftracking/core?= =?UTF-8?q?/download/save.py.=20=E4=B8=8B=E8=BD=BD=E7=9A=84=E8=A1=A5?= =?UTF-8?q?=E4=B8=81=E7=BB=8F=E5=B8=B8=E5=87=BA=E7=8E=B0html=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E9=9C=80=E5=9C=A8=E6=A3=80=E6=9F=A5=E6=97=B6?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuyongliang_01 --- cve-agency-manager/cve_tracking/core/download/save.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cve-agency-manager/cve_tracking/core/download/save.py b/cve-agency-manager/cve_tracking/core/download/save.py index e005991..dc1b571 100644 --- a/cve-agency-manager/cve_tracking/core/download/save.py +++ b/cve-agency-manager/cve_tracking/core/download/save.py @@ -75,6 +75,11 @@ def save_patch(patch_details=None, path=CONFIG.PATCH_SAVE_PATH, args=None): file = http.download(url=patch_url, out_fname=out_file) if not file: logger.error("Failed to download the file: %s" % patch_url) + else: + frfile = open(out_file) + line = frfile.readlines() + if line[0].strip() == '': + os.remove(out_file) return None else: patch_url_state = {} @@ -85,6 +90,11 @@ def save_patch(patch_details=None, path=CONFIG.PATCH_SAVE_PATH, args=None): if not file: logger.error("Failed to download the file: %s" % patch_url) patch_url_state[url] = "不适配" + else: + frfile = open(out_file) + line = frfile.readlines() + if line[0].strip() == '': + os.remove(out_file) patch_apply = PathApply(rpm_name=args.rpm_name, patch_path=args.patch_path, source_path=args.source_path, branch_rpm=args.branch, cve_num=args.cve_num) stat = patch_apply.packing_source() -- Gitee