diff --git a/advisors/check_source_url.py b/advisors/check_source_url.py index 21fcdb2449e0c8de9c02b9d61e41422494eb5bb5..2f24e0cfea6a4c5ad42dac2db2c0e15d5fdfa43b 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))