From 4f5e44ee3a181bf62c816bb9f882dd6bfd090926 Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Fri, 15 Mar 2024 02:56:30 +0000 Subject: [PATCH] update pyporter/pyporter.py. Signed-off-by: Caohongtao --- pyporter/pyporter.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pyporter/pyporter.py b/pyporter/pyporter.py index 2751ddf..edc9dc6 100755 --- a/pyporter/pyporter.py +++ b/pyporter/pyporter.py @@ -268,10 +268,13 @@ class PyPorter: continue ignore_line = False if d.strip().startswith("===") or d.strip().startswith("---"): - paragraph = paragraph + 1 + paragraph + = 1 ignore_line = True elif d.strip().startswith(":") or d.strip().startswith(".."): ignore_line = True + else: + ignore_line = False + if ignore_line != True and paragraph == 1: res.append(d) if paragraph >= 2: @@ -359,12 +362,12 @@ def download_source(porter, tgtpath): if s_info.get("md5") == _hash: print("Same source file exists, skip") return True - try: - subprocess.call(["wget", s_url, "-P", tgtpath]) - return True - except Exception as e: - print(f"Failed to download source: {str(e)}") + ret = subprocess.call(["wget", s_url, "-P", tgtpath]) + if ret != 0: + print(f"Failed to download source from {s_url}") + logger.error(f"Failed to download source from {s_url}") return False + return True def prepare_rpm_build_env(root): -- Gitee