Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
38d8ab04
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 搜索 >>
未验证
提交
38d8ab04
编写于
8月 16, 2015
作者:
A
Ansgar Burchardt
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'debug'
上级
2f484372
c4e707cd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
177 addition
and
10 deletion
+177
-10
dak/dakdb/update110.py
dak/dakdb/update110.py
+57
-0
dak/process_policy.py
dak/process_policy.py
+52
-4
daklib/archive.py
daklib/archive.py
+21
-2
daklib/checks.py
daklib/checks.py
+32
-4
daklib/dbconn.py
daklib/dbconn.py
+1
-0
daklib/utils.py
daklib/utils.py
+14
-0
未找到文件。
dak/dakdb/update110.py
0 → 100644
浏览文件 @
38d8ab04
#!/usr/bin/env python
# coding=utf8
"""
Add a debug suite field to the suite table
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2015, Paul Tagliamonte <paultag@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
################################################################################
import
psycopg2
from
daklib.dak_exceptions
import
DBUpdateError
from
daklib.config
import
Config
statements
=
[
"""
ALTER TABLE suite ADD COLUMN debugsuite_id INTEGER REFERENCES suite(id)
"""
,
"""
COMMENT ON COLUMN suite.debugsuite_id IS 'Suite to redirect debug packages (Section: debug) to'
"""
]
################################################################################
def
do_update
(
self
):
print
__doc__
try
:
cnf
=
Config
()
c
=
self
.
db
.
cursor
()
for
stmt
in
statements
:
c
.
execute
(
stmt
)
c
.
execute
(
"UPDATE config SET value = '110' WHERE name = 'db_revision'"
)
self
.
db
.
commit
()
except
psycopg2
.
ProgrammingError
as
msg
:
self
.
db
.
rollback
()
raise
DBUpdateError
(
'Unable to apply sick update 110, rollback issued. Error message: {0}'
.
format
(
msg
))
dak/process_policy.py
浏览文件 @
38d8ab04
...
...
@@ -49,6 +49,7 @@ from daklib.urgencylog import UrgencyLog
from
daklib.packagelist
import
PackageList
import
daklib.announce
import
daklib.utils
# Globals
Options
=
None
...
...
@@ -141,6 +142,12 @@ def comment_accept(upload, srcqueue, comments, transaction):
component_name
=
section
.
split
(
'/'
,
1
)[
0
]
return
get_mapped_component
(
component_name
,
session
=
session
)
def
is_debug_binary
(
db_binary
):
return
daklib
.
utils
.
is_in_debug_section
(
db_binary
.
proxy
)
def
has_debug_binaries
(
upload
):
return
any
((
is_debug_binary
(
x
)
for
x
in
upload
.
binaries
))
def
source_component_func
(
db_source
):
package_list
=
PackageList
(
db_source
.
proxy
)
component
=
source_component_from_package_list
(
package_list
,
upload
.
target_suite
)
...
...
@@ -157,13 +164,54 @@ def comment_accept(upload, srcqueue, comments, transaction):
all_target_suites
.
extend
([
q
.
suite
for
q
in
upload
.
target_suite
.
copy_queues
])
for
suite
in
all_target_suites
:
debug_suite
=
suite
.
debug_suite
if
upload
.
source
is
not
None
:
transaction
.
copy_source
(
upload
.
source
,
suite
,
source_component_func
(
upload
.
source
),
allow_tainted
=
allow_tainted
)
# If we have Source in this upload, let's include it into
# upload suite.
transaction
.
copy_source
(
upload
.
source
,
suite
,
source_component_func
(
upload
.
source
),
allow_tainted
=
allow_tainted
,
)
if
debug_suite
is
not
None
and
has_debug_binaries
(
upload
):
# If we're handing a debug package, we also need to include the
# source in the debug suite as well.
transaction
.
copy_source
(
upload
.
source
,
debug_suite
,
source_component_func
(
upload
.
source
),
allow_tainted
=
allow_tainted
,
)
for
db_binary
in
upload
.
binaries
:
# build queues may miss the source package if this is a binary-only upload
# Now, let's work out where to copy this guy to -- if it's
# a debug binary, and the suite has a debug suite, let's go
# ahead and target the debug suite rather then the stock
# suite.
copy_to_suite
=
suite
if
debug_suite
is
not
None
and
is_debug_binary
(
db_binary
):
copy_to_suite
=
debug_suite
# build queues may miss the source package if this is a
# binary-only upload.
if
suite
!=
upload
.
target_suite
:
transaction
.
copy_source
(
db_binary
.
source
,
suite
,
source_component_func
(
db_binary
.
source
),
allow_tainted
=
allow_tainted
)
transaction
.
copy_binary
(
db_binary
,
suite
,
binary_component_func
(
db_binary
),
allow_tainted
=
allow_tainted
,
extra_archives
=
[
upload
.
target_suite
.
archive
])
transaction
.
copy_source
(
db_binary
.
source
,
copy_to_suite
,
source_component_func
(
db_binary
.
source
),
allow_tainted
=
allow_tainted
,
)
transaction
.
copy_binary
(
db_binary
,
copy_to_suite
,
binary_component_func
(
db_binary
),
allow_tainted
=
allow_tainted
,
extra_archives
=
[
upload
.
target_suite
.
archive
],
)
# Copy .changes if needed
if
upload
.
target_suite
.
copychanges
:
...
...
daklib/archive.py
浏览文件 @
38d8ab04
...
...
@@ -1025,14 +1025,33 @@ class ArchiveUpload(object):
source
=
self
.
changes
.
source
if
source
is
not
None
:
component
=
source_component_func
(
source
)
db_source
=
self
.
transaction
.
install_source
(
self
.
directory
,
source
,
suite
,
component
,
changed_by
,
fingerprint
=
self
.
fingerprint
)
db_source
=
self
.
transaction
.
install_source
(
self
.
directory
,
source
,
suite
,
component
,
changed_by
,
fingerprint
=
self
.
fingerprint
)
else
:
db_source
=
None
db_binaries
=
[]
for
binary
in
self
.
changes
.
binaries
:
copy_to_suite
=
suite
if
utils
.
is_in_debug_section
(
binary
.
control
)
and
suite
.
debug_suite
is
not
None
:
copy_to_suite
=
suite
.
debug_suite
component
=
binary_component_func
(
binary
)
db_binary
=
self
.
transaction
.
install_binary
(
self
.
directory
,
binary
,
suite
,
component
,
fingerprint
=
self
.
fingerprint
,
source_suites
=
source_suites
,
extra_source_archives
=
extra_source_archives
)
db_binary
=
self
.
transaction
.
install_binary
(
self
.
directory
,
binary
,
copy_to_suite
,
component
,
fingerprint
=
self
.
fingerprint
,
source_suites
=
source_suites
,
extra_source_archives
=
extra_source_archives
)
db_binaries
.
append
(
db_binary
)
if
suite
.
copychanges
:
...
...
daklib/checks.py
浏览文件 @
38d8ab04
...
...
@@ -286,13 +286,41 @@ class ExternalHashesCheck(Check):
class
BinaryCheck
(
Check
):
"""Check binary packages for syntax errors."""
def
check
(
self
,
upload
):
debug_deb_name_postfix
=
"-dbgsym"
# XXX: Handle dynamic debug section name here
for
binary
in
upload
.
changes
.
binaries
:
self
.
check_binary
(
upload
,
binary
)
binary_names
=
set
([
binary
.
control
[
'Package'
]
for
binary
in
upload
.
changes
.
binaries
])
for
bn
in
binary_names
:
if
bn
not
in
upload
.
changes
.
binary_names
:
raise
Reject
(
'Package {0} is not mentioned in Binary field in changes'
.
format
(
bn
))
binaries
=
{
binary
.
control
[
'Package'
]:
binary
for
binary
in
upload
.
changes
.
binaries
}
for
name
,
binary
in
binaries
.
items
():
if
name
in
upload
.
changes
.
binary_names
:
# Package is listed in Binary field. Everything is good.
pass
elif
daklib
.
utils
.
is_in_debug_section
(
binary
.
control
):
# If we have a binary package in the debug section, we
# can allow it to not be present in the Binary field
# in the .changes file, so long as its name (without
# -dbgsym) is present in the Binary list.
if
not
name
.
endswith
(
debug_deb_name_postfix
):
raise
Reject
(
'Package {0} is in the debug section, but '
'does not end in {1}.'
.
format
(
name
,
debug_deb_name_postfix
))
# Right, so, it's named properly, let's check that
# the corresponding package is in the Binary list
origin_package_name
=
name
[:
-
len
(
debug_deb_name_postfix
)]
if
origin_package_name
not
in
upload
.
changes
.
binary_names
:
raise
Reject
(
"Debug package {debug}'s corresponding binary package "
"{origin} is not present in the Binary field."
.
format
(
debug
=
name
,
origin
=
origin_package_name
))
else
:
# Someone was a nasty little hacker and put a package
# into the .changes that isn't in debian/control. Bad,
# bad person.
raise
Reject
(
'Package {0} is not mentioned in Binary field in changes'
.
format
(
name
))
return
True
...
...
daklib/dbconn.py
浏览文件 @
38d8ab04
...
...
@@ -2548,6 +2548,7 @@ class DBConn(object):
properties
=
dict
(
suite_id
=
self
.
tbl_suite
.
c
.
id
,
policy_queue
=
relation
(
PolicyQueue
,
primaryjoin
=
(
self
.
tbl_suite
.
c
.
policy_queue_id
==
self
.
tbl_policy_queue
.
c
.
id
)),
new_queue
=
relation
(
PolicyQueue
,
primaryjoin
=
(
self
.
tbl_suite
.
c
.
new_queue_id
==
self
.
tbl_policy_queue
.
c
.
id
)),
debug_suite
=
relation
(
Suite
,
remote_side
=
[
self
.
tbl_suite
.
c
.
id
]),
copy_queues
=
relation
(
BuildQueue
,
secondary
=
self
.
tbl_suite_build_queue_copy
),
srcformats
=
relation
(
SrcFormat
,
secondary
=
self
.
tbl_suite_src_formats
,
...
...
daklib/utils.py
浏览文件 @
38d8ab04
...
...
@@ -1325,3 +1325,17 @@ def parse_built_using(control):
bu
.
append
((
source_name
,
source_version
))
return
bu
################################################################################
def
is_in_debug_section
(
control
):
"""binary package is a debug package
@type control: dict-like
@param control: control file of binary package
@rtype Boolean
@return: True if the binary package is a debug package
"""
section
=
control
[
'Section'
].
split
(
'/'
,
1
)[
-
1
]
return
section
==
"debug"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录