SOURCES: swiftfox.sh (NEW) - client for starting swiftfox, using m...

glen glen at pld-linux.org
Thu Sep 21 15:16:16 CEST 2006


Author: glen                         Date: Thu Sep 21 13:16:16 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- client for starting swiftfox, using mozilla-launcher

---- Files affected:
SOURCES:
   swiftfox.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/swiftfox.sh
diff -u /dev/null SOURCES/swiftfox.sh:1.1
--- /dev/null	Thu Sep 21 15:16:16 2006
+++ SOURCES/swiftfox.sh	Thu Sep 21 15:16:11 2006
@@ -0,0 +1,38 @@
+#!/bin/sh
+# based on script by (c) vip at linux.pl, wolf at pld-linux.org
+# using mozilla-launcher by glen at pld-linux.org
+#
+# Stub script to run mozilla-launcher.  We used to use a symlink here
+# but OOo brokenness makes it necessary to use a stub instead:
+# http://bugs.gentoo.org/show_bug.cgi?id=78890
+
+export MOZILLA_LAUNCHER=@APPNAME@
+export MOZILLA_LIBDIR=@LIBDIR@/@APPNAME@
+export MOZ_PLUGIN_PATH=${MOZ_PLUGIN_PATH:- at LIBDIR@/browser-plugins}
+
+mozlocale=$(/usr/bin/locale | awk -F= '/^LC_MESSAGES=/{print $2}' | xargs)
+mozlocale="$LANGUAGE ${mozlocale%.*}"
+for MOZLANG in $mozlocale; do
+	MOZLANG=$(echo $MOZLANG | sed -e 's|_\([^.]*\).*|-\1|')
+
+	if [ -f $MOZILLA_LIBDIR/chrome/$MOZLANG.jar ]; then
+		MOZARGS="-UILocale $MOZLANG"
+		break
+	fi
+done
+
+if [ -z "$MOZARGS" ]; then
+	# try harder
+	for MOZLANG in $mozlocale; do
+		MOZLANG=$(echo $MOZLANG | sed -e 's|_.*||')
+
+		LANGFILE=$(echo ${MOZILLA_LIBDIR}/chrome/${MOZLANG}*.jar | sed 's/\s.*//g')
+		if [ -f "$LANGFILE" ]; then
+			MOZLANG=$(basename "$LANGFILE" | sed 's/\.jar//')
+			MOZARGS="-UILocale $MOZLANG"
+			break
+		fi
+	done
+fi
+
+exec /usr/lib/mozilla-launcher $MOZARGS "$@"
================================================================


More information about the pld-cvs-commit mailing list