Browse Source

Only try a max of 5 times to get a correctly sized image.


git-svn-id: http://svn.dmdirc.com/trunk@3873 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 years ago
parent
commit
a5c9411550
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      installer/osx/makeInstallerOSX.sh

+ 10
- 1
installer/osx/makeInstallerOSX.sh View File

@@ -421,12 +421,21 @@ if [ "" = "${HDIUTIL}" ]; then
421 421
 	# everything.
422 422
 	# I can't manage to get du to return the size that the files actually end up
423 423
 	# using on the image.
424
-	while [ ${MVRES} -ne 0 ]; do
424
+	TRIES=0
425
+	while [ ${MVRES} -ne 0 -a ${TRIES} -ne 5 ]; do
426
+		TRIES=$((${TRIES} + 1))
427
+		echo "Previous ImageSize of ${IMAGESIZE} failed"
425 428
 		INCREASE=$((${INCREASE} + 5))
426 429
 		IMAGESIZE=$(((`du -s --block-size ${IMGBLOCKSIZE} ${DMG} | awk '{print $1}'` + ${INCREASE}) * ${IMGBLOCKSIZE} ))
430
+		echo "Trying to build with ImageSize ${IMAGESIZE}"
427 431
 		createImage ${IMAGESIZE}
428 432
 	done;
429 433
 	
434
+	if [ ${MVRES} -eq 0 ]; then
435
+		echo "OSX Build Failed - Imagesize: ${IMAGESIZE}"
436
+		exit 1;
437
+	fi;
438
+	
430 439
 	if [ "${LINUXIMAGE}" != "${RUNNAME}" ]; then
431 440
 		# Rename the image
432 441
 		mv ${LINUXIMAGE} ${RUNNAME}

Loading…
Cancel
Save