Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
df610ec6
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,发现更多精彩内容 >>
提交
df610ec6
编写于
10月 30, 2009
作者:
M
Mike O'Connor
浏览文件
操作
浏览文件
下载
差异文件
Merge commit 'public/knownchanges' into knownchanges
上级
efda164c
a1e2a895
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
178 addition
and
17 deletion
+178
-17
dak/dakdb/update19.py
dak/dakdb/update19.py
+107
-0
dak/import_known_changes.py
dak/import_known_changes.py
+30
-2
dak/process_unchecked.py
dak/process_unchecked.py
+1
-1
dak/rm.py
dak/rm.py
+4
-1
dak/update_db.py
dak/update_db.py
+1
-1
daklib/changes.py
daklib/changes.py
+1
-1
daklib/dbconn.py
daklib/dbconn.py
+18
-0
daklib/utils.py
daklib/utils.py
+3
-0
templates/contents
templates/contents
+12
-10
templates/rm.bug-close
templates/rm.bug-close
+1
-1
未找到文件。
dak/dakdb/update19.py
0 → 100755
浏览文件 @
df610ec6
#!/usr/bin/env python
# coding=utf8
"""
Move to using the C version of debversion
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2009 Mark Hymers <mhy@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
import
time
import
os
import
datetime
import
traceback
from
daklib.dak_exceptions
import
DBUpdateError
from
daklib.config
import
Config
################################################################################
def
do_update
(
self
):
print
"Converting database to use new C based debversion type"
try
:
c
=
self
.
db
.
cursor
()
print
"Temporarily converting columns to TEXT"
c
.
execute
(
"ALTER TABLE binaries ALTER COLUMN version TYPE TEXT"
)
c
.
execute
(
"ALTER TABLE source ALTER COLUMN version TYPE TEXT"
)
c
.
execute
(
"ALTER TABLE upload_blocks ALTER COLUMN version TYPE TEXT"
)
c
.
execute
(
"ALTER TABLE pending_content_associations ALTER COLUMN version TYPE TEXT"
)
print
"Dropping old debversion type"
c
.
execute
(
"DROP OPERATOR >(debversion, debversion)"
)
c
.
execute
(
"DROP OPERATOR <(debversion, debversion)"
)
c
.
execute
(
"DROP OPERATOR <=(debversion, debversion)"
)
c
.
execute
(
"DROP OPERATOR >=(debversion, debversion)"
)
c
.
execute
(
"DROP OPERATOR =(debversion, debversion)"
)
c
.
execute
(
"DROP OPERATOR <>(debversion, debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_eq(debversion,debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_ge(debversion,debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_gt(debversion,debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_le(debversion,debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_lt(debversion,debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_ne(debversion,debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_compare(debversion,debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_revision(debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_version(debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_epoch(debversion)"
)
c
.
execute
(
"DROP FUNCTION debversion_split(debversion)"
)
c
.
execute
(
"DROP TYPE debversion"
)
# URGH - kill me now
print
"Importing new debversion type"
f
=
open
(
'/usr/share/postgresql/8.4/contrib/debversion.sql'
,
'r'
)
cmds
=
[]
curcmd
=
''
for
j
in
f
.
readlines
():
j
=
j
.
replace
(
'
\t
'
,
''
).
replace
(
'
\n
'
,
''
).
split
(
'--'
)[
0
]
if
not
j
.
startswith
(
'--'
):
jj
=
j
.
split
(
';'
)
curcmd
+=
" "
+
jj
[
0
]
if
len
(
jj
)
>
1
:
for
jjj
in
jj
[
1
:]:
if
jjj
.
strip
()
==
''
:
cmds
.
append
(
curcmd
)
curcmd
=
''
else
:
curcmd
+=
" "
+
jjj
for
cm
in
cmds
:
c
.
execute
(
cm
)
print
"Converting columns to new debversion type"
c
.
execute
(
"ALTER TABLE binaries ALTER COLUMN version TYPE debversion"
)
c
.
execute
(
"ALTER TABLE source ALTER COLUMN version TYPE debversion"
)
c
.
execute
(
"ALTER TABLE upload_blocks ALTER COLUMN version TYPE debversion"
)
c
.
execute
(
"ALTER TABLE pending_content_associations ALTER COLUMN version TYPE debversion"
)
print
"Committing"
c
.
execute
(
"UPDATE config SET value = '19' WHERE name = 'db_revision'"
)
self
.
db
.
commit
()
except
psycopg2
.
InternalError
,
msg
:
self
.
db
.
rollback
()
raise
DBUpdateError
,
"Unable to apply debversion update 19, rollback issued. Error message : %s"
%
(
str
(
msg
))
dak/import_known_changes.py
浏览文件 @
df610ec6
...
...
@@ -168,6 +168,10 @@ class ChangesGenerator(threading.Thread):
threading
.
Thread
.
__init__
(
self
)
self
.
queue
=
queue
self
.
session
=
DBConn
().
session
()
self
.
die
=
False
def
plsDie
(
self
):
self
.
die
=
True
def
run
(
self
):
cnf
=
Config
()
...
...
@@ -181,6 +185,9 @@ class ChangesGenerator(threading.Thread):
if
not
filenames
:
# Empty directory (or only subdirectories), next
continue
if
self
.
die
:
return
for
changesfile
in
filenames
:
if
not
changesfile
.
endswith
(
".changes"
):
# Only interested in changes files.
...
...
@@ -198,10 +205,16 @@ class ImportThread(threading.Thread):
threading
.
Thread
.
__init__
(
self
)
self
.
queue
=
queue
self
.
session
=
DBConn
().
session
()
self
.
die
=
False
def
plsDie
(
self
):
self
.
die
=
True
def
run
(
self
):
while
True
:
try
:
if
self
.
die
:
return
to_import
=
self
.
queue
.
dequeue
()
if
not
to_import
:
return
...
...
@@ -266,10 +279,25 @@ def main():
queue
=
OneAtATime
()
ChangesGenerator
(
queue
).
start
()
threads
=
[
ChangesGenerator
(
queue
)
]
for
i
in
range
(
num_threads
):
ImportThread
(
queue
).
start
()
threads
.
append
(
ImportThread
(
queue
)
)
try
:
for
thread
in
threads
:
thread
.
start
()
for
thread
in
thrads
:
thread
.
join
()
except
KeyboardInterrupt
:
utils
.
warn
(
"Caught C-c; terminating."
)
for
thread
in
threads
:
thread
.
plsDie
()
for
thread
in
threads
:
thread
.
join
()
if
__name__
==
'__main__'
:
...
...
dak/process_unchecked.py
浏览文件 @
df610ec6
...
...
@@ -102,7 +102,7 @@ def init():
################################################################################
def
usage
(
exit_code
=
0
):
print
"""Usage: d
install
[OPTION]... [CHANGES]...
print
"""Usage: d
ak process-unchecked
[OPTION]... [CHANGES]...
-a, --automatic automatic run
-h, --help show this help and exit.
-n, --no-action don't do anything
...
...
dak/rm.py
浏览文件 @
df610ec6
...
...
@@ -554,7 +554,10 @@ def main ():
if
carbon_copy
:
Subst
[
"__CC__"
]
+=
"
\n
Cc: "
+
", "
.
join
(
carbon_copy
)
Subst
[
"__SUITE_LIST__"
]
=
suites_list
Subst
[
"__SUMMARY__"
]
=
summary
summarymail
=
"%s
\n
------------------- Reason -------------------
\n
%s
\n
"
%
(
summary
,
Options
[
"Reason"
])
summarymail
+=
"----------------------------------------------
\n
"
Subst
[
"__SUMMARY__"
]
=
summarymail
Subst
[
"__SUBJECT__"
]
=
"Removed package(s) from %s"
%
(
suites_list
)
Subst
[
"__ADMIN_ADDRESS__"
]
=
cnf
[
"Dinstall::MyAdminAddress"
]
Subst
[
"__DISTRO__"
]
=
cnf
[
"Dinstall::MyDistribution"
]
Subst
[
"__WHOAMI__"
]
=
whoami
...
...
dak/update_db.py
浏览文件 @
df610ec6
...
...
@@ -44,7 +44,7 @@ from daklib.dak_exceptions import DBUpdateError
################################################################################
Cnf
=
None
required_database_schema
=
1
6
required_database_schema
=
1
9
################################################################################
...
...
daklib/changes.py
浏览文件 @
df610ec6
...
...
@@ -215,7 +215,7 @@ class Changes(object):
distribution, urgency, maintainer, fingerprint, changedby, date)
VALUES (:changesfile,:filetime,:source,:binary, :architecture,
:version,:distribution,:urgency,:maintainer,:fingerprint,:changedby,:date)"""
,
{
'changesfile'
:
changes
file
,
{
'changesfile'
:
self
.
changes_
file
,
'filetime'
:
filetime
,
'source'
:
self
.
changes
[
"source"
],
'binary'
:
self
.
changes
[
"binary"
],
...
...
daklib/dbconn.py
浏览文件 @
df610ec6
...
...
@@ -40,8 +40,10 @@ import traceback
from
inspect
import
getargspec
import
sqlalchemy
from
sqlalchemy
import
create_engine
,
Table
,
MetaData
from
sqlalchemy.orm
import
sessionmaker
,
mapper
,
relation
from
sqlalchemy
import
types
as
sqltypes
# Don't remove this, we re-export the exceptions to scripts which import us
from
sqlalchemy.exc
import
*
...
...
@@ -55,6 +57,22 @@ from textutils import fix_maintainer
################################################################################
# Patch in support for the debversion field type so that it works during
# reflection
class
DebVersion
(
sqltypes
.
Text
):
def
get_col_spec
(
self
):
return
"DEBVERSION"
sa_major_version
=
sqlalchemy
.
__version__
[
0
:
3
]
if
sa_major_version
==
"0.5"
:
from
sqlalchemy.databases
import
postgres
postgres
.
ischema_names
[
'debversion'
]
=
DebVersion
else
:
raise
Exception
(
"dak isn't ported to SQLA versions != 0.5 yet. See daklib/dbconn.py"
)
################################################################################
__all__
=
[
'IntegrityError'
,
'SQLAlchemyError'
]
################################################################################
...
...
daklib/utils.py
浏览文件 @
df610ec6
...
...
@@ -73,6 +73,9 @@ def dak_getstatusoutput(cmd):
output
=
""
.
join
(
pipe
.
stdout
.
readlines
())
if
output
[
-
1
:]
==
'
\n
'
:
output
=
output
[:
-
1
]
ret
=
pipe
.
wait
()
if
ret
is
None
:
ret
=
0
...
...
templates/contents
浏览文件 @
df610ec6
...
...
@@ -12,22 +12,24 @@ the first is listed.
As all Contents files are shipped compressed, the best way to search quickly
for a file is with the Unix `zgrep' utility, as in:
`zgrep <regular expression> CONTENTS.gz':
`zgrep <regular expression> CONTENTS
FILE
.gz':
$ zgrep nose Contents.gz
etc/nosendfile net/sendfile
usr/X11R6/bin/noseguy x11/xscreensaver
usr/X11R6/man/man1/noseguy.1x.gz x11/xscreensaver
usr/doc/examples/ucbmpeg/mpeg_encode/nosearch.param graphics/ucbmpeg
usr/lib/cfengine/bin/noseyparker admin/cfengine
$ zgrep -i debian/ Contents-amd64.gz
usr/share/IlohaMail/debian/Ilohamail.apache web/ilohamail
usr/share/R/debian/r-cran.mk devel/r-base-dev
usr/share/apt-listbugs/debian/apt_preferences.rb admin/apt-listbugs
usr/share/apt-listbugs/debian/bts.rb admin/apt-listbugs
usr/share/apt-listbugs/debian/btssoap.rb admin/apt-listbugs
usr/share/apt-listbugs/debian/bug.rb admin/apt-listbugs
usr/share/apt-listbugs/debian/mytempfile.rb admin/apt-listbugs
This list contains files in all packages, even though not all of the
packages are installed on an actual system at once. If you want to
find out which packages on an installed Debian system provide a
particular file, you can use `dpkg --search <filename>':
$ dpkg --search
/usr/bin/dselec
t
dpkg: /usr/bin/dselec
t
$ dpkg --search
apt-ge
t
apt: /usr/bin/apt-ge
t
FILE LOCATION
\ No newline at end of file
FILE LOCATION
templates/rm.bug-close
浏览文件 @
df610ec6
...
...
@@ -6,7 +6,7 @@ X-Debian: DAK
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Subject: Bug#__BUG_NUMBER__:
fixed
Subject: Bug#__BUG_NUMBER__:
__SUBJECT__
We believe that the bug you reported is now fixed; the following
package(s) have been removed from __SUITE_LIST__:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录