Kaynağa Gözat

makeInstallerLinux.sh now no longer deletes functions.sh when it finishes

makeInstallerLinux.sh now includes the contents of funtions.sh into the installer stub so that it can run...

Change-Id: I82e75bec7d98dc7f2d1f9fb06936f7e50cc939fd
Reviewed-on: http://gerrit.dmdirc.com/46
Reviewed-by: Gregory Holmes <greboid@dmdirc.com>
Tested-by: Gregory Holmes <greboid@dmdirc.com>
tags/0.6.3m2rc1
Shane Mc Cormack 14 yıl önce
ebeveyn
işleme
f689253005

+ 1
- 16
installer/linux/installerstub.sh Dosyayı Görüntüle

@@ -65,22 +65,7 @@ fi;
65 65
 
66 66
 ###ADDITIONAL_STUFF###
67 67
 
68
-PIDOF=`which pidof`
69
-if [ "${PIDOF}" = "" ]; then
70
-	# For some reason some distros hide pidof...
71
-	if [ -e /sbin/pidof ]; then
72
-		PIDOF=/sbin/pidof
73
-	elif [ -e /usr/sbin/pidof ]; then
74
-		PIDOF=/usr/sbin/pidof
75
-	fi;
76
-fi;
77
-
78
-if [ -e "functions.sh" ]; then
79
-	. functions.sh
80
-else
81
-	echo "Unable to find functions.sh, unable to continue."
82
-	exit 1;
83
-fi;
68
+###FUNCTIONS_FILE###
84 69
 
85 70
 # Location of .run stub end
86 71
 ENDLINE=`grep ${GREPOPTS} "^###END STUB###$" $0`

+ 24
- 1
installer/linux/makeInstallerLinux.sh Dosyayı Görüntüle

@@ -268,7 +268,28 @@ fi
268 268
 
269 269
 echo "Creating .run file"
270 270
 echo "Adding stub.."
271
-cat installerstub.sh > ${RUNNAME}
271
+
272
+grep -na "" /dev/null >/dev/null 2>&1
273
+if [ $? -eq 2 ]; then
274
+	GREPOPTS="-n"
275
+else
276
+	GREPOPTS="-na"
277
+fi;
278
+# Solaris also has a crappy version of tail!
279
+tail -n +1 /dev/null >/dev/null 2>&1
280
+if [ $? -eq 2 ]; then
281
+	TAILOPTS="+"
282
+else
283
+	TAILOPTS="-n +"
284
+fi;
285
+
286
+FUNCTIONSLINE=`grep ${GREPOPTS} "^###FUNCTIONS_FILE###$" installerstub.sh`
287
+FUNCTIONSLINE=$((${FUNCTIONSLINE%%:*} + 0))
288
+
289
+head -n ${FUNCTIONSLINE} installerstub.sh  > ${RUNNAME}
290
+cat functions.sh >> ${RUNNAME}
291
+echo "" >> ${RUNNAME}
292
+tail ${TAILOPTS}$((${FUNCTIONSLINE%%:*} + 1)) installerstub.sh >> ${RUNNAME}
272 293
 
273 294
 # Add release info.
274 295
 if [ $isSVN -eq 1 ]; then
@@ -439,12 +460,14 @@ mv getjre.sh getjre.sh.tmp
439 460
 mv installjre.sh installjre.sh.tmp
440 461
 mv progressbar.sh progressbar.sh.tmp
441 462
 mv uninstall.sh uninstall.sh.tmp
463
+mv functions.sh functions.sh.tmp
442 464
 rm -f ${FILES}
443 465
 mv setup.sh.tmp setup.sh
444 466
 mv getjre.sh.tmp getjre.sh
445 467
 mv installjre.sh.tmp installjre.sh
446 468
 mv progressbar.sh.tmp progressbar.sh
447 469
 mv uninstall.sh.tmp uninstall.sh
470
+mv functions.sh.tmp functions.sh
448 471
 
449 472
 echo "-----------"
450 473
 echo "Done."

Loading…
İptal
Kaydet