Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
7c58b4d5
D
Dak
项目概览
喜羊羊3508
/
Dak
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
7c58b4d5
编写于
8月 16, 2008
作者:
M
Mark Hymers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
misc fixes
Signed-off-by:
N
Mark Hymers
<
mhy@debian.org
>
上级
6e7061de
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
21 addition
and
19 deletion
+21
-19
ChangeLog
ChangeLog
+2
-0
dak/process_accepted.py
dak/process_accepted.py
+1
-1
dak/process_unchecked.py
dak/process_unchecked.py
+1
-8
daklib/utils.py
daklib/utils.py
+17
-10
未找到文件。
ChangeLog
浏览文件 @
7c58b4d5
2008
-
08
-
15
Mark
Hymers
<
mhy
@
debian
.
org
>
*
daklib
/
utils
.
py
:
Actually
import
a
module
before
using
it
.
*
daklib
/
utils
.
py
:
Actually
check
we
have
basedict
before
trying
to
use
it
.
...
...
dak/process_accepted.py
浏览文件 @
7c58b4d5
...
...
@@ -276,7 +276,7 @@ def install ():
# Check the hashes are all present: HACK: Can go away once all dak files
# are known to be newer than the shasum changes
utils
.
ensure_hashes
(
Upload
)
utils
.
ensure_hashes
(
changes
,
dsc
,
files
,
dsc_files
)
# Add the .dsc file to the DB
for
file
in
files
.
keys
():
...
...
dak/process_unchecked.py
浏览文件 @
7c58b4d5
...
...
@@ -919,19 +919,12 @@ def check_urgency ():
################################################################################
def
check_hashes
():
# Make sure we recognise the format of the Files: field
format
=
changes
.
get
(
"format"
,
"0.0"
).
split
(
"."
,
1
)
if
len
(
format
)
==
2
:
format
=
int
(
format
[
0
]),
int
(
format
[
1
])
else
:
format
=
int
(
float
(
format
[
0
])),
0
utils
.
check_hash
(
".changes"
,
files
,
"md5sum"
,
apt_pkg
.
md5sum
)
utils
.
check_hash
(
".dsc"
,
dsc_files
,
"md5sum"
,
apt_pkg
.
md5sum
)
# This is stupid API, but it'll have to do for now until
# we actually have proper abstraction
for
m
in
utils
.
ensure_hashes
(
Upload
):
for
m
in
utils
.
ensure_hashes
(
changes
,
dsc
,
files
,
dsc_files
):
reject
(
m
)
################################################################################
...
...
daklib/utils.py
浏览文件 @
7c58b4d5
...
...
@@ -262,15 +262,22 @@ def check_hash (where, lfiles, key, testfn, basedict = None):
################################################################################
def
ensure_hashes
(
Upload
):
def
ensure_hashes
(
changes
,
dsc
,
files
,
dsc_files
):
# Make sure we recognise the format of the Files: field
format
=
changes
.
get
(
"format"
,
"0.0"
).
split
(
"."
,
1
)
if
len
(
format
)
==
2
:
format
=
int
(
format
[
0
]),
int
(
format
[
1
])
else
:
format
=
int
(
float
(
format
[
0
])),
0
rejmsg
=
[]
for
x
in
Upload
.
changes
:
for
x
in
changes
:
if
x
.
startswith
(
"checksum-"
):
h
=
x
.
split
(
"-"
,
1
)[
1
]
if
h
not
in
dict
(
known_hashes
):
rejmsg
.
append
(
"Unsupported checksum field in .changes"
%
(
h
))
for
x
in
Upload
.
dsc
:
for
x
in
dsc
:
if
x
.
startswith
(
"checksum-"
):
h
=
x
.
split
(
"-"
,
1
)[
1
]
if
h
not
in
dict
(
known_hashes
):
...
...
@@ -281,12 +288,12 @@ def ensure_hashes(Upload):
# I hate backwards compatibility
for
h
,
f
,
v
in
known_hashes
:
try
:
fs
=
build_file_list
(
Upload
.
changes
,
0
,
"checksums-%s"
%
h
,
h
)
fs
=
build_file_list
(
changes
,
0
,
"checksums-%s"
%
h
,
h
)
if
format
<
v
:
for
m
in
create_hash
(
fs
,
h
,
f
,
Upload
.
files
):
for
m
in
create_hash
(
fs
,
h
,
f
,
files
):
rejmsg
.
append
(
m
)
else
:
for
m
in
check_hash
(
".changes %s"
%
(
h
),
fs
,
h
,
f
,
Upload
.
files
):
for
m
in
check_hash
(
".changes %s"
%
(
h
),
fs
,
h
,
f
,
files
):
rejmsg
.
append
(
m
)
except
NoFilesFieldError
:
rejmsg
.
append
(
"No Checksums-%s: field in .changes"
%
(
h
))
...
...
@@ -295,15 +302,15 @@ def ensure_hashes(Upload):
except
ParseChangesError
,
line
:
rejmsg
.
append
(
"parse error for Checksums-%s in .changes, can't grok: %s."
%
(
h
,
line
))
if
"source"
not
in
Upload
.
changes
[
"architecture"
]:
continue
if
"source"
not
in
changes
[
"architecture"
]:
continue
try
:
fs
=
build_file_list
(
Upload
.
dsc
,
1
,
"checksums-%s"
%
h
,
h
)
fs
=
build_file_list
(
dsc
,
1
,
"checksums-%s"
%
h
,
h
)
if
format
<
v
:
for
m
in
create_hash
(
fs
,
h
,
f
,
Upload
.
dsc_files
):
for
m
in
create_hash
(
fs
,
h
,
f
,
dsc_files
):
rejmsg
.
append
(
m
)
else
:
for
m
in
check_hash
(
".dsc %s"
%
(
h
),
fs
,
h
,
f
,
Upload
.
dsc_files
):
for
m
in
check_hash
(
".dsc %s"
%
(
h
),
fs
,
h
,
f
,
dsc_files
):
rejmsg
.
append
(
m
)
except
UnknownFormatError
,
format
:
rejmsg
.
append
(
"%s: unknown format of .dsc"
%
(
format
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录