Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
018f07a6
D
Dak
项目概览
喜羊羊3508
/
Dak
10 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
018f07a6
编写于
8月 06, 2012
作者:
A
Ansgar Burchardt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
daklib/archive.py, daklib/checks.py: implement transition blocks
上级
1ce4af9b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
67 addition
and
0 deletion
+67
-0
daklib/archive.py
daklib/archive.py
+1
-0
daklib/checks.py
daklib/checks.py
+66
-0
未找到文件。
daklib/archive.py
浏览文件 @
018f07a6
...
...
@@ -795,6 +795,7 @@ class ArchiveUpload(object):
for
chk
in
(
checks
.
SignatureCheck
,
checks
.
ChangesCheck
,
checks
.
TransitionCheck
,
checks
.
UploadBlockCheck
,
checks
.
HashesCheck
,
checks
.
SourceCheck
,
...
...
daklib/checks.py
浏览文件 @
018f07a6
...
...
@@ -457,6 +457,72 @@ class UploadBlockCheck(Check):
return
True
class
TransitionCheck
(
Check
):
"""check for a transition"""
def
check
(
self
,
upload
):
if
'source'
not
in
upload
.
changes
.
architectures
:
return
True
transitions
=
self
.
get_transitions
()
if
transitions
is
None
:
return
True
source
=
re_field_source
.
match
(
control
[
'Source'
]).
group
(
'package'
)
for
trans
in
transitions
:
t
=
transitions
[
trans
]
source
=
t
[
"source"
]
expected
=
t
[
"new"
]
# Will be None if nothing is in testing.
current
=
get_source_in_suite
(
source
,
"testing"
,
session
)
if
current
is
not
None
:
compare
=
apt_pkg
.
version_compare
(
current
.
version
,
expected
)
if
current
is
None
or
compare
<
0
:
# This is still valid, the current version in testing is older than
# the new version we wait for, or there is none in testing yet
# Check if the source we look at is affected by this.
if
source
in
t
[
'packages'
]:
# The source is affected, lets reject it.
rejectmsg
=
"{0}: part of the {1} transition.
\n\n
"
.
format
(
source
,
trans
)
if
current
is
not
None
:
currentlymsg
=
"at version {0}"
.
format
(
current
.
version
)
else
:
currentlymsg
=
"not present in testing"
rejectmsg
+=
"Transition description: {0}
\n\n
"
.
format
(
t
[
"reason"
])
rejectmsg
+=
"
\n
"
.
join
(
textwrap
.
wrap
(
"""Your package
is part of a testing transition designed to get {0} migrated (it is
currently {1}, we need version {2}). This transition is managed by the
Release Team, and {3} is the Release-Team member responsible for it.
Please mail debian-release@lists.debian.org or contact {3} directly if you
need further assistance. You might want to upload to experimental until this
transition is done."""
.
format
(
source
,
currentlymsg
,
expected
,
t
[
"rm"
])))
raise
Reject
(
rejectmsg
)
return
True
def
get_transitions
(
self
):
cnf
=
Config
()
path
=
cnf
.
get
(
'Dinstall::ReleaseTransitions'
,
''
)
if
path
==
''
or
not
os
.
path
.
exists
(
path
):
return
None
contents
=
file
(
path
,
'r'
).
read
()
try
:
transitions
=
yaml
.
load
(
contents
)
return
transitions
except
yaml
.
YAMLError
as
msg
:
utils
.
warn
(
'Not checking transitions, the transitions file is broken: {0}'
.
format
(
msg
))
return
None
class
NoSourceOnlyCheck
(
Check
):
"""Check for source-only upload
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录