Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
2a335c9e
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
43
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2a335c9e
编写于
6月 18, 2020
作者:
S
Shinwell Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check yaml correctly
上级
a9631c4e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
6 deletion
+13
-6
advisors/check_upstream.py
advisors/check_upstream.py
+5
-4
advisors/gitee.py
advisors/gitee.py
+8
-2
未找到文件。
advisors/check_upstream.py
浏览文件 @
2a335c9e
...
...
@@ -38,16 +38,16 @@ def load_last_query_result(info, force_reload=False):
def
clean_tags
(
tags
,
info
):
if
info
.
get
(
"tag_pattern"
,
""
)
!=
""
:
if
info
.
get
(
"tag_pattern"
,
""
)
!=
""
and
info
.
get
(
"tag_pattern"
,
""
)
is
not
None
:
pattern_regex
=
re
.
compile
(
info
[
"tag_pattern"
])
result_list
=
[
pattern_regex
.
sub
(
"
\\
1"
,
x
)
for
x
in
tags
]
elif
info
.
get
(
"tag_prefix"
,
""
)
!=
""
:
elif
info
.
get
(
"tag_prefix"
,
""
)
!=
""
and
info
.
get
(
"tag_prefix"
,
""
)
is
not
None
:
prefix_regex
=
re
.
compile
(
info
[
"tag_prefix"
])
result_list
=
[
prefix_regex
.
sub
(
""
,
x
)
for
x
in
tags
]
else
:
result_list
=
tags
if
info
.
get
(
"seperator"
,
"."
)
!=
"."
:
if
info
.
get
(
"seperator"
,
"."
)
!=
"."
and
info
.
get
(
"seperator"
,
"."
)
is
not
None
:
seperator_regex
=
re
.
compile
(
info
[
"seperator"
])
result_list
=
[
seperator_regex
.
sub
(
"."
,
x
)
for
x
in
result_list
]
...
...
@@ -84,7 +84,8 @@ def check_hg(info):
}
url
=
urljoin
(
info
[
"src_repo"
]
+
"/"
,
"json-tags"
)
resp
=
requests
.
get
(
url
,
headers
=
headers
)
need_trick
,
url
,
cookie
=
dirty_redirect_tricks
(
url
,
resp
.
text
)
resp
=
resp
.
text
need_trick
,
url
,
cookie
=
dirty_redirect_tricks
(
url
,
resp
)
if
need_trick
:
# I dont want to introduce another dependency on requests
# but urllib handling cookie is outragely complex
...
...
advisors/gitee.py
浏览文件 @
2a335c9e
...
...
@@ -131,10 +131,16 @@ Yours openEuler-Advisor.
get upstream yaml metadata for specific package
"""
yamlurl
=
self
.
advisor_url_template
.
format
(
package
=
pkg
)
resp
=
self
.
get_gitee
(
yamlurl
)
try
:
resp
=
self
.
get_gitee
(
yamlurl
)
except
urllib
.
error
.
HTTPError
:
resp
=
"Not found"
if
re
.
match
(
"Not found"
,
resp
):
yamlurl
=
self
.
yamlfile_url_template
.
format
(
package
=
pkg
)
resp
=
self
.
get_gitee
(
yamlurl
)
try
:
resp
=
self
.
get_gitee
(
yamlurl
)
except
urllib
.
error
.
HTTPError
:
resp
=
"Not found"
if
re
.
match
(
"Not found"
,
resp
):
print
(
"Cannot find upstream metadata"
)
return
False
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录