Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
b037a167
D
Dak
项目概览
喜羊羊3508
/
Dak
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
b037a167
编写于
4月 24, 2002
作者:
J
James Troup
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
auto-building support take 2
上级
336e084a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
63 addition
and
28 deletion
+63
-28
katie
katie
+18
-14
katie.py
katie.py
+16
-13
rhona
rhona
+29
-1
未找到文件。
katie
浏览文件 @
b037a167
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#
Installs
Debian
packages
#
Installs
Debian
packages
#
Copyright
(
C
)
2000
,
2001
James
Troup
<
james
@
nocrew
.
org
>
#
Copyright
(
C
)
2000
,
2001
James
Troup
<
james
@
nocrew
.
org
>
#
$
Id
:
katie
,
v
1.7
8
2002
-
04
-
20
13
:
13
:
32
troup
Exp
$
#
$
Id
:
katie
,
v
1.7
9
2002
-
04
-
24
01
:
56
:
24
troup
Exp
$
#
This
program
is
free
software
;
you
can
redistribute
it
and
/
or
modify
#
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
#
it
under
the
terms
of
the
GNU
General
Public
License
as
published
by
...
@@ -39,7 +39,7 @@ import db_access, katie, logging, utils;
...
@@ -39,7 +39,7 @@ import db_access, katie, logging, utils;
###############################################################################
###############################################################################
#
Globals
#
Globals
katie_version
=
"$Revision: 1.7
8
$"
;
katie_version
=
"$Revision: 1.7
9
$"
;
Cnf
=
None
;
Cnf
=
None
;
Options
=
None
;
Options
=
None
;
...
@@ -388,25 +388,29 @@ def install ():
...
@@ -388,25 +388,29 @@ def install ():
if changes["architecture"].has_key("source"):
if changes["architecture"].has_key("source"):
Urgency_Logger.log(dsc["source"], dsc["version"], changes["urgency"]);
Urgency_Logger.log(dsc["source"], dsc["version"], changes["urgency"]);
## FIXME: this should go away to some Debian specific file
# Undo the work done in katie.py(accept) to help auto-building
# Undo the work done in katie.py(accept) to help auto-building
# from accepted
# from accepted.
if changes["distribution"].has_key("unstable"):
if Cnf.get("Dinstall::SpecialAcceptedAutoBuild") and \
changes["distribution"].has_key("unstable"):
now_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()));
projectB.query("BEGIN WORK");
projectB.query("BEGIN WORK");
# Remove it from the list of packages for later processing by apt-ftparchive
for file in files.keys():
for file in files.keys():
if files[file]["type"] == "dsc" or files[file]["type"] == "deb":
dest = os.path.join(Cnf["Dir::AcceptedAutoBuild"], file);
filename = os.path.join(Cnf["Dir::QueueAcceptedDir"], file);
# Remove it from the list of packages for later processing by apt-ftparchive
projectB.query("DELETE FROM unstable_accepted WHERE filename = '
%
s
'" % (filename));
projectB.query("UPDATE unstable_accepted SET in_accepted = '
f
', last_used = '
%
s
' WHERE filename = '
%
s
'" % (now_date, dest));
# Remove any .orig.tar.gz symlink
# Update the symlink to point to the new location in the pool
pool_location = utils.poolify (changes["source"], files[file]["component"]);
src = os.path.join(Cnf["Dir::PoolDir"], pool_location, os.path.basename(file));
os.unlink(dest);
os.symlink(src, dest);
# Update last_used on any non-upload .orig.tar.gz symlink
if orig_tar_id:
if orig_tar_id:
# Determine the .orig.tar.gz file name
# Determine the .orig.tar.gz file name
for dsc_file in dsc_files.keys():
for dsc_file in dsc_files.keys():
if dsc_file[-12:] == ".orig.tar.gz":
if dsc_file[-12:] == ".orig.tar.gz":
orig_tar_gz = os.path.join(Cnf["Dir::QueueAcceptedDir"],dsc_file);
orig_tar_gz = os.path.join(Cnf["Dir::AcceptedAutoBuild"], dsc_file);
# Remove it if it'
s
a
symlink
# Remove it from the list of packages for later processing by apt-ftparchive
if
os
.
path
.
exists
(
orig_tar_gz
)
and
os
.
path
.
islink
(
orig_tar_gz
):
projectB.query("UPDATE unstable_accepted SET in_accepted = '
f
', last_used = '
%
s
' WHERE filename = '
%
s
'" % (now_date, orig_tar_gz));
os
.
unlink
(
orig_tar_gz
);
projectB.query("COMMIT WORK");
projectB.query("COMMIT WORK");
install_count = install_count + 1;
install_count = install_count + 1;
...
...
katie.py
浏览文件 @
b037a167
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Utility functions for katie
# Utility functions for katie
# Copyright (C) 2001 James Troup <james@nocrew.org>
# Copyright (C) 2001 James Troup <james@nocrew.org>
# $Id: katie.py,v 1.1
5 2002-04-21 15:38:29
troup Exp $
# $Id: katie.py,v 1.1
6 2002-04-24 01:56:24
troup Exp $
# This program is free software; you can redistribute it and/or modify
# 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
# it under the terms of the GNU General Public License as published by
...
@@ -357,24 +357,25 @@ class Katie:
...
@@ -357,24 +357,25 @@ class Katie:
utils
.
send_mail
(
mail_message
,
""
)
utils
.
send_mail
(
mail_message
,
""
)
self
.
announce
(
short_summary
,
1
)
self
.
announce
(
short_summary
,
1
)
## FIXME: this should go away to some Debian specific file
# Special support to enable clean auto-building of accepted packages
# If we're accepting something for unstable do extra work to
if
Cnf
.
get
(
"Dinstall::SpecialAcceptedAutoBuild"
)
and
\
# make it auto-buildable from accepted
self
.
pkg
.
changes
[
"distribution"
].
has_key
(
"unstable"
):
if
self
.
pkg
.
changes
[
"distribution"
].
has_key
(
"unstable"
):
self
.
projectB
.
query
(
"BEGIN WORK"
);
self
.
projectB
.
query
(
"BEGIN WORK"
);
# Add it to the list of packages for later processing by apt-ftparchive
for
file
in
file_keys
:
for
file
in
file_keys
:
if
files
[
file
][
"type"
]
==
"dsc"
or
files
[
file
][
"type"
]
==
"deb"
:
src
=
os
.
path
.
join
(
Cnf
[
"Dir::QueueAcceptedDir"
],
file
);
filename
=
os
.
path
.
join
(
Cnf
[
"Dir::QueueAcceptedDir"
],
file
);
dest
=
os
.
path
.
join
(
Cnf
[
"Dir::AcceptedAutoBuild"
],
file
);
self
.
projectB
.
query
(
"INSERT INTO unstable_accepted (filename) VALUES ('%s')"
%
(
filename
));
# Create a symlink to it
# If the .orig.tar.gz is in the pool, create a symlink (if
os
.
symlink
(
src
,
dest
);
# one doesn't already exist)
# Add it to the list of packages for later processing by apt-ftparchive
self
.
projectB
.
query
(
"INSERT INTO unstable_accepted (filename, in_accepted) VALUES ('%s', 't')"
%
(
dest
));
# If the .orig.tar.gz is in the pool, create a symlink to
# it (if one doesn't already exist)
if
self
.
pkg
.
orig_tar_id
:
if
self
.
pkg
.
orig_tar_id
:
# Determine the .orig.tar.gz file name
# Determine the .orig.tar.gz file name
for
dsc_file
in
self
.
pkg
.
dsc_files
.
keys
():
for
dsc_file
in
self
.
pkg
.
dsc_files
.
keys
():
if
dsc_file
[
-
12
:]
==
".orig.tar.gz"
:
if
dsc_file
[
-
12
:]
==
".orig.tar.gz"
:
filename
=
dsc_file
;
filename
=
dsc_file
;
dest
=
os
.
path
.
join
(
Cnf
[
"Dir::
QueueAcceptedDir
"
],
filename
);
dest
=
os
.
path
.
join
(
Cnf
[
"Dir::
AcceptedAutoBuild
"
],
filename
);
# If it doesn't exist, create a symlink
# If it doesn't exist, create a symlink
if
not
os
.
path
.
exists
(
dest
):
if
not
os
.
path
.
exists
(
dest
):
# Find the .orig.tar.gz in the pool
# Find the .orig.tar.gz in the pool
...
@@ -384,6 +385,9 @@ class Katie:
...
@@ -384,6 +385,9 @@ class Katie:
utils
.
fubar
(
"[INTERNAL ERROR] Couldn't find id %s in files table."
%
(
self
.
pkg
.
orig_tar_id
));
utils
.
fubar
(
"[INTERNAL ERROR] Couldn't find id %s in files table."
%
(
self
.
pkg
.
orig_tar_id
));
src
=
os
.
path
.
join
(
ql
[
0
][
0
],
ql
[
0
][
1
]);
src
=
os
.
path
.
join
(
ql
[
0
][
0
],
ql
[
0
][
1
]);
os
.
symlink
(
src
,
dest
);
os
.
symlink
(
src
,
dest
);
# Add it to the list of packages for later processing by apt-ftparchive
self
.
projectB
.
query
(
"INSERT INTO unstable_accepted (filename, in_accepted) VALUES ('%s', 't')"
%
(
dest
));
self
.
projectB
.
query
(
"COMMIT WORK"
);
self
.
projectB
.
query
(
"COMMIT WORK"
);
###########################################################################
###########################################################################
...
@@ -459,7 +463,6 @@ class Katie:
...
@@ -459,7 +463,6 @@ class Katie:
# safely overwrite it.
# safely overwrite it.
utils
.
move
(
file
,
dest_file
,
1
,
perms
=
0660
);
utils
.
move
(
file
,
dest_file
,
1
,
perms
=
0660
);
###########################################################################
###########################################################################
def
do_reject
(
self
,
manual
=
0
,
reject_message
=
""
):
def
do_reject
(
self
,
manual
=
0
,
reject_message
=
""
):
...
...
rhona
浏览文件 @
b037a167
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# rhona, cleans up unassociated binary and source packages
# rhona, cleans up unassociated binary and source packages
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
# $Id: rhona,v 1.2
1 2002-04-22 11:06:49
troup Exp $
# $Id: rhona,v 1.2
2 2002-04-24 01:56:24
troup Exp $
# This program is free software; you can redistribute it and/or modify
# 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
# it under the terms of the GNU General Public License as published by
...
@@ -285,6 +285,33 @@ SELECT f.id FROM fingerprint f
...
@@ -285,6 +285,33 @@ SELECT f.id FROM fingerprint f
################################################################################
################################################################################
def
clean_accepted_autobuild
():
global
now_date
;
if
not
Cnf
.
get
(
"Dinstall::SpecialAcceptedAutoBuild"
)
or
Options
[
"No-Action"
]:
return
;
print
"Cleaning out accepted autobuild symlinks..."
our_delete_date
=
time
.
strftime
(
"%Y-%m-%d %H:%M"
,
time
.
localtime
(
time
.
time
()
-
int
(
Cnf
[
"Rhona::AcceptedAutoBuildStayOfExecution"
])));
count
=
0
;
q
=
projectB
.
query
(
"SELECT filename FROM unstable_accepted WHERE last_used <= '%s'"
%
(
our_delete_date
));
for
i
in
q
.
getresult
():
filename
=
i
[
0
];
if
not
os
.
path
.
exists
(
filename
):
utils
.
fubar
(
"%s (from unstable_accepted) doesn't exist."
%
(
filename
));
if
not
os
.
path
.
islink
(
filename
):
utils
.
fubar
(
"%s (from unstable_accepted) should be a symlink but isn't."
%
(
filename
));
os
.
unlink
(
filename
);
count
=
count
+
1
;
projectB
.
query
(
"DELETE FROM unstable_accepted WHERE last_used <= '%s'"
%
(
our_delete_date
));
if
count
>
0
:
sys
.
stderr
.
write
(
"Cleaned %d accepted-autobuild symlinks.
\n
"
%
(
count
));
################################################################################
def
main
():
def
main
():
global
Cnf
,
Options
,
projectB
,
delete_date
,
now_date
;
global
Cnf
,
Options
,
projectB
,
delete_date
,
now_date
;
...
@@ -314,6 +341,7 @@ def main():
...
@@ -314,6 +341,7 @@ def main():
clean
();
clean
();
clean_maintainers
();
clean_maintainers
();
clean_fingerprints
();
clean_fingerprints
();
clean_accepted_autobuild
();
################################################################################
################################################################################
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录