Kaynağa Gözat

More minor fixes


git-svn-id: http://svn.dmdirc.com/trunk@3533 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 yıl önce
ebeveyn
işleme
80b73e8585
1 değiştirilmiş dosya ile 18 ekleme ve 0 silme
  1. 18
    0
      installer/linux/makeInstallerLinux.sh

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

@@ -257,6 +257,15 @@ compress $FILES
257 257
 MD5BIN=`which md5sum`
258 258
 AWK=`which awk`
259 259
 getMD5() {
260
+	echo "test" | ${MD5BIN}
261
+	if [ $? -eq 0 ]; then
262
+		getMD5Linux $@
263
+	else
264
+		getMD5OSX $@
265
+	fi;
266
+}
267
+
268
+getMD5Linux() {
260 269
 	# Everything below the MD5SUM Line
261 270
 	MD5LINE=`grep -na "^MD5=\".*\"$" ${1}`
262 271
 	MD5LINE=$((${MD5LINE%%:*} + 1))
@@ -265,6 +274,15 @@ getMD5() {
265 274
 	return;
266 275
 }
267 276
 
277
+getMD5OSX() {
278
+	# Everything below the MD5SUM Line
279
+	MD5LINE=`grep -na "^MD5=\".*\"$" ${1}`
280
+	MD5LINE=$((${MD5LINE%%:*} + 1))
281
+
282
+	MD5SUM=`tail -n +${MD5LINE} "${1}" | ${MD5BIN} | ${AWK} '{print $1}'`
283
+	return;
284
+}
285
+
268 286
 if [ "${MD5BIN}" != "" -a "${AWK}" != "" ]; then
269 287
 	echo "Adding MD5.."
270 288
 

Loading…
İptal
Kaydet