summaryrefslogtreecommitdiff
path: root/source/xap/mozilla-firefox
diff options
context:
space:
mode:
Diffstat (limited to 'source/xap/mozilla-firefox')
-rwxr-xr-xsource/xap/mozilla-firefox/mozilla-firefox.SlackBuild31
1 files changed, 30 insertions, 1 deletions
diff --git a/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild b/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild
index 0e11e04c..b4863b51 100755
--- a/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild
+++ b/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild
@@ -42,6 +42,16 @@ MOZLOCALIZE=${MOZLOCALIZE:-}
# "UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: ordinal not in range(128)"
LANG=C
+# Add a shell script to start the firefox binary with MOZ_ALLOW_DOWNGRADE=1
+# to avoid backing up (and disabling) the user profile if a browser downgrade
+# is detected. We made it fine for years without this feature, and all the
+# feedback we've seen suggests that it is causing more problems than it
+# solves. For example, this feature causes a profile reset trying to switch
+# between a 32-bit and 64-bit browser on installations that share a common
+# /home directory. If you want to build with the stock default behavior, set
+# this to something other than "YES":
+MOZ_ALLOW_DOWNGRADE=${MOZ_ALLOW_DOWNGRADE:-YES}
+
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -366,6 +376,26 @@ install -m 644 browser/branding/official/default16.png \
# Copy over the LICENSE
install -p -c -m 644 LICENSE $PKG/usr/lib${LIBDIRSUFFIX}/firefox-$RELEASEVER/
+# If MOZ_ALLOW_DOWNGRADE=YES, replace the /usr/bin/firefox symlink with a
+# shell script that sets the MOZ_ALLOW_DOWNGRADE=1 environment variable so
+# that a detected browser downgrade does not reset the user profile:
+if [ "$MOZ_ALLOW_DOWNGRADE" = "YES" ]; then
+ rm -f $PKG/usr/bin/firefox
+ cat << EOF > $PKG/usr/bin/firefox
+#!/bin/sh
+#
+# Shell script to start Mozilla Firefox.
+#
+# Don't reset the user profile on a detected browser downgrade:
+export MOZ_ALLOW_DOWNGRADE=1
+
+# Start Firefox:
+exec /usr/lib${LIBDIRSUFFIX}/firefox/firefox "\$@"
+EOF
+ chown root:root $PKG/usr/bin/firefox
+ chmod 755 $PKG/usr/bin/firefox
+fi
+
mkdir $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
@@ -375,4 +405,3 @@ if [ -z $MOZLOCALIZE ]; then
else
/sbin/makepkg -l y -c n $TMP/mozilla-firefox-$VERSION-$ARCH-${BUILD}_$MOZLOCALIZE.txz
fi
-