Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
513d05b0
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,发现更多精彩内容 >>
提交
513d05b0
编写于
5月 25, 2009
作者:
M
Mark Hymers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move copy_temporary_contents
Signed-off-by:
N
Mark Hymers
<
mhy@debian.org
>
上级
c94572ee
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
63 addition
and
4 deletion
+63
-4
dak/process_accepted.py
dak/process_accepted.py
+2
-1
daklib/binary.py
daklib/binary.py
+61
-3
未找到文件。
dak/process_accepted.py
浏览文件 @
513d05b0
...
...
@@ -46,6 +46,7 @@ from daklib import database
from
daklib
import
daklog
from
daklib
import
queue
from
daklib
import
utils
from
daklib.binary
import
copy_temporary_contents
from
daklib.dak_exceptions
import
*
from
daklib.regexes
import
re_default_answer
,
re_issource
,
re_fdnic
...
...
@@ -396,7 +397,7 @@ def install ():
suite_id
=
database
.
get_suite_id
(
suite
)
projectB
.
query
(
"INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))"
%
(
suite_id
))
if
not
database
.
copy_temporary_contents
(
package
,
version
,
architecture
,
newfile
,
reject
):
if
not
copy_temporary_contents
(
package
,
version
,
architecture
,
newfile
,
reject
):
print
"REJECT
\n
"
+
reject_message
,
projectB
.
query
(
"ROLLBACK"
)
raise
MissingContents
,
"No contents stored for package %s, and couldn't determine contents of %s"
%
(
package
,
newfile
)
...
...
daklib/binary.py
浏览文件 @
513d05b0
...
...
@@ -42,15 +42,15 @@ Functions related debian binary packages
import
os
import
sys
import
shutil
import
tempfile
import
tarfile
import
commands
import
traceback
import
atexit
from
debian_bundle
import
deb822
from
dbconn
import
insert_content_paths
,
insert_pending_content_paths
from
dbconn
import
*
from
config
import
Config
import
logging
import
utils
class
Binary
(
object
):
...
...
@@ -245,4 +245,62 @@ class Binary(object):
os
.
chdir
(
cwd
)
__all__
.
append
(
'Binary'
)
def
copy_temporary_contents
(
package
,
version
,
archname
,
deb
,
reject
,
session
=
None
):
"""
copy the previously stored contents from the temp table to the permanant one
during process-unchecked, the deb should have been scanned and the
contents stored in pending_content_associations
"""
# first see if contents exist:
cnf
=
Config
()
if
session
is
None
:
session
=
DBConn
().
session
()
arch
=
get_architecture
(
archname
,
session
=
session
)
in_pcaq
=
"""SELECT 1 FROM pending_content_associations
WHERE package=:package
AND version=:version
AND architecture=:archid LIMIT 1"""
vals
=
{
'package'
:
package
,
'version'
:
version
,
'archid'
:
arch
.
arch_id
}
exists
=
True
check
=
session
.
execute
(
in_pcaq
,
vals
)
if
check
.
rowcount
>
0
:
# This should NOT happen. We should have added contents
# during process-unchecked. if it did, log an error, and send
# an email.
subst
=
{
"__PACKAGE__"
:
package
,
"__VERSION__"
:
version
,
"__ARCH__"
:
arch
,
"__TO_ADDRESS__"
:
cnf
[
"Dinstall::MyAdminAddress"
],
"__DAK_ADDRESS__"
:
cnf
[
"Dinstall::MyEmailAddress"
]
}
message
=
utils
.
TemplateSubst
(
subst
,
cnf
[
"Dir::Templates"
]
+
"/missing-contents"
)
utils
.
send_mail
(
message
)
exists
=
Binary
(
deb
,
reject
).
scan_package
()
if
exists
:
sql
=
"""INSERT INTO content_associations(binary_pkg,filepath,filename)
SELECT currval('binaries_id_seq'), filepath, filename FROM pending_content_associations
WHERE package=:package AND version=:version AND architecture=:archid"""
session
.
execute
(
sql
,
vals
)
sql
=
"""DELETE from pending_content_associations
WHERE package=:package AND version=:version AND architecture=:archid"""
session
.
execute
(
sql
,
vals
)
return
exists
__all__
.
append
(
'copy_temporary_contents'
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录