Commits

Frerich Raabe committed e53cb9d364f
Let mkdmg.sh script on OS X actually create random temporary file names When asking binarycreator to create an app bundle on OS X, temporary files are created in /tmp via, the name of which is determined via DMG=`mktemp "/tmp/$VOL.XXXXXX.dmg"` However, on OS X, this doesn't actually create a random file name. OS X uses the BSD implementation of 'mktemp'. The man page explains: The trailing `Xs' are replaced with the current process number and/or a unique letter combination. Note the *trailing*. Hence, on OS X, the 'XXXXXX' part should be at the end of the template. This manifested as a problem in case creation of the .dmg file is aborted (e.g. via Ctrl+C) in which case the temporary file is not removed. In that case, a subsequent attempt to create a .dmg will fail since mktemp fails to create the temporary file - since it's already there! The only remedy is to remove the temporary file by hand. Alas, 'hdiutil' and 'hdid' apparently depend on the file extension in order to detect the file format. So it's not just a matter of changing the template for mktemp. Instead, let's pass just '$VOL.XXXXXX' to mktemp but then tack on the file extension when using the file name. Change-Id: I7a1a548df24054e01630c441f259031045703ff3 Task-number: QTIFW-780 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>