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
 # full name of the file to output to
28
 # full name of the file to output to
29
 RUNNAME="${PWD}/${INSTALLERNAME}.dmg"
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
 MKHFS=`which mkfs.hfs`
43
 MKHFS=`which mkfs.hfs`
32
 MKHFSPLUS=`which mkfs.hfsplus`
44
 MKHFSPLUS=`which mkfs.hfsplus`
33
 HDIUTIL=`which hdiutil`
45
 HDIUTIL=`which hdiutil`
328
 fi
340
 fi
329
 
341
 
330
 # Now, make a dmg
342
 # Now, make a dmg
331
-DMGMOUNTDIR=""
332
 if [ "" = "${HDIUTIL}" ]; then
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
 	SIZE=$((`du -sb ${DMG} | awk '{print $1}'`  + 10))
352
 	SIZE=$((`du -sb ${DMG} | awk '{print $1}'`  + 10))
334
-	DMGMOUNTDIR=${PWD}/dmg
335
 	# Non-OSX
353
 	# Non-OSX
336
 	# This doesn't work quite aswell as on OSX, but it works.
354
 	# This doesn't work quite aswell as on OSX, but it works.
337
 	if [ "" = "${MKHFS}" -a "" != "${MKHFSPLUS}" ]; then
355
 	if [ "" = "${MKHFS}" -a "" != "${MKHFSPLUS}" ]; then
342
 		echo "Size is less than 4MB"
360
 		echo "Size is less than 4MB"
343
 		SIZE=4194304;
361
 		SIZE=4194304;
344
 	fi;
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
 	# Now try and mount
365
 	# Now try and mount
348
 	# This could be a problem, as linux requires either root to mount, or an fstab
366
 	# This could be a problem, as linux requires either root to mount, or an fstab
349
 	# entry.
367
 	# entry.
350
 	# Try to mount, if this fails, let the user know what to add to fstab.
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
 	fi;
371
 	fi;
354
-	mkdir ${DMGMOUNTDIR}
355
-	mount ${DMGMOUNTDIR}
372
+	mkdir ${LINUXIMAGEDIR}
373
+	mount ${LINUXIMAGEDIR}
356
 	MOUNTRES=${?}
374
 	MOUNTRES=${?}
357
 	if [ ${MOUNTRES} -ne 0 ]; then
375
 	if [ ${MOUNTRES} -ne 0 ]; then
358
 		# Try using full parameters - could be running as root.
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
 		MOUNTRES=${?}
378
 		MOUNTRES=${?}
361
 	fi;
379
 	fi;
362
 	if [ ${MOUNTRES} -ne 0 ]; then
380
 	if [ ${MOUNTRES} -ne 0 ]; then
366
 		echo "You do not have permission to mount the image."
384
 		echo "You do not have permission to mount the image."
367
 		echo "Please add the following lines to /etc/fstab and rcd oun this script again"
385
 		echo "Please add the following lines to /etc/fstab and rcd oun this script again"
368
 		echo "# DMDirc OSX dmg image"
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
 		echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
388
 		echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
371
 		echo "@                               ERROR                               @"
389
 		echo "@                               ERROR                               @"
372
 		echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
390
 		echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
373
 		exit 1;
391
 		exit 1;
374
 	fi;
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
 	# If anyone finds out how to compress these nicely, add it here.
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
 else
402
 else
380
 	# OSX
403
 	# OSX
381
 	# This creates better versions than non-OSX
404
 	# This creates better versions than non-OSX

Loading…
Cancel
Save