Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
184c4512
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,发现更多精彩内容 >>
提交
184c4512
编写于
6月 20, 2017
作者:
B
Bastian Blank
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace by-hashed files with symlinks
上级
ef3b1679
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
12 deletion
+20
-12
dak/generate_releases.py
dak/generate_releases.py
+20
-12
未找到文件。
dak/generate_releases.py
浏览文件 @
184c4512
...
...
@@ -199,7 +199,7 @@ class ReleaseWriter(object):
# Update the hashfile table with new or updated files
for
filename
in
fileinfo
:
if
not
os
.
path
.
exists
(
filename
):
if
not
os
.
path
.
l
exists
(
filename
):
# probably an uncompressed index we didn't generate
continue
byhashdir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
filename
),
'by-hash'
)
...
...
@@ -227,20 +227,10 @@ class ReleaseWriter(object):
def
_make_byhash_links
(
self
,
fileinfo
,
hashes
):
# Create hardlinks in by-hash directories
for
filename
in
fileinfo
:
if
not
os
.
path
.
exists
(
filename
):
if
not
os
.
path
.
l
exists
(
filename
):
# probably an uncompressed index we didn't generate
continue
for
h
in
hashes
:
field
=
h
.
release_field
hashfile
=
os
.
path
.
join
(
os
.
path
.
dirname
(
filename
),
'by-hash'
,
field
,
fileinfo
[
filename
][
field
])
# if the hash is known to exist, re-use the old file
if
os
.
path
.
exists
(
hashfile
):
os
.
unlink
(
filename
)
os
.
link
(
hashfile
,
filename
)
break
for
h
in
hashes
:
field
=
h
.
release_field
hashfile
=
os
.
path
.
join
(
os
.
path
.
dirname
(
filename
),
'by-hash'
,
field
,
fileinfo
[
filename
][
field
])
...
...
@@ -255,6 +245,23 @@ class ReleaseWriter(object):
if
exc
.
errno
!=
errno
.
EEXIST
:
raise
def
_make_byhash_base_symlink
(
self
,
fileinfo
,
hashes
):
# Create symlinks to files in by-hash directories
for
filename
in
fileinfo
:
if
not
os
.
path
.
lexists
(
filename
):
# probably an uncompressed index we didn't generate
continue
besthash
=
hashes
[
-
1
]
field
=
besthash
.
release_field
hashfilebase
=
os
.
path
.
join
(
'by-hash'
,
field
,
fileinfo
[
filename
][
field
])
hashfile
=
os
.
path
.
join
(
os
.
path
.
dirname
(
filename
),
hashfilebase
)
assert
os
.
path
.
exists
(
hashfile
),
'by-hash file {} is missing'
.
format
(
hashfile
)
os
.
unlink
(
filename
)
os
.
symlink
(
hashfilebase
,
filename
)
def
generate_release_files
(
self
):
"""
Generate Release files for the given suite
...
...
@@ -430,6 +437,7 @@ class ReleaseWriter(object):
self
.
_update_hashfile_table
(
session
,
fileinfo_byhash
,
hashes
)
self
.
_make_byhash_links
(
fileinfo_byhash
,
hashes
)
self
.
_make_byhash_base_symlink
(
fileinfo_byhash
,
hashes
)
sign_release_dir
(
suite
,
os
.
path
.
dirname
(
outfile
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录