From 3ce1c8bd63314f3a3a2e2f2c1d52c2353fea3f2d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Sep 2019 16:31:12 +0530 Subject: [PATCH] Use UDBZ dmg files for best compression --- bypy/macos/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bypy/macos/__main__.py b/bypy/macos/__main__.py index cd1013ba52..9390bab016 100644 --- a/bypy/macos/__main__.py +++ b/bypy/macos/__main__.py @@ -721,7 +721,7 @@ class Freeze(object): 'lib', 'python' + py_ver)) @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 ''' print('\nSigning...') sys.stdout.flush() @@ -744,7 +744,8 @@ class Freeze(object): print('Signing completed in %d minutes %d seconds' % tuple(times)) os.symlink('/Applications', join(tdir, 'Applications')) 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: # We need -size 255m because of a bug in hdiutil. When the size of # srcfolder is close to 200MB hdiutil fails with