summaryrefslogtreecommitdiff
path: root/waterfox-g/debian/waterfox-g.preinst
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-06-27 14:37:16 -0400
committerB. Stack <bgstack15@gmail.com>2024-06-27 14:37:16 -0400
commite85d214d9ad99217913b996b812e05feb01b1cb8 (patch)
treefcd2cdf103c8f3184525bfb4e7f70e2c6ba690f3 /waterfox-g/debian/waterfox-g.preinst
parentnotepadnext 0.8 (diff)
downloadstackrpms-e85d214d9ad99217913b996b812e05feb01b1cb8.tar.gz
stackrpms-e85d214d9ad99217913b996b812e05feb01b1cb8.tar.bz2
stackrpms-e85d214d9ad99217913b996b812e05feb01b1cb8.zip
waterfox-g 6.0.16
Diffstat (limited to 'waterfox-g/debian/waterfox-g.preinst')
-rwxr-xr-xwaterfox-g/debian/waterfox-g.preinst88
1 files changed, 0 insertions, 88 deletions
diff --git a/waterfox-g/debian/waterfox-g.preinst b/waterfox-g/debian/waterfox-g.preinst
deleted file mode 100755
index 77ef682..0000000
--- a/waterfox-g/debian/waterfox-g.preinst
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-
-set -e
-
-APP_DIR="/etc/apparmor.d"
-APP_PROFILE="usr.bin.waterfox-g"
-APP_CONFFILE="$APP_DIR/$APP_PROFILE"
-APP_DISABLE="$APP_DIR/disable/$APP_PROFILE"
-MOZ_PKG_NAME=waterfox-g
-MOZ_LIBDIR=/usr/lib/waterfox-g
-
-# Prepare to move a conffile without triggering a dpkg question
-prepare_mv_conffile() {
- local PKGNAME="$1"
- local CONFFILE="$2"
-
- [ -e "$CONFFILE" ] || return 0
-
- local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
- local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
- sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
- #'
- if [ "$md5sum" = "$old_md5sum" ]; then
- mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
- fi
-}
-
-prepare_rm_conffile() {
- local PACKAGE="$1"
- local CONFFILE="$2"
-
- [ -e "$CONFFILE" ] || return 0
-
- local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
- local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PACKAGE | \
- sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
- if [ "$md5sum" != "$old_md5sum" ]; then
- echo "Obsolete conffile $CONFFILE has been modified by you."
- echo "Saving as $CONFFILE.dpkg-bak ..."
- mv -f "$CONFFILE" "$CONFFILE.dpkg-backup"
- else
- echo "Moving obsolete conffile $CONFFILE out of the way..."
- mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
- fi
-}
-
-disable_profile() {
- # Create a symlink to the yet-to-be-unpacked profile
- if [ ! -e "$APP_CONFFILE" ]; then
- mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true
- ln -sf $APP_CONFFILE $APP_DISABLE
- fi
-}
-
-if [ "$1" = "install" ] || [ "$1" = "upgrade" ] ; then
- if [ "$1" = "install" ]; then
- # Disable AppArmor profile on install, unless the last profile they
- # modified is enabled.
- base=`echo $APP_PROFILE | cut -d '-' -f 1`
- last_modified=`ls -rt $APP_DIR/$base* 2>/dev/null | grep -v '\.dpkg' | tail -n1`
- if [ -s "$last_modified" ]; then
- if [ -e "$APP_DIR/disable/`basename $last_modified`" ]; then
- disable_profile
- fi
- else
- # Fresh install and no other waterfox profiles exist, so disable.
- disable_profile
- fi
- elif [ "$1" = "upgrade" ]; then
- # Disable AppArmor on upgrade from earlier than when we first shipped
- # the profile if the user does not already have a profile defined.
- if dpkg --compare-versions "$2" lt "56.2.5-0" ; then
- disable_profile
- fi
- fi
-
- prepare_rm_conffile "${MOZ_PKG_NAME}" "/etc/${MOZ_PKG_NAME}/profile/bookmarks.html"
- prepare_rm_conffile "${MOZ_PKG_NAME}" "/etc/${MOZ_PKG_NAME}/profile/localstore.rdf"
- prepare_rm_conffile "${MOZ_PKG_NAME}" "/etc/${MOZ_PKG_NAME}/profile/mimeTypes.rdf"
- prepare_rm_conffile "${MOZ_PKG_NAME}" "/etc/${MOZ_PKG_NAME}/profile/prefs.js"
- prepare_rm_conffile "${MOZ_PKG_NAME}" "/etc/${MOZ_PKG_NAME}/profile/chrome/userChrome-example.css"
- prepare_rm_conffile "${MOZ_PKG_NAME}" "/etc/${MOZ_PKG_NAME}/profile/chrome/userContent-example.css"
-
- prepare_mv_conffile "${MOZ_PKG_NAME}" "/etc/${MOZ_PKG_NAME}/pref/waterfox-g.js"
-
-fi
-
-#DEBHELPER#
bgstack15