Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
6313f93d
D
Dak
项目概览
喜羊羊3508
/
Dak
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
6313f93d
编写于
7月 08, 2012
作者:
L
Luca Falavigna
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement rdeps checking in cruft-report
Signed-off-by:
N
Luca Falavigna
<
dktrkranz@debian.org
>
上级
13a234f6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
12 deletion
+40
-12
dak/cruft_report.py
dak/cruft_report.py
+40
-12
未找到文件。
dak/cruft_report.py
浏览文件 @
6313f93d
...
...
@@ -60,6 +60,7 @@ Check for obsolete or duplicated packages.
-h, --help show this help and exit.
-m, --mode=MODE chose the MODE to run in (full, daily, bdo).
-s, --suite=SUITE check suite SUITE.
-R, --rdep-check check reverse dependencies
-w, --wanna-build-dump where to find the copies of http://buildd.debian.org/stats/*.txt"""
sys
.
exit
(
exit_code
)
...
...
@@ -229,7 +230,7 @@ def queryWithoutSource(suite_id, session):
order by ub.package"""
return
session
.
execute
(
query
,
{
'suite_id'
:
suite_id
})
def
reportWithoutSource
(
suite_name
,
suite_id
,
session
):
def
reportWithoutSource
(
suite_name
,
suite_id
,
session
,
rdeps
=
False
):
rows
=
queryWithoutSource
(
suite_id
,
session
)
title
=
'packages without source in suite %s'
%
suite_name
if
rows
.
rowcount
>
0
:
...
...
@@ -240,8 +241,15 @@ def reportWithoutSource(suite_name, suite_id, session):
print
"* package %s in version %s is no longer built from source"
%
\
(
package
,
version
)
print
" - suggested command:"
print
" dak rm -m %s -s %s -a all -p -R -b %s
\n
"
%
\
print
" dak rm -m %s -s %s -a all -p -R -b %s"
%
\
(
message
,
suite_name
,
package
)
if
rdeps
:
if
utils
.
check_reverse_depends
([
package
],
suite_name
,
[
"all"
],
session
,
True
):
print
else
:
print
" - No dependency problem found
\n
"
else
:
print
def
queryNewerAll
(
suite_name
,
session
):
"""searches for arch != all packages that have an arch == all
...
...
@@ -361,7 +369,7 @@ with uptodate_arch as
select * from outdated_packages order by source"""
return
session
.
execute
(
query
,
{
'suite_id'
:
suite_id
})
def
reportNBS
(
suite_name
,
suite_id
):
def
reportNBS
(
suite_name
,
suite_id
,
rdeps
=
False
):
session
=
DBConn
().
session
()
nbsRows
=
queryNBS
(
suite_id
,
session
)
title
=
'NBS packages in suite %s'
%
suite_name
...
...
@@ -377,14 +385,21 @@ def reportNBS(suite_name, suite_id):
print
" on %s"
%
arch_string
print
" - suggested command:"
message
=
'"[auto-cruft] NBS (no longer built by %s)"'
%
source
print
" dak rm -m %s -s %s -a %s -p -R -b %s
\n
"
%
\
print
" dak rm -m %s -s %s -a %s -p -R -b %s"
%
\
(
message
,
suite_name
,
arch_string
,
pkg_string
)
if
rdeps
:
if
utils
.
check_reverse_depends
(
pkg_list
,
suite_name
,
arch_list
,
session
,
True
):
print
else
:
print
" - No dependency problem found
\n
"
else
:
print
session
.
close
()
def
reportAllNBS
(
suite_name
,
suite_id
,
session
):
reportWithoutSource
(
suite_name
,
suite_id
,
session
)
def
reportAllNBS
(
suite_name
,
suite_id
,
session
,
rdeps
=
False
):
reportWithoutSource
(
suite_name
,
suite_id
,
session
,
rdeps
)
reportNewerAll
(
suite_name
,
session
)
reportNBS
(
suite_name
,
suite_id
)
reportNBS
(
suite_name
,
suite_id
,
rdeps
)
################################################################################
...
...
@@ -506,7 +521,7 @@ def get_suite_binaries(suite, session):
################################################################################
def
report_outdated_nonfree
(
suite
,
session
):
def
report_outdated_nonfree
(
suite
,
session
,
rdeps
=
False
):
packages
=
{}
query
=
"""WITH outdated_sources AS (
...
...
@@ -572,8 +587,15 @@ def report_outdated_nonfree(suite, session):
for
binary
in
sorted
(
packages
[
source
]):
binaries
.
add
(
binary
)
archs
=
archs
.
union
(
packages
[
source
][
binary
])
print
' dak rm -m %s -s %s -a %s -p -R -b %s
\n
'
%
\
print
' dak rm -m %s -s %s -a %s -p -R -b %s'
%
\
(
message
,
suite
,
','
.
join
(
archs
),
' '
.
join
(
binaries
))
if
rdeps
:
if
utils
.
check_reverse_depends
(
list
(
binaries
),
suite
,
archs
,
session
,
True
):
print
else
:
print
" - No dependency problem found
\n
"
else
:
print
################################################################################
...
...
@@ -584,9 +606,10 @@ def main ():
Arguments
=
[(
'h'
,
"help"
,
"Cruft-Report::Options::Help"
),
(
'm'
,
"mode"
,
"Cruft-Report::Options::Mode"
,
"HasArg"
),
(
'R'
,
"rdep-check"
,
"Cruft-Report::Options::Rdep-Check"
),
(
's'
,
"suite"
,
"Cruft-Report::Options::Suite"
,
"HasArg"
),
(
'w'
,
"wanna-build-dump"
,
"Cruft-Report::Options::Wanna-Build-Dump"
,
"HasArg"
)]
for
i
in
[
"help"
]:
for
i
in
[
"help"
,
"Rdep-Check"
]:
if
not
cnf
.
has_key
(
"Cruft-Report::Options::%s"
%
(
i
)):
cnf
[
"Cruft-Report::Options::%s"
%
(
i
)]
=
""
...
...
@@ -604,6 +627,11 @@ def main ():
if
Options
[
"Help"
]:
usage
()
if
Options
[
"Rdep-Check"
]:
rdeps
=
True
else
:
rdeps
=
False
# Set up checks based on mode
if
Options
[
"Mode"
]
==
"daily"
:
checks
=
[
"nbs"
,
"nviu"
,
"nvit"
,
"obsolete source"
,
"outdated non-free"
,
"nfu"
]
...
...
@@ -639,10 +667,10 @@ def main ():
report_obsolete_source
(
suite_name
,
session
)
if
"nbs"
in
checks
:
reportAllNBS
(
suite_name
,
suite_id
,
session
)
reportAllNBS
(
suite_name
,
suite_id
,
session
,
rdeps
)
if
"outdated non-free"
in
checks
:
report_outdated_nonfree
(
suite_name
,
session
)
report_outdated_nonfree
(
suite_name
,
session
,
rdeps
)
bin_not_built
=
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录