Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
aa4f71d8
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,发现更多精彩内容 >>
提交
aa4f71d8
编写于
7月 31, 2012
作者:
A
Ansgar Burchardt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use archive path instead of Dir::Root
上级
9427ebbb
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
32 addition
and
24 deletion
+32
-24
dak/cruft_report.py
dak/cruft_report.py
+2
-2
dak/generate_packages_sources2.py
dak/generate_packages_sources2.py
+4
-3
dak/generate_releases.py
dak/generate_releases.py
+4
-4
dak/init_dirs.py
dak/init_dirs.py
+1
-1
dak/override.py
dak/override.py
+7
-3
dak/override_disparity.py
dak/override_disparity.py
+4
-1
daklib/contents.py
daklib/contents.py
+2
-0
daklib/filewriter.py
daklib/filewriter.py
+8
-10
未找到文件。
dak/cruft_report.py
浏览文件 @
aa4f71d8
...
...
@@ -680,7 +680,7 @@ def main ():
# Checks based on the Sources files
components
=
get_component_names
(
session
)
for
component
in
components
:
filename
=
"%s/dists/%s/%s/source/Sources.gz"
%
(
cnf
[
"Dir::Root"
]
,
suite_name
,
component
)
filename
=
"%s/dists/%s/%s/source/Sources.gz"
%
(
suite
.
archive
.
path
,
suite_name
,
component
)
# apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance...
(
fd
,
temp_filename
)
=
utils
.
temp_filename
()
(
result
,
output
)
=
commands
.
getstatusoutput
(
"gunzip -c %s > %s"
%
(
filename
,
temp_filename
))
...
...
@@ -729,7 +729,7 @@ def main ():
for
architecture
in
architectures
:
if
component
==
'main/debian-installer'
and
re
.
match
(
"kfreebsd"
,
architecture
):
continue
filename
=
"%s/dists/%s/%s/binary-%s/Packages.gz"
%
(
cnf
[
"Dir::Root"
]
,
suite_name
,
component
,
architecture
)
filename
=
"%s/dists/%s/%s/binary-%s/Packages.gz"
%
(
suite
.
archive
.
path
,
suite_name
,
component
,
architecture
)
# apt_pkg.ParseTagFile needs a real file handle
(
fd
,
temp_filename
)
=
utils
.
temp_filename
()
(
result
,
output
)
=
commands
.
getstatusoutput
(
"gunzip -c %s > %s"
%
(
filename
,
temp_filename
))
...
...
dak/generate_packages_sources2.py
浏览文件 @
aa4f71d8
...
...
@@ -103,7 +103,7 @@ def generate_sources(suite_id, component_id):
overridesuite_id
=
suite
.
get_overridesuite
().
suite_id
writer
=
SourcesFileWriter
(
suite
=
suite
.
suite_name
,
component
=
component
.
component_name
)
writer
=
SourcesFileWriter
(
archive
=
suite
.
archive
.
path
,
suite
=
suite
.
suite_name
,
component
=
component
.
component_name
)
output
=
writer
.
open
()
# run query and write Sources
...
...
@@ -226,7 +226,8 @@ def generate_packages(suite_id, component_id, architecture_id, type_name):
if
include_long_description
:
metadata_skip
.
append
(
"Description-md5"
)
writer
=
PackagesFileWriter
(
suite
=
suite
.
suite_name
,
component
=
component
.
component_name
,
writer
=
PackagesFileWriter
(
archive
=
suite
.
archive
.
path
,
suite
=
suite
.
suite_name
,
component
=
component
.
component_name
,
architecture
=
architecture
.
arch_string
,
debtype
=
type_name
)
output
=
writer
.
open
()
...
...
@@ -287,7 +288,7 @@ def generate_translations(suite_id, component_id):
suite
=
session
.
query
(
Suite
).
get
(
suite_id
)
component
=
session
.
query
(
Component
).
get
(
component_id
)
writer
=
TranslationFileWriter
(
suite
=
suite
.
suite_name
,
component
=
component
.
component_name
,
language
=
"en"
)
writer
=
TranslationFileWriter
(
archive
=
suite
.
archive
.
path
,
suite
=
suite
.
suite_name
,
component
=
component
.
component_name
,
language
=
"en"
)
output
=
writer
.
open
()
r
=
session
.
execute
(
_translations_query
,
{
"suite"
:
suite_id
,
"component"
:
component_id
})
...
...
dak/generate_releases.py
浏览文件 @
aa4f71d8
...
...
@@ -145,9 +145,9 @@ class ReleaseWriter(object):
cnf
=
Config
()
suite_suffix
=
"%s"
%
(
cnf
.
find
(
"Dinstall::SuiteSuffix"
)
)
suite_suffix
=
cnf
.
find
(
"Dinstall::SuiteSuffix"
,
""
)
outfile
=
os
.
path
.
join
(
cnf
[
"Dir::Root"
],
'dists'
,
"%s/%s"
%
(
suite
.
suite_name
,
suite_suffix
)
,
"Release"
)
outfile
=
os
.
path
.
join
(
suite
.
archive
.
path
,
'dists'
,
suite
.
suite_name
,
suite_suffix
,
"Release"
)
out
=
open
(
outfile
+
".new"
,
"w"
)
for
key
,
dbfield
in
attribs
:
...
...
@@ -182,7 +182,7 @@ class ReleaseWriter(object):
out
.
write
(
"Description: %s
\n
"
%
suite
.
description
)
for
comp
in
components
:
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
"%sdists/%s/%s%s"
%
(
cnf
[
"Dir::Root"
]
,
suite
.
suite_name
,
suite_suffix
,
comp
),
topdown
=
True
):
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
os
.
path
.
join
(
suite
.
archive
.
path
,
"dists"
,
suite
.
suite_name
,
suite_suffix
,
comp
),
topdown
=
True
):
if
not
re_gensubrelease
.
match
(
dirpath
):
continue
...
...
@@ -214,7 +214,7 @@ class ReleaseWriter(object):
# their checksums to the main Release file
oldcwd
=
os
.
getcwd
()
os
.
chdir
(
"%sdists/%s/%s"
%
(
cnf
[
"Dir::Root"
]
,
suite
.
suite_name
,
suite_suffix
))
os
.
chdir
(
os
.
path
.
join
(
suite
.
archive
.
path
,
"dists"
,
suite
.
suite_name
,
suite_suffix
))
hashfuncs
=
{
'MD5Sum'
:
apt_pkg
.
md5sum
,
'SHA1'
:
apt_pkg
.
sha1sum
,
...
...
dak/init_dirs.py
浏览文件 @
aa4f71d8
...
...
@@ -137,7 +137,7 @@ def create_directories():
# Process dists directories
# TODO: Store location of each suite in database
for
suite
in
session
.
query
(
Suite
):
suite_dir
=
os
.
path
.
join
(
Cnf
[
'Dir::Root'
],
'dists'
,
"%s/%s"
%
(
suite
.
suite_name
,
suite_suffix
)
)
suite_dir
=
os
.
path
.
join
(
suite
.
archive
.
path
,
'dists'
,
suite
.
suite_name
,
suite_suffix
)
# TODO: Store valid suite/component mappings in database
for
component
in
session
.
query
(
Component
):
...
...
dak/override.py
浏览文件 @
aa4f71d8
...
...
@@ -56,7 +56,7 @@ Make microchanges or microqueries of the binary overrides
"""
sys
.
exit
(
exit_code
)
def
check_override_compliance
(
package
,
priority
,
suite_name
,
cnf
,
session
):
def
check_override_compliance
(
package
,
priority
,
archive_path
,
suite_name
,
cnf
,
session
):
print
"Checking compliance with related overrides..."
depends
=
set
()
...
...
@@ -66,7 +66,7 @@ def check_override_compliance(package, priority, suite_name, cnf, session):
arches
-=
set
([
"source"
,
"all"
])
for
arch
in
arches
:
for
component
in
components
:
Packages
=
utils
.
get_packages_from_ftp
(
cnf
[
'Dir::Root'
]
,
suite_name
,
component
,
arch
)
Packages
=
utils
.
get_packages_from_ftp
(
archive_path
,
suite_name
,
component
,
arch
)
while
Packages
.
Step
():
package_name
=
Packages
.
Section
.
Find
(
"Package"
)
dep_list
=
Packages
.
Section
.
Find
(
"Depends"
)
...
...
@@ -140,6 +140,10 @@ def main ():
if
arguments
and
len
(
arguments
)
>
2
:
utils
.
fubar
(
"Too many arguments"
)
suite
=
get_suite
(
suite_name
,
session
)
if
suite
is
None
:
utils
.
fubar
(
"Unknown suite '{0}'"
.
format
(
suite_name
))
if
arguments
and
len
(
arguments
)
==
1
:
# Determine if the argument is a priority or a section...
arg
=
arguments
.
pop
()
...
...
@@ -227,7 +231,7 @@ def main ():
utils
.
fubar
(
"Trying to change priority of a source-only package"
)
if
Options
[
"Check"
]
and
newpriority
!=
oldpriority
:
check_override_compliance
(
package
,
p
,
suite_name
,
cnf
,
session
)
check_override_compliance
(
package
,
p
,
suite
.
archive
.
path
,
suite
_name
,
cnf
,
session
)
# If we're in no-action mode
if
Options
[
"No-Action"
]:
...
...
dak/override_disparity.py
浏览文件 @
aa4f71d8
...
...
@@ -82,12 +82,15 @@ def main():
depends
=
{}
session
=
DBConn
().
session
()
suite_name
=
Options
[
'suite'
]
suite
=
get_suite
(
suite_name
,
session
)
if
suite
is
None
:
utils
.
fubar
(
"Unknown suite '{0}'"
.
format
(
suite_name
))
components
=
get_component_names
(
session
)
arches
=
set
([
x
.
arch_string
for
x
in
get_suite_architectures
(
suite_name
)])
arches
-=
set
([
'source'
,
'all'
])
for
arch
in
arches
:
for
component
in
components
:
Packages
=
utils
.
get_packages_from_ftp
(
cnf
[
'Dir::Root'
]
,
suite_name
,
component
,
arch
)
Packages
=
utils
.
get_packages_from_ftp
(
suite
.
archive
.
path
,
suite_name
,
component
,
arch
)
while
Packages
.
Step
():
package
=
Packages
.
Section
.
Find
(
'Package'
)
dep_list
=
Packages
.
Section
.
Find
(
'Depends'
)
...
...
daklib/contents.py
浏览文件 @
aa4f71d8
...
...
@@ -123,6 +123,7 @@ select bc.file, string_agg(o.section || '/' || b.package, ',' order by b.package
Returns a writer object.
'''
values
=
{
'archive'
:
self
.
suite
.
archive
.
path
,
'suite'
:
self
.
suite
.
suite_name
,
'component'
:
self
.
component
.
component_name
,
'debtype'
:
self
.
overridetype
.
overridetype
,
...
...
@@ -223,6 +224,7 @@ select sc.file, string_agg(s.source, ',' order by s.source) as pkglist
Returns a writer object.
'''
values
=
{
'archive'
:
self
.
suite
.
archive
.
path
,
'suite'
:
self
.
suite
.
suite_name
,
'component'
:
self
.
component
.
component_name
}
...
...
daklib/filewriter.py
浏览文件 @
aa4f71d8
...
...
@@ -47,9 +47,7 @@ class BaseFileWriter(object):
self
.
uncompressed
=
'none'
in
compression
self
.
gzip
=
'gzip'
in
compression
self
.
bzip2
=
'bzip2'
in
compression
root_dir
=
Config
()[
'Dir::Root'
]
relative_dir
=
template
%
keywords
self
.
path
=
os
.
path
.
join
(
root_dir
,
relative_dir
)
self
.
path
=
template
%
keywords
def
open
(
self
):
'''
...
...
@@ -98,9 +96,9 @@ class BinaryContentsFileWriter(BaseFileWriter):
}
flags
.
update
(
keywords
)
if
flags
[
'debtype'
]
==
'deb'
:
template
=
"dists/%(suite)s/%(component)s/Contents-%(architecture)s"
template
=
"
%(archive)s/
dists/%(suite)s/%(component)s/Contents-%(architecture)s"
else
:
# udeb
template
=
"dists/%(suite)s/%(component)s/Contents-udeb-%(architecture)s"
template
=
"
%(archive)s/
dists/%(suite)s/%(component)s/Contents-udeb-%(architecture)s"
BaseFileWriter
.
__init__
(
self
,
template
,
**
flags
)
class
SourceContentsFileWriter
(
BaseFileWriter
):
...
...
@@ -113,7 +111,7 @@ class SourceContentsFileWriter(BaseFileWriter):
'compression'
:
[
'gzip'
],
}
flags
.
update
(
keywords
)
template
=
"dists/%(suite)s/%(component)s/Contents-source"
template
=
"
%(archive)s/
dists/%(suite)s/%(component)s/Contents-source"
BaseFileWriter
.
__init__
(
self
,
template
,
**
flags
)
class
PackagesFileWriter
(
BaseFileWriter
):
...
...
@@ -127,9 +125,9 @@ class PackagesFileWriter(BaseFileWriter):
}
flags
.
update
(
keywords
)
if
flags
[
'debtype'
]
==
'deb'
:
template
=
"dists/%(suite)s/%(component)s/binary-%(architecture)s/Packages"
template
=
"
%(archive)s/
dists/%(suite)s/%(component)s/binary-%(architecture)s/Packages"
else
:
# udeb
template
=
"dists/%(suite)s/%(component)s/debian-installer/binary-%(architecture)s/Packages"
template
=
"
%(archive)s/
dists/%(suite)s/%(component)s/debian-installer/binary-%(architecture)s/Packages"
BaseFileWriter
.
__init__
(
self
,
template
,
**
flags
)
class
SourcesFileWriter
(
BaseFileWriter
):
...
...
@@ -142,7 +140,7 @@ class SourcesFileWriter(BaseFileWriter):
'compression'
:
[
'gzip'
,
'bzip2'
],
}
flags
.
update
(
keywords
)
template
=
"dists/%(suite)s/%(component)s/source/Sources"
template
=
"
%(archive)s/
dists/%(suite)s/%(component)s/source/Sources"
BaseFileWriter
.
__init__
(
self
,
template
,
**
flags
)
class
TranslationFileWriter
(
BaseFileWriter
):
...
...
@@ -156,5 +154,5 @@ class TranslationFileWriter(BaseFileWriter):
'language'
:
'en'
,
}
flags
.
update
(
keywords
)
template
=
"dists/%(suite)s/%(component)s/i18n/Translation-%(language)s"
template
=
"
%(archive)s/
dists/%(suite)s/%(component)s/i18n/Translation-%(language)s"
super
(
TranslationFileWriter
,
self
).
__init__
(
template
,
**
flags
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录