]> git.pld-linux.org Git - packages/firefox.git/blobdiff - mozilla-firefox.sh
- cleanup (no system libs installed now)
[packages/firefox.git] / mozilla-firefox.sh
index 4bb6a571094ae5e46941ee44cd1e200661fb3337..ac9e4b0b75f8377e4ce87b63ec560c6e78b391e6 100644 (file)
@@ -1,14 +1,11 @@
 #!/bin/sh
 # based on script by (c) vip at linux.pl, wolf at pld-linux.org
 
-if [ `arch` == "x86_64" ]; then
-       LIBDIR="/usr/lib64/mozilla-firefox"
-else
-       LIBDIR="/usr/lib/mozilla-firefox"
-fi
+LIBDIR="@LIBDIR@/mozilla-firefox"
 
 MOZILLA_FIVE_HOME=$LIBDIR
 
+MOZARGS=
 MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \
                sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
 for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
@@ -35,6 +32,15 @@ if [ -z "$MOZARGS" ]; then
        done
 fi
 
+# compreg.dat and/or chrome.rdf will screw things up if it's from an
+# older version.  http://bugs.gentoo.org/show_bug.cgi?id=63999
+for f in ~/{.,.mozilla/}firefox/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do
+       if [[ -f ${f} && ${f} -ot /usr/bin/mozilla-firefox ]]; then
+               echo "Removing ${f} leftover from older firefox"
+               rm -f "${f}"
+       fi
+done
+
 if [ -n "$MOZARGS" ]; then
        FIREFOX="$LIBDIR/firefox $MOZARGS"
 else
@@ -42,22 +48,22 @@ else
 fi
 
 if [ "$1" == "-remote" ]; then
-       $FIREFOX "$@"
+       exec $FIREFOX "$@"
 else
        PING=`$FIREFOX -remote 'ping()' 2>&1 >/dev/null`
        if [ -n "$PING" ]; then
                if [ -f "`pwd`/$1" ]; then
-                       $FIREFOX "file://`pwd`/$1"
+                       exec $FIREFOX "file://`pwd`/$1"
                else
-                       $FIREFOX "$@"
+                       exec $FIREFOX "$@"
                fi
        else
                if [ -z "$1" ]; then
-                       $FIREFOX -remote 'xfeDoCommand (openBrowser)'
+                       exec $FIREFOX -remote 'xfeDoCommand(openBrowser)'
                elif [ "$1" == "-mail" ]; then
-                       $FIREFOX -remote 'xfeDoCommand (openInbox)'
+                       exec $FIREFOX -remote 'xfeDoCommand(openInbox)'
                elif [ "$1" == "-compose" ]; then
-                       $FIREFOX -remote 'xfeDoCommand (composeMessage)'
+                       exec $FIREFOX -remote 'xfeDoCommand(composeMessage)'
                else
                        if [ -f "`pwd`/$1" ]; then
                                URL="file://`pwd`/$1"
@@ -66,9 +72,9 @@ else
                        fi
                        grep browser.tabs.opentabfor.middleclick ~/.mozilla/firefox/*/prefs.js | grep true > /dev/null
                        if [ 0 -eq 0 ]; then
-                               $FIREFOX -remote "OpenUrl($URL,new-tab)"
+                               exec $FIREFOX -remote "OpenUrl($URL,new-tab)"
                        else
-                               $FIREFOX -remote "OpenUrl($URL,new-window)"
+                               exec $FIREFOX -remote "OpenUrl($URL,new-window)"
                        fi
                fi
        fi
This page took 0.055157 seconds and 4 git commands to generate.