Browse Source

Fix nightlies not working properly


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

+ 36
- 13
installer/osx/makeInstallerOSX.sh View File

@@ -28,6 +28,18 @@ INSTALLERNAME=DMDirc
28 28
 # full name of the file to output to
29 29
 RUNNAME="${PWD}/${INSTALLERNAME}.dmg"
30 30
 
31
+# Linux needs an entry in fstab to allow normal users to mount things (like a
32
+# dmg image).
33
+# These 2 config vars choose what dir and file we mount so that fstab can be
34
+# correct, these should be full paths, and are ignored on OSX.
35
+# This is the name of the image that gets mounted:
36
+LINUXIMAGE=${PWD}/DMDirc.dmg
37
+# This is the dir we mount it in
38
+LINUXIMAGEDIR=${PWD}/dmg
39
+# fstab entry should read:
40
+# ${LINUXIMAGE} ${LINUXIMAGEDIR} auto users,noauto,loop 0 0
41
+
42
+
31 43
 MKHFS=`which mkfs.hfs`
32 44
 MKHFSPLUS=`which mkfs.hfsplus`
33 45
 HDIUTIL=`which hdiutil`
@@ -328,10 +340,16 @@ if [ -e ${PWD}/.DS_Store ]; then
328 340
 fi
329 341
 
330 342
 # Now, make a dmg
331
-DMGMOUNTDIR=""
332 343
 if [ "" = "${HDIUTIL}" ]; then
344
+	# Make sure the variables are set
345
+	if [ "" = "${LINUXIMAGEDIR}" ]; then
346
+		LINUXIMAGEDIR=${PWD}/dmg
347
+	fi;
348
+	if [ "" = "${LINUXIMAGED}" ]; then	
349
+		LINUXIMAGE=${PWD}/DMDirc.dmg
350
+	fi;
351
+
333 352
 	SIZE=$((`du -sb ${DMG} | awk '{print $1}'`  + 10))
334
-	DMGMOUNTDIR=${PWD}/dmg
335 353
 	# Non-OSX
336 354
 	# This doesn't work quite aswell as on OSX, but it works.
337 355
 	if [ "" = "${MKHFS}" -a "" != "${MKHFSPLUS}" ]; then
@@ -342,21 +360,21 @@ if [ "" = "${HDIUTIL}" ]; then
342 360
 		echo "Size is less than 4MB"
343 361
 		SIZE=4194304;
344 362
 	fi;
345
-	dd if=/dev/zero of=${RUNNAME} bs=${SIZE} count=1
346
-	${MKHFS} -v 'DMDirc' ${RUNNAME}
363
+	dd if=/dev/zero of=${LINUXIMAGE} bs=${SIZE} count=1
364
+	${MKHFS} -v 'DMDirc' ${LINUXIMAGE}
347 365
 	# Now try and mount
348 366
 	# This could be a problem, as linux requires either root to mount, or an fstab
349 367
 	# entry.
350 368
 	# Try to mount, if this fails, let the user know what to add to fstab.
351
-	if [ -e ${DMGMOUNTDIR} ]; then
352
-		rm -Rf ${DMGMOUNTDIR}
369
+	if [ -e ${LINUXIMAGEDIR} ]; then
370
+		rm -Rf ${LINUXIMAGEDIR}
353 371
 	fi;
354
-	mkdir ${DMGMOUNTDIR}
355
-	mount ${DMGMOUNTDIR}
372
+	mkdir ${LINUXIMAGEDIR}
373
+	mount ${LINUXIMAGEDIR}
356 374
 	MOUNTRES=${?}
357 375
 	if [ ${MOUNTRES} -ne 0 ]; then
358 376
 		# Try using full parameters - could be running as root.
359
-		mount -t hfsplus -o loop ${RUNNAME} ${DMGMOUNTDIR}
377
+		mount -t hfsplus -o loop ${RUNNAME} ${LINUXIMAGEDIR}
360 378
 		MOUNTRES=${?}
361 379
 	fi;
362 380
 	if [ ${MOUNTRES} -ne 0 ]; then
@@ -366,16 +384,21 @@ if [ "" = "${HDIUTIL}" ]; then
366 384
 		echo "You do not have permission to mount the image."
367 385
 		echo "Please add the following lines to /etc/fstab and rcd oun this script again"
368 386
 		echo "# DMDirc OSX dmg image"
369
-		echo "${RUNNAME} ${DMGMOUNTDIR} auto users,noauto,loop 0 0"
387
+		echo "${LINUXIMAGE} ${LINUXIMAGEDIR} auto users,noauto,loop 0 0"
370 388
 		echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
371 389
 		echo "@                               ERROR                               @"
372 390
 		echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
373 391
 		exit 1;
374 392
 	fi;
375
-	mv -fv ${DMG}/* ${DMGMOUNTDIR}
376
-	mv -fv ${DMG}/.[A-Za-z]* ${DMGMOUNTDIR}
377
-	umount ${DMGMOUNTDIR}
393
+	mv -fv ${DMG}/* ${LINUXIMAGEDIR}
394
+	mv -fv ${DMG}/.[A-Za-z]* ${LINUXIMAGEDIR}
395
+	umount ${LINUXIMAGEDIR}
378 396
 	# If anyone finds out how to compress these nicely, add it here.
397
+	
398
+	if [ "${LINUXIMAGE}" != "${RUNNAME}" ]; then
399
+		# Rename the image
400
+		mv ${LINUXIMAGE} ${RUNNAME}
401
+	fi;
379 402
 else
380 403
 	# OSX
381 404
 	# This creates better versions than non-OSX

Loading…
Cancel
Save