From e4270bc48354db40b550cf20b0a46d84b7b72e79 Mon Sep 17 00:00:00 2001 From: caohongtao Date: Wed, 17 Jan 2024 14:03:15 +0800 Subject: [PATCH 1/2] Maintain a consistent judgment method throughout the text --- pyporter/pyporter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyporter/pyporter.py b/pyporter/pyporter.py index 41425c4..c669f1f 100755 --- a/pyporter/pyporter.py +++ b/pyporter/pyporter.py @@ -348,12 +348,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)}") + rs = subprocess.call(["wget", s_url, "-P", tgtpath]) + if rs !=0: + logger.error(f"Failed to download source from:{s_url}") return False + else: + return True def prepare_rpm_build_env(root): -- Gitee From d180dfe70500d4ca4f54466e781118d8300918ab Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Mon, 5 Feb 2024 09:21:55 +0000 Subject: [PATCH 2/2] update pyporter/pyporter.py. Signed-off-by: Caohongtao --- pyporter/pyporter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyporter/pyporter.py b/pyporter/pyporter.py index c669f1f..32b4b7b 100755 --- a/pyporter/pyporter.py +++ b/pyporter/pyporter.py @@ -348,8 +348,9 @@ def download_source(porter, tgtpath): if s_info.get("md5") == _hash: print("Same source file exists, skip") return True + rs = subprocess.call(["wget", s_url, "-P", tgtpath]) - if rs !=0: + if rs != 0: logger.error(f"Failed to download source from:{s_url}") return False else: -- Gitee