source: lliurex-dgti-defaults-configs/trunk/fuentes/debian/prerm @ 6181

Last change on this file since 6181 was 6181, checked in by kbut, 3 years ago

add diversions

File size: 1.9 KB
Line 
1#!/bin/sh
2# prerm script for lliurex-dgti-defaults-configs
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <prerm> `remove'
10#        * <old-prerm> `upgrade' <new-version>
11#        * <new-prerm> `failed-upgrade' <old-version>
12#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
13#        * <deconfigured's-prerm> `deconfigure' `in-favour'
14#          <package-being-installed> <version> `removing'
15#          <conflicting-package> <version>
16# for details, see https://www.debian.org/doc/debian-policy/ or
17# the debian-policy package
18
19package='lliurex-dgti-defaults-configs'
20
21undivert()
22{
23    file="$1"
24    if [ ! -L "$file" ] && [ ! -e "$file" ]; then
25        dpkg-divert --remove --rename --package "$package" "$file"
26    else
27        echo "Not removing diversion of $file by $package" >&2
28    fi
29}
30
31
32
33case "$1" in
34    remove|upgrade|deconfigure)
35        undivert /usr/bin/firefox
36        undivert /usr/share/applications/firefox-esr.desktop
37
38        alternative=$(readlink -f /etc/alternatives/java)
39        oracle_value='/usr/lib/jvm/java-8-oracle/jre/bin/java'
40        if [ '$alternative' = $oracle_value ]; then
41                update-alternative --auto java
42        fi
43        alternative=$(readlink -f /etc/alternatives/mozilla-javaplugin.so)
44        oracle_value='/usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so'
45        if [ '$alternative' = $oracle_value ]; then
46                update-alternative --auto mozilla-javaplugin.so
47        fi
48        alternative=$(readlink -f /etc/alternatives/javaws)
49        oracle_value='/usr/lib/jvm/java-8-oracle/jre/bin/javaws'
50        if [ '$alternative' = $oracle_value ]; then
51                update-alternative --auto javaws
52        fi
53    ;;
54
55    failed-upgrade)
56    ;;
57
58    *)
59        echo "prerm called with unknown argument \`$1'" >&2
60        exit 1
61    ;;
62esac
63
64# dh_installdeb will replace this with shell code automatically
65# generated by other debhelper scripts.
66
67#DEBHELPER#
68
69exit 0
Note: See TracBrowser for help on using the repository browser.