5
5
MOZ_LIBDIR=@MOZ_LIBDIR@
6
6
MOZ_APP_NAME=@MOZ_APP_NAME@
8
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] ; then
9
if [ `dpkg-divert --truename /usr/bin/$MOZ_APP_NAME` != "/usr/bin/$MOZ_APP_NAME" ] ; then
10
# Ubuntuzilla has trashed this install. Grrrrrrrrrr!
16
if [ ! -x /usr/bin/$MOZ_APP_NAME ] && [ "$BROKEN" = "1" ] ; then
17
echo "***Your system has been left in a broken state by a third party package***"
18
echo "This is usually caused by installing packages from Ubuntuzilla. Fixing this now"
19
dpkg-divert --rename --remove /usr/bin/$MOZ_APP_NAME
20
# Yay! We are sane again now \o/
24
if [ "$BROKEN" = "0" ] ; then
25
update-alternatives --install /usr/bin/gnome-www-browser \
26
gnome-www-browser /usr/bin/$MOZ_APP_NAME 40
28
update-alternatives --install /usr/bin/x-www-browser \
29
x-www-browser /usr/bin/$MOZ_APP_NAME 40
31
PACKAGE=`dpkg-divert --listpackage /usr/bin/$MOZ_APP_NAME`
32
if [ "$PACKAGE" = "LOCAL" ] ; then
33
echo "/usr/bin/$MOZ_APP_NAME has been diverted by a third party package which didn't specify"
34
echo "a package name to dpkg-divert. This is usually as a result of installing unsupported"
35
echo "packages from Ubuntuzilla."
36
echo "***This is a BUG. Please report this bug to the vendor of the third party package you installed***"
38
echo "/usr/bin/$MOZ_APP_NAME has been diverted by $PACKAGE"
8
# Move a conffile without triggering a dpkg question
10
local OLDCONFFILE="$1"
11
local NEWCONFFILE="$2"
13
rm -f $OLDCONFFILE.dpkg-remove
15
[ -e "$OLDCONFFILE" ] || return 0
17
echo "Preserving user changes to $NEWCONFFILE (renamed from $OLDCONFFILE)..."
18
mv -f "$NEWCONFFILE" "$NEWCONFFILE.dpkg-new"
19
mv -f "$OLDCONFFILE" "$NEWCONFFILE"
22
finish_rm_conffile() {
25
if [ -e "$CONFFILE.dpkg-backup" ]; then
26
mv -f "$CONFFILE.dpkg-backup" "$CONFFILE.dpkg-bak"
28
if [ -e "$CONFFILE.dpkg-remove" ]; then
29
echo "Removing obsolete conffile $CONFFILE ..."
30
rm -f "$CONFFILE.dpkg-remove"
34
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-remove" ] ; then
35
update-alternatives --install /usr/bin/gnome-www-browser \
36
gnome-www-browser /usr/bin/$MOZ_APP_NAME 40
38
update-alternatives --install /usr/bin/x-www-browser \
39
x-www-browser /usr/bin/$MOZ_APP_NAME 40
42
if [ "$1" = "configure" ] ; then
105
finish_rm_conffile "/etc/${APP_NAME}/profile/bookmarks.html"
106
finish_rm_conffile "/etc/${APP_NAME}/profile/localstore.rdf"
107
finish_rm_conffile "/etc/${APP_NAME}/profile/mimeTypes.rdf"
108
finish_rm_conffile "/etc/${APP_NAME}/profile/prefs.js"
109
finish_rm_conffile "/etc/${APP_NAME}/profile/chrome/userChrome-example.css"
110
finish_rm_conffile "/etc/${APP_NAME}/profile/chrome/userContent-example.css"
112
%%ifdef MOZ_NEW_SYSPREF
113
finish_mv_conffile "/etc/${MOZ_APP_NAME}/pref/firefox.js" "/etc/${MOZ_APP_NAME}/syspref.js"
116
%%ifdef MOZ_SYMLINKED_DIST
117
if [ -d $MOZ_LIBDIR/distribution ] && [ ! -h $MOZ_LIBDIR/distribution ]; then \
118
rmdir --ignore-fail-on-non-empty $MOZ_LIBDIR/distribution
120
if [ ! -e $MOZ_LIBDIR/distribution ]; then
121
ln -s /usr/lib/$MOZ_APP_NAME-addons/distribution $MOZ_LIBDIR/distribution
105
126
# Move a conffile without triggering a dpkg question