mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use UDBZ dmg files for best compression
This commit is contained in:
parent
4aa0ee3ccd
commit
3ce1c8bd63
@ -721,7 +721,7 @@ class Freeze(object):
|
|||||||
'lib', 'python' + py_ver))
|
'lib', 'python' + py_ver))
|
||||||
|
|
||||||
@flush
|
@flush
|
||||||
def makedmg(self, d, volname, internet_enable=True, dmg_fmt='ULFO'):
|
def makedmg(self, d, volname, internet_enable=True):
|
||||||
''' Copy a directory d into a dmg named volname '''
|
''' Copy a directory d into a dmg named volname '''
|
||||||
print('\nSigning...')
|
print('\nSigning...')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
@ -744,7 +744,8 @@ class Freeze(object):
|
|||||||
print('Signing completed in %d minutes %d seconds' % tuple(times))
|
print('Signing completed in %d minutes %d seconds' % tuple(times))
|
||||||
os.symlink('/Applications', join(tdir, 'Applications'))
|
os.symlink('/Applications', join(tdir, 'Applications'))
|
||||||
size_in_mb = int(subprocess.check_output(['du', '-s', '-k', tdir]).decode('utf-8').split()[0]) / 1024.
|
size_in_mb = int(subprocess.check_output(['du', '-s', '-k', tdir]).decode('utf-8').split()[0]) / 1024.
|
||||||
cmd = ['/usr/bin/hdiutil', 'create', '-srcfolder', tdir, '-volname', volname, '-format', dmg_fmt]
|
# UDBZ gives the best compression, better than ULFO
|
||||||
|
cmd = ['/usr/bin/hdiutil', 'create', '-srcfolder', tdir, '-volname', volname, '-format', 'UDBZ']
|
||||||
if 190 < size_in_mb < 250:
|
if 190 < size_in_mb < 250:
|
||||||
# We need -size 255m because of a bug in hdiutil. When the size of
|
# We need -size 255m because of a bug in hdiutil. When the size of
|
||||||
# srcfolder is close to 200MB hdiutil fails with
|
# srcfolder is close to 200MB hdiutil fails with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user