mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix creation of empty dorectories in zip files
This commit is contained in:
parent
6dac26d3d2
commit
41841f2e66
@ -379,7 +379,7 @@ class Win32Freeze(Command, WixMixIn):
|
||||
|
||||
name = '%s-portable-%s.zip'%(__appname__, __version__)
|
||||
with zipfile.ZipFile(self.j('dist', name), 'w', zipfile.ZIP_DEFLATED) as zf:
|
||||
self.add_dir_to_zip(zf, base)
|
||||
self.add_dir_to_zip(zf, base, 'Calibre Portable')
|
||||
|
||||
def add_dir_to_zip(self, zf, path, prefix=''):
|
||||
'''
|
||||
@ -387,7 +387,7 @@ class Win32Freeze(Command, WixMixIn):
|
||||
'''
|
||||
if prefix:
|
||||
zi = zipfile.ZipInfo(prefix+'/')
|
||||
zi.external_attr = 0700 << 16
|
||||
zi.external_attr = 16
|
||||
zf.writestr(zi, '')
|
||||
cwd = os.path.abspath(os.getcwd())
|
||||
try:
|
||||
|
@ -1297,7 +1297,9 @@ class ZipFile:
|
||||
Add a directory recursively to the zip file with an optional prefix.
|
||||
'''
|
||||
if prefix:
|
||||
self.writestr(prefix+'/', '', 0700)
|
||||
zi = ZipInfo(prefix+'/')
|
||||
zi.external_attr = 16
|
||||
self.writestr(zi, '')
|
||||
cwd = os.path.abspath(os.getcwd())
|
||||
try:
|
||||
os.chdir(path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user