From edf58433f3e2564adaed6be8e3f93e06402bf2ca Mon Sep 17 00:00:00 2001 From: wangchuangGG Date: Tue, 15 Sep 2020 21:12:11 +0800 Subject: [PATCH] add retry times --- src/build/gitee_comment.py | 2 +- src/build/related_rpm_package.py | 4 ++-- src/utils/check_abi.py | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/build/gitee_comment.py b/src/build/gitee_comment.py index b63f92e..ca9a8c0 100755 --- a/src/build/gitee_comment.py +++ b/src/build/gitee_comment.py @@ -138,7 +138,7 @@ class Comment(object): def match(name, comment_file): if "aarch64" in name and "aarch64" in comment_file: return True - if "x86-64" in name and "x86-64" in comment_file: + if "x86-64" in name and "x86_64" in comment_file: return True return False diff --git a/src/build/related_rpm_package.py b/src/build/related_rpm_package.py index 702604e..79dd64b 100755 --- a/src/build/related_rpm_package.py +++ b/src/build/related_rpm_package.py @@ -70,7 +70,7 @@ class RelatedRpms(object): for name in self._arch_names: download_req_addr = os.path.join(self._obs_repo_url, download_project_name, name) logging.info("downloading index of %s", download_req_addr) - subprocess.run("wget {} -O {} > /dev/null 2>&1".format(download_req_addr, self._arch_names[name]), + subprocess.run("wget -t 5 -c {} -O {} > /dev/null 2>&1".format(download_req_addr, self._arch_names[name]), shell=True) if not has_found: with open(self._arch_names[name], "r") as fd: @@ -152,7 +152,7 @@ class RelatedRpms(object): if os.path.exists(rpm_url): rpm_path = rpm_url else: - subprocess.run("wget -P {} {}".format(temp_path, rpm_url), shell=True) + subprocess.run("wget -t 5 -c -P {} {}".format(temp_path, rpm_url), shell=True) rpm_path = os.path.join(temp_path, os.path.basename(rpm_url)) for project in self.GITEEBRANCHPROJECTMAPPING.get(self._branch_name): diff --git a/src/utils/check_abi.py b/src/utils/check_abi.py index 271a2ea..c72ffb6 100755 --- a/src/utils/check_abi.py +++ b/src/utils/check_abi.py @@ -132,8 +132,8 @@ class CheckAbi(object): else: rpm_name = os.path.basename(rpm_url) rpm_path = os.path.join(dest, rpm_name) - logging.debug("downloading %s......", rpm_name) - subprocess.run("wget -P {} {}".format(dest, rpm_url), shell=True) + logging.info("downloading %s......", rpm_name) + subprocess.run("wget -t 5 -c -P {} {}".format(dest, rpm_url), shell=True) return rpm_path def do_rpm2cpio(self, rpm2cpio_path, rpm_file): @@ -487,16 +487,16 @@ class CheckAbi(object): logging.debug("rpm exists:%s", rpms_url) return os.path.abspath(rpms_url) else: + use_args = "-t 5 -r -c -np -nH -nd -R index.html" if type(rpms_url) is str: - subprocess.run("wget -r -np -nH -nd -R index.html -P {} {} > /dev/null 2>&1".format(dest, rpms_url), - shell=True) + subprocess.run("wget {} -P {} {} > /dev/null 2>&1".format(use_args, dest, rpms_url), shell=True) else: count = 0 need_download = len(rpms_url) for url in rpms_url: count += 1 logging.info("[%d/%d] downloading %s", count, need_download, os.path.basename(url)) - subprocess.run("wget -r -np -nH -nd -R index.html -P {} {} > /dev/null 2>&1".format(dest, url), + subprocess.run("wget {} -P {} {} > /dev/null 2>&1".format(use_args, dest, url), shell=True) return dest -- Gitee