~mozillateam/firefox/firefox.disco

« back to all changes in this revision

Viewing changes to debian/firefox.postinst.in

  • Committer: Chris Coulson
  • Date: 2011-12-22 20:08:30 UTC
  • mto: This revision was merged to the branch mainline in revision 884.
  • Revision ID: chris.coulson@canonical.com-20111222200830-h736v2lu2zljx9h3
* New upstream release from the beta channel (FIREFOX_10_0b1_BUILD1)
* Update globalmenu-extension to 2.0.2
  - Fix LP: #864511 - Icons not displayed in history/bookmarks menus
* Update patches for PRBool -> bool transition
  - refresh debian/patches/firefox-kde.patch
  - refresh debian/patches/mozilla-kde.patch
  - refresh debian/patches/ubuntu-ua-string-changes.patch
* Drop some more hanging IPC xpcshell tests
  - update debian/build/testsuite.mk
* Borrow functionality from Chromium package to have distro-version
  specific patches
  - update debian/rules
  - add debian/build/enable-dist-patches.pl
* Don't enable unity-globalmenu-build-support.patch on lucid and maverick
  - update debian/patches/series
* Remove prerm hook for cleaning up pyc files in the apport package-hooks
  folder. Nothing creates these
  - update debian/firefox.prerm.in
* Set up alternatives in the postinst script on abort-remove
  - update debian/firefox.postinst.in
* Imporove maintainer script magic for moving the system pref file and
  removing obsolete conffiles when upgrading from 3.6, by doing what
  dpkg-maintscripts-helper does
  - update debian/firefox.postinst.in
  - update debian/firefox.postrm.in
  - update debian/firefox.preinst.in
* Only run the Apparmor stuff in the postinst script on configure, and
  in the preinst script on install or upgrade
  - update debian/firefox.postinst.in
  - update debian/firefox.preinst.in
* Add add-syspref-dir.patch for Lucid and Maverick only, so we get
  nightly/aurora coverage for this
  - add debian/patches/add-syspref-dir.patch
  - update debian/patches/series
  - update debian/rules
  - update debian/firefox.install.in
  - update debian/firefox.links.in
  - update debian/firefox.postinst.in
  - update debian/firefox.postrm.in
  - update debian/firefox.preinst.in
* Drop the Ubuntuzilla workarounds now
  - update debian/firefox.postinst.in
* Refresh patches
  - update debian/patches/mozilla-kde.patch
  - update debian/patches/allow-lockPref-everywhere.patch
  - update debian/patches/ubuntu_bookmarks.patch
* Turn off Network Manager integration for now, as it causes Firefox to
  always start in offline mode. In any case, probing Network Manager isn't
  the most reliable way to test if there is a connection
  - update debian/vendor.js
* Update after landing of bmo: #701875 - Rename omni.jar to omni.ja
  - update debian/firefox.install.in
* Update mozilla-kde.patch and firefox-kde.patch to remove the use of
  nsCStringArray, which was dropped from Firefox 10
* Disable KDE patches, which currently don't work with Firefox 10
  - update debian/patches/series
* Drop the firefox-kde-support suggest whilst the KDE patches aren't
  applied. Also facilitate adding his suggest only on oneiric and older
  - update debian/rules
  - update debian/control{,.in}
* Rebase patches for PRBool -> bool transition (bmo: 675553)
  - update debian/patches/allow-lockPref-everywhere.patch
  - update debian/patches/mozilla-kde.patch
* Drop patch after upstream landing of (bmo: 690432) aka Logging.h passes a
  string directly to printf
  - drop debian/patches/printf-fix.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
MOZ_LIBDIR=@MOZ_LIBDIR@
6
6
MOZ_APP_NAME=@MOZ_APP_NAME@
7
7
 
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!
11
 
        BROKEN=1
12
 
    else
13
 
        BROKEN=0
14
 
    fi
15
 
 
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/
21
 
        BROKEN=0
22
 
    fi
23
 
 
24
 
    if [ "$BROKEN" = "0" ] ; then
25
 
        update-alternatives --install /usr/bin/gnome-www-browser \
26
 
            gnome-www-browser /usr/bin/$MOZ_APP_NAME 40
27
 
 
28
 
        update-alternatives --install /usr/bin/x-www-browser \
29
 
            x-www-browser /usr/bin/$MOZ_APP_NAME 40
30
 
    else
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***"
37
 
        else
38
 
            echo "/usr/bin/$MOZ_APP_NAME has been diverted by $PACKAGE"
39
 
        fi
40
 
    fi
41
 
 
 
8
# Move a conffile without triggering a dpkg question
 
9
finish_mv_conffile() {
 
10
    local OLDCONFFILE="$1"
 
11
    local NEWCONFFILE="$2"
 
12
 
 
13
    rm -f $OLDCONFFILE.dpkg-remove
 
14
 
 
15
    [ -e "$OLDCONFFILE" ] || return 0
 
16
 
 
17
    echo "Preserving user changes to $NEWCONFFILE (renamed from $OLDCONFFILE)..."
 
18
    mv -f "$NEWCONFFILE" "$NEWCONFFILE.dpkg-new"
 
19
    mv -f "$OLDCONFFILE" "$NEWCONFFILE"
 
20
}
 
21
 
 
22
finish_rm_conffile() {
 
23
    local CONFFILE="$1"
 
24
 
 
25
    if [ -e "$CONFFILE.dpkg-backup" ]; then
 
26
        mv -f "$CONFFILE.dpkg-backup" "$CONFFILE.dpkg-bak"
 
27
    fi
 
28
    if [ -e "$CONFFILE.dpkg-remove" ]; then
 
29
        echo "Removing obsolete conffile $CONFFILE ..."
 
30
        rm -f "$CONFFILE.dpkg-remove"
 
31
    fi
 
32
}
 
33
 
 
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
 
37
 
 
38
    update-alternatives --install /usr/bin/x-www-browser \
 
39
        x-www-browser /usr/bin/$MOZ_APP_NAME 40
 
40
fi
 
41
 
 
42
if [ "$1" = "configure" ] ; then
42
43
    #
43
44
    # AppArmor
44
45
    #
100
101
    #
101
102
    # End AppArmor
102
103
    #
 
104
 
 
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"
 
111
 
 
112
%%ifdef MOZ_NEW_SYSPREF
 
113
    finish_mv_conffile "/etc/${MOZ_APP_NAME}/pref/firefox.js" "/etc/${MOZ_APP_NAME}/syspref.js"
 
114
%%endif
 
115
 
 
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
 
119
    fi
 
120
    if [ ! -e $MOZ_LIBDIR/distribution ]; then
 
121
        ln -s /usr/lib/$MOZ_APP_NAME-addons/distribution $MOZ_LIBDIR/distribution
 
122
    fi
 
123
%%endif
103
124
fi
104
125
 
105
126
# Move a conffile without triggering a dpkg question