diff --git a/advisors/check_missing_specs.py b/advisors/check_missing_specs.py index bca16fbc7ea40b6790c4306d1c6978883d2184c3..b26baff4208effbab758a3e003e628554cc8e00e 100755 --- a/advisors/check_missing_specs.py +++ b/advisors/check_missing_specs.py @@ -1,4 +1,16 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ """ This is a simple script to check if SPEC already been submit into repository. If not, it can be used to push an issue to remind the developer. @@ -72,8 +84,8 @@ def main(): break else: my_gitee.post_issue(args.repo, - "Submit spec file into this repository", - NEW_ISSUE_BODY.format(repo=args.repo)) + "Submit spec file into this repository", + NEW_ISSUE_BODY.format(repo=args.repo)) else: print("Keep this between us.") else: diff --git a/advisors/check_source_url.py b/advisors/check_source_url.py index 37b9392696615dfd6d1271672bdebf1c8c2d4a26..b2300bc0844cbeafff8d81033a42c7bfa3d4d446 100755 --- a/advisors/check_source_url.py +++ b/advisors/check_source_url.py @@ -58,8 +58,11 @@ def check_repo(repo, branch, batch_num): threads = [] lock = threading.Lock() for number in range(thread_num): - thread= threading.Thread(target=check_batch, args=(repo_list, branch, number, - batch_num, lock)) + thread = threading.Thread(target=check_batch, args=(repo_list, + branch, + number, + batch_num, + lock)) threads.append(thread) for thread in threads: thread.start() @@ -105,13 +108,13 @@ def check_pkg(pkg, branch, check_file, lock): """ user_gitee = gitee.Gitee() check_file.writelines("\n-----------------------Checking {}-----------------------".format( - pkg)) + pkg)) lock.acquire() spec_str = user_gitee.get_spec(pkg, branch) lock.acquire() if not spec_str: check_file.writelines("WARNING: {repo}.spec can't be found on {br}".format(repo=pkg, - br=branch)) + br=branch)) return False repo_spec = Spec.from_string(spec_str) @@ -136,7 +139,8 @@ def check_pkg(pkg, branch, check_file, lock): while down_cnt < 2: down_cnt += 1 if not subprocess.call(["timeout 15m wget -c {url} -O {name}".format(url=source, - name=file_name)], shell=True): + name=file_name)], + shell=True): break lock.release() diff --git a/advisors/check_upstream.py b/advisors/check_upstream.py index 2f80cc0a3eda43623afd6f60a7f9b005a820beee..46211a818da1d00b15b735491e1cc5584de60154 100755 --- a/advisors/check_upstream.py +++ b/advisors/check_upstream.py @@ -1,4 +1,16 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ """ This modules containers methods to check upstream version info """ @@ -486,7 +498,7 @@ def check_sourceforge(info, clean_tag=True): for tag_info in tag_infos: if filter_condition in tag_info: tag = tag_info.strip() - tag = tag.replace(filter_condition,"") + tag = tag.replace(filter_condition, "") tag = tag.strip("/download\"") tags.append(tag) if clean_tag: diff --git a/advisors/check_version.py b/advisors/check_version.py new file mode 100755 index 0000000000000000000000000000000000000000..45b9d202fa7a95e6f11f0cb3f918e5df80bcad25 --- /dev/null +++ b/advisors/check_version.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ +""" +This is an automatic script for checking source url of package +""" +import os +import argparse +from advisors import gitee +from advisors.oa_upgradable import main_process + + +def get_repos_by_sig(sig): + """ + Get repos by sig + """ + user_gitee = gitee.Gitee() + yaml_data = user_gitee.get_sigs() + + repo_list = [] + for sigs in yaml_data['sigs']: + if sig not in (sigs['name'], 'all'): + continue + repo_name = sigs['repositories'] + repo_list.append(repo_name) + repo_list = [i for item in repo_list for i in item] + return repo_list + + +def main(): + """ + Main process of the functionality + """ + parameters = argparse.ArgumentParser() + parameters.add_argument("-p", "--push", action="store_true", + help="Push the version bump as an issue to src-openeuler repository") + + parameters.add_argument("-d", "--default", type=str, default=os.getcwd(), + help="The fallback place to look for YAML information") + + parameters.add_argument("-s", "--sig", + help="Check yaml by Sig") + + args = parameters.parse_args() + if args.sig: + sig = args.sig + else: + sig = 'all' + + repos = get_repos_by_sig(sig) + + for repo in repos: + url = repo.split('/')[0] + if url == 'openeuler': + continue + try: + main_process(args.push, args.default, repo.split('/')[1]) + except Exception as error: + print("ERROR: Command execution error", error) + + +if __name__ == "__main__": + main() diff --git a/advisors/create_repo.py b/advisors/create_repo.py index 904693d6fd1f6120a70b60f2068bbb2be1c9a425..b1b19f2784cef878adeac5651186a2907e07898c 100755 --- a/advisors/create_repo.py +++ b/advisors/create_repo.py @@ -1,4 +1,16 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ """ This is a command line tool for adding new repo """ @@ -59,7 +71,7 @@ def main(): if sig["name"] == args.sig: sig["repositories"].append(repo["community"] + "/" + args.name) sig["repositories"].sort() - valid_sig=True + valid_sig = True continue if valid_sig: diff --git a/advisors/create_repo_with_srpm.py b/advisors/create_repo_with_srpm.py index 26b861fbc6f2d93474b4f6616422c8f436e8cb68..577a0145f954f4c5b67105b1bf5690c13c981675 100755 --- a/advisors/create_repo_with_srpm.py +++ b/advisors/create_repo_with_srpm.py @@ -1,4 +1,16 @@ #!/usr/bin/python3 +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ """ This is a command line tool for adding new repo """ @@ -103,7 +115,7 @@ def main(): if sig["name"] == args.sig: sig["repositories"].append(repo["community"] + "/" + pkg_info["name"]) sig["repositories"].sort() - valid_sig=True + valid_sig = True continue if valid_sig: diff --git a/advisors/gitee.py b/advisors/gitee.py index b6217f5dfac9f8b6bb718de2c6f1e7c2b5a75425..14dab42808cde41e35ca9ee9060a9a85a1bb5dcc 100755 --- a/advisors/gitee.py +++ b/advisors/gitee.py @@ -262,6 +262,16 @@ class Gitee(): print("WARNING: {}.yaml can't be found in upstream-info and repo.".format(pkg)) return resp + def get_sigs(self): + """ + Get upstream sigs + """ + sigs_url = "https://gitee.com/openeuler/community/raw/master/sig/sigs.yaml" + req = urllib.request.Request(url=sigs_url, headers=self.headers) + data = urllib.request.urlopen(req) + sigs = yaml.load(data.read().decode("utf-8"), Loader=yaml.Loader) + return sigs + def get_community(self, repo): """ Get yaml data from community repo diff --git a/advisors/oa_upgradable.py b/advisors/oa_upgradable.py index 468cd97e149c0df2469632aa841dca82a2f2ae42..9e584825939309920b5e845aee33722919ada597 100755 --- a/advisors/oa_upgradable.py +++ b/advisors/oa_upgradable.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -#****************************************************************************** +# ****************************************************************************** # Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. # licensed under the Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -15,7 +15,6 @@ This is a script to check upgradable information against upstream """ import os -import sys import argparse import re from pyrpm.spec import Spec, replace_macros @@ -63,20 +62,20 @@ def get_ver_tags(my_gitee, repo, clean_tag=True, cwd_path=None): return None switcher = { - "hg":check_upstream.check_hg, - "hg-raw":check_upstream.check_hg_raw, - "github":check_upstream.check_github, - "git":check_upstream.check_git, - "gitlab.gnome":check_upstream.check_gnome, - "svn":check_upstream.check_svn, - "metacpan":check_upstream.check_metacpan, - "pypi":check_upstream.check_pypi, - "rubygem":check_upstream.check_rubygem, - "gitee":check_upstream.check_gitee, - "gnu-ftp":check_upstream.check_gnu_ftp, - "ftp":check_upstream.check_ftp, - "sourceforge":check_upstream.check_sourceforge - } + "hg": check_upstream.check_hg, + "hg-raw": check_upstream.check_hg_raw, + "github": check_upstream.check_github, + "git": check_upstream.check_git, + "gitlab.gnome": check_upstream.check_gnome, + "svn": check_upstream.check_svn, + "metacpan": check_upstream.check_metacpan, + "pypi": check_upstream.check_pypi, + "rubygem": check_upstream.check_rubygem, + "gitee": check_upstream.check_gitee, + "gnu-ftp": check_upstream.check_gnu_ftp, + "ftp": check_upstream.check_ftp, + "sourceforge": check_upstream.check_sourceforge + } check_method = switcher.get(vc_type, None) if check_method: @@ -104,14 +103,20 @@ def main(): help="Repository to be checked for upstream version info") args = parameters.parse_args() + main_process(args.push, args.default, args.repo) - print("Checking", args.repo) + +def main_process(push, default, repo): + """ + Main process of the functionality + """ + print("Checking", repo) user_gitee = gitee.Gitee() - spec_string = user_gitee.get_spec(args.repo) + spec_string = user_gitee.get_spec(repo) if not spec_string: - print("WARNING: {pkg}.spec can't be found on master".format(pkg=args.repo)) - sys.exit(1) + print("WARNING: {pkg}.spec can't be found on master".format(pkg=repo)) + return spec_file = Spec.from_string(spec_string) cur_version = replace_macros(spec_file.version, spec_file) @@ -119,14 +124,14 @@ def main(): cur_version = cur_version[1:] print("Current version is", cur_version) - pkg_tags = get_ver_tags(user_gitee, args.repo, cwd_path=args.default) + pkg_tags = get_ver_tags(user_gitee, repo, cwd_path=default) print("known release tags:", pkg_tags) if pkg_tags is None: - sys.exit(1) + return if cur_version not in pkg_tags: - print("WARNING: Current {ver} doesn't exist in upstream."\ + print("WARNING: Current {ver} doesn't exist in upstream." \ "Please double check.".format(ver=cur_version)) ver_rec = version_recommend.VersionRecommend(pkg_tags, cur_version, 0) @@ -135,8 +140,8 @@ def main(): print("Maintain version is", ver_rec.maintain_version) if cur_version != ver_rec.latest_version: - if args.push: - user_gitee.post_issue(args.repo, "Upgrade to latest release", """Dear {repo} maintainer: + if push: + user_gitee.post_issue(repo, "Upgrade to latest release", """Dear {repo} maintainer: We found the latest version of {repo} is {ver}, while the current version in openEuler mainline is {cur_ver}. @@ -145,7 +150,7 @@ Please consider upgrading. Yours openEuler Advisor. If you think this is not proper issue, Please visit https://gitee.com/openeuler/openEuler-Advisor. -Issues and feedbacks are welcome.""".format(repo=args.repo, +Issues and feedbacks are welcome.""".format(repo=repo, ver=ver_rec.latest_version, cur_ver=cur_version)) diff --git a/advisors/package_type.py b/advisors/package_type.py new file mode 100755 index 0000000000000000000000000000000000000000..049300ff38ff33dd057b9d94977f6fc2b6ddb431 --- /dev/null +++ b/advisors/package_type.py @@ -0,0 +1,140 @@ +#!/usr/bin/python3 +# ****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ +""" +The class of the package_type, used to get the package type of repo. +""" + +import subprocess +import tempfile +from pyrpm.spec import Spec +from advisors import gitee + + +class PackageType: + """Class for package type""" + + def __init__(self, repo): + """ + Initialize. + + :param None: No parameter + :returns: None + :raises: None + """ + self.repo = repo + self.pkg_type = self.get_pkg_type() + + @staticmethod + def download_pkg(pkg_name, dir_name): + """ + Download package. + + :param pkg_name: Package name + :param dir_name: Package dir name + :returns: Package path + :raises: None + """ + cmd_list = ['yumdownloader', '--destdir', dir_name, pkg_name] + subp = subprocess.Popen(cmd_list, stdout=subprocess.PIPE) + if subp.wait() != 0: + print("WARNING", "{cmd} > encount errors".format(cmd=" ".join(cmd_list))) + return None + + return dir_name + '/' + "*.rpm" + + @staticmethod + def delete_pkg(dir_name): + """ + Delete package. + + :param dir_name: Package dir name + :returns: None + :raises: None + """ + cmd_list = ['rm', '-rf', dir_name] + subp = subprocess.Popen(cmd_list, stdout=subprocess.PIPE) + if subp.wait() != 0: + print("WARNING", "{cmd} > encount errors".format(cmd=" ".join(cmd_list))) + + @staticmethod + def get_lib_path(pkg_path): + """ + Get library path. + + :param pkg_path: Package path + :returns: library path of package + :raises: None + """ + cmd_list = ['rpm', '-ql', pkg_path] + subp = subprocess.Popen(cmd_list, stdout=subprocess.PIPE) + if subp.wait() != 0: + print("WARNING", "{cmd} > encount errors".format(cmd=" ".join(cmd_list))) + return None + + lib_path = [] + resp = subp.stdout.read().decode("utf-8") + result = resp.splitlines() + for line in result: + if line.endswith('.so') or '.so.' in line: + lib_path.append(line) + return lib_path + + @property + def _get_pkg_lib(self): + """ + Get package library. + + :param None: None + :returns: library path list of package + :raises: None + """ + user_gitee = gitee.Gitee() + spec_string = user_gitee.get_spec(self.repo) + if not spec_string: + print("WARNING: {pkg}.spec can't be found on master".format(pkg=self.repo)) + return None + + lib_list = [] + spec_file = Spec.from_string(spec_string) + with tempfile.TemporaryDirectory() as dir_name: + for pkg_name in spec_file.packages_dict.keys(): + pkg_path = self.download_pkg(pkg_name, dir_name) + if not pkg_path: + continue + lib_path = self.get_lib_path(pkg_path) + if lib_path: + lib_list.extend(lib_path) + self.delete_pkg(pkg_path) + return list(set(lib_list)) + + def get_pkg_type(self): + """ + Get package type,refer to + https://gitee.com/openeuler/community/blob/master/zh/technical-committee/governance/software-management.md + + :param None: None + :returns: Package type + :raises: None + """ + if 'python' in self.repo or 'perl' in self.repo: + return 'app' + + if self.repo == 'gcc' or self.repo == 'kernel' or self.repo == 'glibc': + return 'core' + + lib_list = self._get_pkg_lib + if lib_list: + return 'lib' + + return 'app' diff --git a/advisors/tc_reminder.py b/advisors/tc_reminder.py index f742cc1ad7259222fbc606f4b304f7403fad6683..035f4bd10628fad007c91203bac027e75f136cbe 100755 --- a/advisors/tc_reminder.py +++ b/advisors/tc_reminder.py @@ -1,11 +1,22 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +# ****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ """ This is a command line tool to create reminder list for TC member """ import os import json -import argparse import urllib import urllib.request import urllib.parse @@ -13,15 +24,16 @@ from datetime import datetime import yaml -class Advisor(object): +class Advisor(): """ This is a object abstract TC robot """ + def __init__(self): self.secret = open(os.path.expanduser("~/.gitee_personal_token.json"), "r") self.token = json.load(self.secret) - self.header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) "\ - "Gecko/20100101 Firefox/50.0"} + self.header = {"User-Agent": '''Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) + Gecko/20100101 Firefox/50.0'''} self.tc_members = None self.time_format = "%Y-%m-%dT%H:%M:%S%z" @@ -31,7 +43,7 @@ class Advisor(object): """ headers = self.header.copy() headers["Content-Type"] = "application/json;charset=UTF-8" - req = urllib.request.Request(url = url, headers = headers, method = "GET") + req = urllib.request.Request(url=url, headers=headers, method="GET") with urllib.request.urlopen(req) as result: resp = json.loads(result.read().decode("utf-8")) return resp @@ -41,7 +53,7 @@ class Advisor(object): Get remote raw file """ url = "https://gitee.com/{repo}/raw/master/{path}".format(repo=repo, path=path) - req = urllib.request.Request(url = url, headers = self.header, method = "GET") + req = urllib.request.Request(url=url, headers=self.header, method="GET") with urllib.request.urlopen(req) as result: resp = result.read() return resp @@ -51,7 +63,7 @@ class Advisor(object): Get list of PRs """ pulls_url = "https://gitee.com/api/v5/repos/openeuler/community/pulls" - list_url = pulls_url + "?access_token={token}&state=open&sort=created&"\ + list_url = pulls_url + "?access_token={token}&state=open&sort=created&" \ "direction=desc&page=1&per_page=100" url = list_url.format(token=self.token["access_token"]) return self.get_json(url) @@ -87,9 +99,6 @@ def main(): """ Main entrance of the functionality """ - par = argparse.ArgumentParser() - args = par.parse_args() - advisor = Advisor() pr_list = advisor.get_prs() pr_list.reverse() @@ -108,7 +117,7 @@ def main(): commenters.append(comment["user"]["login"]) if comment["body"].startswith("new changes are detected"): last_update = datetime.strptime(comment["updated_at"], advisor.time_format) - break # older comments are ignored + break # older comments are ignored if comment["body"].startswith("***lgtm*** is added in this pull request"): current_lgtm = current_lgtm + 1 elif comment["body"].startswith("***approved*** is added in this pull request"): diff --git a/advisors/version_recommend.py b/advisors/version_recommend.py index f59b589ba09a84e19ea48b765531e618e0e1f9fc..4daa8ed4a1c55615b31606806241c4b7edb85a7b 100755 --- a/advisors/version_recommend.py +++ b/advisors/version_recommend.py @@ -1,4 +1,16 @@ -#!-*- coding:utf-8 -*- +#!/usr/bin/env python3 +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ import re import datetime @@ -608,7 +620,7 @@ class VersionTypeX(VersionType): """ if 1 == len(version_entry): # 仅一个版本,当前即为最新版本 return version_entry[0] - version_list: List[List[str]] = [] + version_list = [] for version in version_entry: version_list.append(re.split(r'[._-]', version)) # 将 version 拆分为列表,方便后续比较 x = '0' diff --git a/command/check_version b/command/check_version new file mode 100755 index 0000000000000000000000000000000000000000..5894a2160af888743f14e71eb11bcbb9eb30b03f --- /dev/null +++ b/command/check_version @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# +# ******************************************************************************/ +""" +This is an automatic script for checking version of all repo in sigs.yaml +""" +from advisors.check_version import main + + +if __name__ == '__main__': + try: + main() + except Exception as error: + print("WARNING: Command execution error") + print(error.message)