Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
a3a66d4d
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 搜索 >>
提交
a3a66d4d
编写于
6月 27, 2018
作者:
B
Bastian Blank
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Convert remaing compare functions
上级
3dad6e42
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
13 deletion
+16
-13
dak/control_suite.py
dak/control_suite.py
+3
-2
dak/cruft_report.py
dak/cruft_report.py
+4
-4
dak/queue_report.py
dak/queue_report.py
+6
-5
dak/rm.py
dak/rm.py
+1
-1
daklib/rm.py
daklib/rm.py
+2
-1
未找到文件。
dak/control_suite.py
浏览文件 @
a3a66d4d
...
...
@@ -45,6 +45,7 @@ from __future__ import print_function
import
sys
import
apt_pkg
import
functools
import
os
from
daklib.archive
import
ArchiveTransaction
...
...
@@ -246,7 +247,7 @@ def set_suite(file, suite, transaction, britney=False, force=False):
desired
.
add
(
tuple
(
split_line
))
# Check to see which packages need added and add them
for
key
in
sorted
(
desired
,
cmp
=
cmp_package_version
):
for
key
in
sorted
(
desired
,
cmp
=
functools
.
cmp_to_key
(
cmp_package_version
)
):
if
key
not
in
current
:
(
package
,
version
,
architecture
)
=
key
version_checks
(
package
,
architecture
,
suite
.
suite_name
,
version
,
session
,
force
)
...
...
@@ -299,7 +300,7 @@ def process_file(file, suite, action, transaction, britney=False, force=False):
continue
request
.
append
(
split_line
)
request
.
sort
(
cmp
=
cmp_package_version
)
request
.
sort
(
key
=
functools
.
cmp_to_key
(
cmp_package_version
)
)
for
package
,
version
,
architecture
in
request
:
pkg
=
get_pkg
(
package
,
version
,
architecture
,
session
)
...
...
dak/cruft_report.py
浏览文件 @
a3a66d4d
...
...
@@ -116,7 +116,7 @@ def do_anais(architecture, binaries_list, source, session):
version
=
i
[
1
]
if
arch
in
architectures
:
versions
.
append
(
version
)
versions
.
sort
(
apt_pkg
.
version_compare
)
versions
.
sort
(
key
=
functools
.
cmp_to_key
(
apt_pkg
.
version_compare
)
)
if
versions
:
latest_version
=
versions
.
pop
()
else
:
...
...
@@ -133,7 +133,7 @@ def do_anais(architecture, binaries_list, source, session):
if
versions_d
!=
{}:
anais_output
+=
"
\n
(*) %s_%s [%s]: %s
\n
"
%
(
binary
,
latest_version
,
source
,
architecture
)
versions
=
versions_d
.
keys
()
versions
.
sort
(
apt_pkg
.
version_compare
)
versions
.
sort
(
key
=
functools
.
cmp_to_key
(
apt_pkg
.
version_compare
)
)
for
version
in
versions
:
arches
=
versions_d
[
version
]
arches
.
sort
()
...
...
@@ -326,7 +326,7 @@ def do_dubious_nbs(dubious_nbs):
source_binaries
.
get
(
source
,
"(source does not exist)"
)))
print
(
" won't admit to building:"
)
versions
=
dubious_nbs
[
source
].
keys
()
versions
.
sort
(
apt_pkg
.
version_compare
)
versions
.
sort
(
key
=
functools
.
cmp_to_key
(
apt_pkg
.
version_compare
)
)
for
version
in
versions
:
packages
=
dubious_nbs
[
source
][
version
].
keys
()
packages
.
sort
()
...
...
@@ -679,7 +679,7 @@ def main():
for
source
in
nbs
.
keys
():
for
package
in
nbs
[
source
].
keys
():
versions
=
nbs
[
source
][
package
].
keys
()
versions
.
sort
(
apt_pkg
.
version_compare
)
versions
.
sort
(
key
=
functools
.
cmp_to_key
(
apt_pkg
.
version_compare
)
)
latest_version
=
versions
.
pop
()
source_version
=
source_versions
.
get
(
source
,
"0"
)
if
apt_pkg
.
version_compare
(
latest_version
,
source_version
)
==
0
:
...
...
dak/queue_report.py
浏览文件 @
a3a66d4d
...
...
@@ -41,6 +41,7 @@ import sys
import
time
import
apt_pkg
import
datetime
import
functools
try
:
import
rrdtool
...
...
@@ -143,7 +144,7 @@ def sg_compare(a, b):
return
1
# Sort by time of oldest upload
return
cmp
(
a
[
"oldest"
],
b
[
"oldest"
])
return
a
[
"oldest"
]
-
b
[
"oldest"
]
############################################################
...
...
@@ -405,7 +406,7 @@ def process_queue(queue, log, rrd_dir):
per_source
[
source
][
"processed"
]
=
"PENDING %s"
%
handler
.
get_action
()
total_pending
+=
1
per_source
[
source
][
"list"
].
append
(
upload
)
per_source
[
source
][
"list"
].
sort
(
lambda
x
,
y
:
cmp
(
x
.
changes
.
created
,
y
.
changes
.
created
)
,
reverse
=
True
)
per_source
[
source
][
"list"
].
sort
(
key
=
lambda
x
:
x
.
changes
.
created
,
reverse
=
True
)
# Determine oldest time and have note status for each source group
for
source
in
per_source
.
keys
():
source_list
=
per_source
[
source
][
"list"
]
...
...
@@ -429,7 +430,7 @@ def process_queue(queue, log, rrd_dir):
else
:
per_source
[
source
][
"note_state"
]
=
2
# all
per_source_items
=
per_source
.
items
()
per_source_items
.
sort
(
sg_compare
)
per_source_items
.
sort
(
key
=
functools
.
cmp_to_key
(
sg_compare
)
)
update_graph_database
(
rrd_dir
,
type
,
len
(
per_source_items
),
len
(
queue
.
uploads
))
...
...
@@ -547,7 +548,7 @@ def process_queue(queue, log, rrd_dir):
elif
i
==
"nf"
:
# Notes first.
direction
.
append
([
5
,
-
1
,
0
])
entries
.
sort
(
sortfunc
)
entries
.
sort
(
key
=
functools
.
cmp_to_key
(
sortfunc
)
)
# Yes, in theory you can add several sort options at the commandline with. But my mind is to small
# at the moment to come up with a real good sorting function that considers all the sidesteps you
# have with it. (If you combine options it will simply take the last one at the moment).
...
...
@@ -594,7 +595,7 @@ def process_queue(queue, log, rrd_dir):
if
"Queue-Report::Options::New"
in
Cnf
:
direction
.
append
([
6
,
1
,
"ao"
])
entries
.
sort
(
sortfunc
)
entries
.
sort
(
key
=
functools
.
cmp_to_key
(
sortfunc
)
)
# Output for a html file. First table header. then table_footer.
# Any line between them is then a <tr> printed from subroutine table_row.
if
len
(
entries
)
>
0
:
...
...
dak/rm.py
浏览文件 @
a3a66d4d
...
...
@@ -345,7 +345,7 @@ def main():
removals
.
sort
()
for
package
in
removals
:
versions
=
d
[
package
].
keys
()
versions
.
sort
(
apt_pkg
.
version_compare
)
versions
.
sort
(
key
=
functools
.
cmp_to_key
(
apt_pkg
.
version_compare
)
)
for
version
in
versions
:
d
[
package
][
version
].
sort
(
key
=
utils
.
ArchKey
)
summary
+=
"%10s | %10s | %s
\n
"
%
(
package
,
version
,
", "
.
join
(
d
[
package
][
version
]))
...
...
daklib/rm.py
浏览文件 @
a3a66d4d
...
...
@@ -44,6 +44,7 @@ from __future__ import absolute_import, print_function
import
commands
import
apt_pkg
import
fcntl
import
functools
import
sqlalchemy.sql
as
sql
from
re
import
sub
from
collections
import
defaultdict
...
...
@@ -400,7 +401,7 @@ def remove(session, reason, suites, removals,
d
[
package
][
version
].
append
(
architecture
)
for
package
in
sorted
(
d
):
versions
=
sorted
(
d
[
package
],
cmp
=
apt_pkg
.
version_compare
)
versions
=
sorted
(
d
[
package
],
key
=
functools
.
cmp_to_key
(
apt_pkg
.
version_compare
)
)
for
version
in
versions
:
d
[
package
][
version
].
sort
(
key
=
utils
.
ArchKey
)
summary
+=
"%10s | %10s | %s
\n
"
%
(
package
,
version
,
", "
.
join
(
d
[
package
][
version
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录