Workaround for bug in hdiutil

This commit is contained in:
Kovid Goyal 2014-08-25 10:17:31 +05:30
parent 6237977646
commit c0708c760d

View File

@ -654,8 +654,14 @@ class Py2App(object):
shutil.copytree(d, appdir, symlinks=True) shutil.copytree(d, appdir, symlinks=True)
subprocess.check_call(['/Users/kovid/sign.sh', appdir]) subprocess.check_call(['/Users/kovid/sign.sh', appdir])
os.symlink('/Applications', os.path.join(tdir, 'Applications')) os.symlink('/Applications', os.path.join(tdir, 'Applications'))
subprocess.check_call(['/usr/bin/hdiutil', 'create', '-srcfolder', tdir, size_in_mb = int(subprocess.check_output(['du', '-s', '-k', tdir]).decode('utf-8').split()[0]) / 1024.
'-volname', volname, '-format', format, dmg]) cmd = ['/usr/bin/hdiutil', 'create', '-srcfolder', tdir, '-volname', volname, '-format', format]
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
# diskimages-helper: resize request is above maximum size allowed.
cmd += ['-size', '255m']
subprocess.check_call(cmd + [dmg])
shutil.rmtree(tdir) shutil.rmtree(tdir)
if internet_enable: if internet_enable:
subprocess.check_call(['/usr/bin/hdiutil', 'internet-enable', '-yes', dmg]) subprocess.check_call(['/usr/bin/hdiutil', 'internet-enable', '-yes', dmg])