提交 98134cbf 编写于 作者: L Leo Fang

Improve advisors

1.revert: priority get_yaml from upstream-info
2.ignore version ending with a/b in tags
3.modify specfile_excpt and ver_rec_excpt
4.fix for os.chdir in download_src
5.improve prombt
上级 2d108684
......@@ -133,20 +133,20 @@ Yours openEuler-Advisor.
"""
Get upstream yaml metadata for specific package
"""
yamlurl = self.yamlfile_url_template.format(branch=br, package=pkg)
yamlurl = self.advisor_url_template.format(package=pkg)
try:
resp = self.get_gitee(yamlurl)
except urllib.error.HTTPError:
resp = "Not found"
print("WARNING: {repo}.yaml can't be found in repo on {branch}".format(repo=pkg, branch=br))
print("WARNING: {repo}.yaml can't be found in upstream-info.".format(repo=pkg))
if re.match("Not found", resp):
yamlurl = self.advisor_url_template.format(package=pkg)
yamlurl = self.yamlfile_url_template.format(branch=br, package=pkg)
try:
resp = self.get_gitee(yamlurl)
except urllib.error.HTTPError:
resp = "Not found"
if re.match("Not found", resp):
print("WARNING: {repo}.yaml can't be found in upstream-info too.".format(repo=pkg))
print("WARNING: {repo}.yaml can't be found in repo on {branch} too".format(repo=pkg, branch=br))
return False
else:
return resp
......
......@@ -2,9 +2,6 @@
libnetwork:
dir: script
file: docker-proxy.spec
authz:
dir: hack
file: authz.spec
lxcfs-tools:
dir: hack
file: lxcfs-tools.spec
......@@ -52,4 +49,4 @@ A-Tune:
file: atune.spec
runc:
dir: .
file: runc-openeuler.spec
\ No newline at end of file
file: runc-openeuler.spec
......@@ -18,3 +18,8 @@ kata-agent:
- '20191207'
kexec-tools:
- '200'
sombok:
- '2011'
shadow:
- '1999'
- '2000'
......@@ -44,7 +44,7 @@ def get_ver_tags(gt, repo, cwd_path=None):
try:
repo_yaml = open(os.path.join(cwd_path, repo + ".yaml")).read()
except FileNotFoundError:
print("Cann't find yaml metadata for {pkg} from current working directory.".format(pkg=repo))
print("WARNING: {pkg}.yaml can't be found in local path: {path}.".format(pkg=repo, path=cwd_path))
repo_yaml = gt.get_yaml(repo)
else:
repo_yaml = gt.get_yaml(repo)
......@@ -93,7 +93,7 @@ if __name__ == "__main__":
user_gitee = gitee.Gitee()
spec_string = user_gitee.get_spec(args.repo)
if not spec_string:
print("{pkg}.spec can't be found on the master branch".format(pkg=args.repo))
print("WARNING: {pkg}.spec can't be found on master".format(pkg=args.repo))
sys.exit(1)
spec_file = Spec.from_string(spec_string)
......
......@@ -99,7 +99,7 @@ def download_src(gt, spec, o_ver, n_ver):
"""
Download source code for upgraded package
"""
os.chdir(spec.name)
os.chdir(replace_macros(spec.name, spec))
source_file = download_source_url(spec, o_ver, n_ver)
if source_file:
print(source_file)
......
......@@ -1089,7 +1089,7 @@ class VersionRecommend(object):
if m is None: # 版本号应该是数字开头
return False
m = re.search(r'[ab]\d', version)
m = re.search(r'[ab]', version)
if not m is None:
return False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册