From a74cf122e2c9ba67d8a0f272ccd88d50c5571f6f Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Sun, 7 Apr 2024 07:12:54 +0000 Subject: [PATCH] =?UTF-8?q?update=20advisors/check=5Fsource=5Furl.py.=201.?= =?UTF-8?q?=E5=BD=93=E4=BD=BF=E7=94=A8open(filename)=E5=8E=BB=E8=AF=BB?= =?UTF-8?q?=E5=86=99=E6=93=8D=E4=BD=9C=E6=96=87=E4=BB=B6=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=BF=9B=E8=A1=8C=E6=98=BE=E5=BC=8F=E5=85=B3?= =?UTF-8?q?=E9=97=AD=202.subprocess.call=E6=8E=A5=E5=8F=97=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E5=8F=98=E9=87=8F=E4=BD=9C=E4=B8=BA=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=BB=98=E8=AE=A4shell=3DFalse=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E9=9C=80=E5=B8=A6=E5=85=A5shell=3DTrue,=E6=9B=B4?= =?UTF-8?q?=E5=8A=A0=E5=AE=89=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Caohongtao --- advisors/check_source_url.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/advisors/check_source_url.py b/advisors/check_source_url.py index 21fcdb24..2f24e0cf 100755 --- a/advisors/check_source_url.py +++ b/advisors/check_source_url.py @@ -29,7 +29,7 @@ from advisors import gitee BODY_SOURCE = """软件包maintainer,您好: - openEuler-Advisor 检查发现该软件包的SPEC文件中包含的SOURCE URL可能存在问题。如果您确认SOURCE已经正确设置了URL,也请确认URL是否正确指向了源码包。同时,请确认其他分支上是否存在类似问题。 + openEuler-Advisor 检查发现该软件包的spec文件中包含的Source URL可能存在问题。如果您确认Source已经正确设置了URL,也请确认URL是否正确指向了源码包。同时,请确认其他分支上是否存在类似问题。 如果您认为这个报告是错误的,请在 https://gitee.com/openeuler/openEuler-Advisor/ 上创建 issue。 Thanks. Yours openEuler-Advisor""" @@ -101,6 +101,7 @@ def check_batch(repo_list, branch, number, batch_num, lock): break check_pkg(repo_name, branch, batch_file, lock) + batch_file.close() def check_pkg(pkg, branch, check_file, lock): @@ -149,13 +150,13 @@ def check_pkg(pkg, branch, check_file, lock): down_cnt += 1 if not subprocess.call(["timeout 15m wget -c {url} -O {name}".format(url=source, name=file_name)], - shell=True): + ): break lock.release() title = "Source url may be wrong in spec on branch {br}.".format(br=branch) if os.path.exists(file_name): - if subprocess.call(["tar -tvf {} &>/dev/null".format(file_name)], shell=True): + if subprocess.call(["tar -tvf {} &>/dev/null".format(file_name)]): lock.acquire() check_file.writelines("WARNING: {content}".format(content=title)) lock.release() @@ -166,7 +167,7 @@ def check_pkg(pkg, branch, check_file, lock): check_file.writelines("Check successfully.") lock.release() result = True - subprocess.call(["rm -rf {}".format(file_name)], shell=True) + subprocess.call(["rm -rf {}".format(file_name)]) else: lock.acquire() check_file.writelines("WARNING: {content}".format(content=title)) -- Gitee