提交 a9a87ae7 编写于 作者: B Bastian Blank

Re-use old by-hash file if new file hash matches

Force the file to have the same mtime if the checksum shows that it was
not changed.
上级 c456c352
......@@ -231,6 +231,16 @@ class ReleaseWriter(object):
# 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])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册