mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
BUILD(macos): Fix hdiutil error during dmg packaging
The error that appeared every now and again was "no space left on device". The exact cause and why it worked in some cases is not clear, but with these changes it seems way more robust than before.
This commit is contained in:
parent
0f08870da5
commit
0b75cd6f8a
@ -248,14 +248,32 @@ class DiskImage(FolderObject):
|
||||
Create the disk image itself.
|
||||
'''
|
||||
print ' * Creating diskimage. Please wait...'
|
||||
if not self.filename.endswith(".dmg"):
|
||||
self.filename += ".dmg"
|
||||
if os.path.exists(self.filename):
|
||||
os.remove(self.filename)
|
||||
# First create an intermediate, uncompressed image. We do this as otherwise it often happens that
|
||||
# hdiutils fails with the message "no space left on device" which doesn't seem to appear without compression
|
||||
intermediateName = self.filename.replace(".dmg", "_intermediate.dmg")
|
||||
p = Popen(['hdiutil', 'create',
|
||||
'-srcfolder', self.tmp,
|
||||
'-format', 'UDBZ',
|
||||
'-format', 'UDRW',
|
||||
'-volname', self.volname,
|
||||
'-verbose',
|
||||
intermediateName])
|
||||
retval = p.wait()
|
||||
if retval != 0:
|
||||
raise Exception("Creating intermediate dmg file failed")
|
||||
|
||||
# Now take that intermediate and compress it
|
||||
p = Popen(['hdiutil', 'convert',
|
||||
intermediateName,
|
||||
'-format', 'UDBZ',
|
||||
'-verbose', '-o',
|
||||
self.filename])
|
||||
retval = p.wait()
|
||||
if retval != 0:
|
||||
raise Exception("Compressing dmg file failed")
|
||||
print ' * Removing temporary directory.'
|
||||
shutil.rmtree(self.tmp)
|
||||
print ' * Done!'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user