Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
9ea7dd5f
D
Dak
项目概览
喜羊羊3508
/
Dak
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
9ea7dd5f
编写于
7月 05, 2010
作者:
M
Mark Hymers
浏览文件
操作
浏览文件
下载
差异文件
Merge commit 'ftpmaster/master'
上级
161760ff
a36a486d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
29 addition
and
15 deletion
+29
-15
config/debian/cron.dinstall
config/debian/cron.dinstall
+4
-4
config/debian/dak.conf
config/debian/dak.conf
+7
-1
dak/show_new.py
dak/show_new.py
+4
-2
daklib/threadpool.py
daklib/threadpool.py
+14
-8
未找到文件。
config/debian/cron.dinstall
浏览文件 @
9ea7dd5f
...
@@ -193,7 +193,7 @@ GO=(
...
@@ -193,7 +193,7 @@ GO=(
ARGS
=
""
ARGS
=
""
ERR
=
"false"
ERR
=
"false"
)
)
stage
$GO
&
stage
$GO
GO
=(
GO
=(
FUNC
=
"i18n1"
FUNC
=
"i18n1"
...
@@ -201,7 +201,7 @@ GO=(
...
@@ -201,7 +201,7 @@ GO=(
ARGS
=
""
ARGS
=
""
ERR
=
"false"
ERR
=
"false"
)
)
stage
$GO
&
stage
$GO
lockfile
"
$LOCK_ACCEPTED
"
lockfile
"
$LOCK_ACCEPTED
"
lockfile
"
$LOCK_NEW
"
lockfile
"
$LOCK_NEW
"
...
@@ -265,7 +265,7 @@ GO=(
...
@@ -265,7 +265,7 @@ GO=(
ARGS
=
""
ARGS
=
""
ERR
=
"false"
ERR
=
"false"
)
)
stage
$GO
&
stage
$GO
GO
=(
GO
=(
FUNC
=
"overrides"
FUNC
=
"overrides"
...
@@ -281,7 +281,7 @@ GO=(
...
@@ -281,7 +281,7 @@ GO=(
ARGS
=
""
ARGS
=
""
ERR
=
"false"
ERR
=
"false"
)
)
stage
$GO
&
stage
$GO
state
"packages/contents"
state
"packages/contents"
GO
=(
GO
=(
...
...
config/debian/dak.conf
浏览文件 @
9ea7dd5f
...
@@ -125,7 +125,7 @@ Rm
...
@@ -125,7 +125,7 @@ Rm
};
};
MyEmailAddress
"Debian Archive Maintenance <ftpmaster@ftp-master.debian.org>"
;
MyEmailAddress
"Debian Archive Maintenance <ftpmaster@ftp-master.debian.org>"
;
LogFile
"/srv/ftp
-master
.debian.org/web/removals.txt"
;
LogFile
"/srv/ftp.debian.org/web/removals.txt"
;
Bcc
"removed-packages@qa.debian.org"
;
Bcc
"removed-packages@qa.debian.org"
;
};
};
...
@@ -653,3 +653,9 @@ Contents
...
@@ -653,3 +653,9 @@ Contents
Header
"contents"
;
Header
"contents"
;
Root
"/srv/ftp-master.debian.org/test/"
;
Root
"/srv/ftp-master.debian.org/test/"
;
}
}
Common
{
//
The
default
number
of
threads
for
multithreading
parts
of
dak
:
ThreadCount
16
;
}
dak/show_new.py
浏览文件 @
9ea7dd5f
...
@@ -143,7 +143,8 @@ def html_footer():
...
@@ -143,7 +143,8 @@ def html_footer():
################################################################################
################################################################################
def
do_pkg
(
changes_file
,
session
):
def
do_pkg
(
changes_file
):
session
=
DBConn
().
session
()
u
=
Upload
()
u
=
Upload
()
u
.
pkg
.
changes_file
=
changes_file
u
.
pkg
.
changes_file
=
changes_file
(
u
.
pkg
.
changes
[
"fingerprint"
],
rejects
)
=
utils
.
check_signature
(
changes_file
)
(
u
.
pkg
.
changes
[
"fingerprint"
],
rejects
)
=
utils
.
check_signature
(
changes_file
)
...
@@ -194,6 +195,7 @@ def do_pkg(changes_file, session):
...
@@ -194,6 +195,7 @@ def do_pkg(changes_file, session):
if
sys
.
stdout
!=
stdout_fd
:
if
sys
.
stdout
!=
stdout_fd
:
sys
.
stdout
.
close
()
sys
.
stdout
.
close
()
sys
.
stdout
=
stdout_fd
sys
.
stdout
=
stdout_fd
session
.
close
()
################################################################################
################################################################################
...
@@ -245,7 +247,7 @@ def main():
...
@@ -245,7 +247,7 @@ def main():
if
not
changes_file
:
if
not
changes_file
:
continue
continue
print
"
\n
"
+
changes_file
print
"
\n
"
+
changes_file
do_pkg
(
changes_file
,
session
)
do_pkg
(
changes_file
)
files
=
set
(
os
.
listdir
(
cnf
[
"Show-New::HTMLPath"
]))
files
=
set
(
os
.
listdir
(
cnf
[
"Show-New::HTMLPath"
]))
to_delete
=
filter
(
lambda
x
:
x
.
endswith
(
".html"
),
files
.
difference
(
sources
))
to_delete
=
filter
(
lambda
x
:
x
.
endswith
(
".html"
),
files
.
difference
(
sources
))
...
...
daklib/threadpool.py
浏览文件 @
9ea7dd5f
import
threading
import
threading
from
time
import
sleep
from
time
import
sleep
from
daklib.config
import
Config
# This code is a modified copy of
# This code is a modified copy of
# http://code.activestate.com/recipes/203871-a-generic-programming-thread-pool/
# http://code.activestate.com/recipes/203871-a-generic-programming-thread-pool/
# and is licensed under the Python License. The full text of the license
# and is licensed under the Python License. The full text of the license
# is available in the file COPYING-PSF.
# is available in the file COPYING-PSF.
# FIXME:
# numThreads defaults to 16 in __init__ to work best on
# franck.debian.org but the default value should be specified in
# dak.conf
# Ensure booleans exist (not needed for Python 2.2.1 or higher)
# Ensure booleans exist (not needed for Python 2.2.1 or higher)
try
:
try
:
True
True
...
@@ -18,16 +15,25 @@ except NameError:
...
@@ -18,16 +15,25 @@ except NameError:
False
=
0
False
=
0
True
=
not
False
True
=
not
False
if
Config
().
has_key
(
'Common::ThreadCount'
):
defaultThreadCount
=
int
(
Config
()[
'Common::ThreadCount'
])
else
:
defaultThreadCount
=
1
class
ThreadPool
:
class
ThreadPool
:
"""Flexible thread pool class. Creates a pool of threads, then
"""Flexible thread pool class. Creates a pool of threads, then
accepts tasks that will be dispatched to the next available
accepts tasks that will be dispatched to the next available thread.
thread."""
The argument numThreads defaults to 'Common::ThreadCount' which must
be specified in dak.conf."""
def
__init__
(
self
,
numThreads
=
16
):
def
__init__
(
self
,
numThreads
=
0
):
"""Initialize the thread pool with numThreads workers."""
"""Initialize the thread pool with numThreads workers."""
if
numThreads
==
0
:
numThreads
=
defaultThreadCount
self
.
__threads
=
[]
self
.
__threads
=
[]
self
.
__resizeLock
=
threading
.
Condition
(
threading
.
Lock
())
self
.
__resizeLock
=
threading
.
Condition
(
threading
.
Lock
())
self
.
__taskLock
=
threading
.
Condition
(
threading
.
Lock
())
self
.
__taskLock
=
threading
.
Condition
(
threading
.
Lock
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录