Debian Codegraph @

debian/templates/postinst.template

raw
1 #! /bin/sh
2 # Post-install script for ‘@PACKAGE@’.
3 #
4 # Manpage: ‘dh_installdeb(1)’
5
6 set -e
7
8 # Summary of ways this script can be called:
9 # * <postinst> configure <most-recently-configured-version>
10 # * <old-postinst> abort-upgrade <new version>
11 # * <conflictor's-postinst> abort-remove in-favour <package>
12 # <new-version>
13 # * <deconfigured's-postinst> abort-deconfigure in-favour
14 # <failed-install-package> <version> `removing'
15 # <conflicting-package> <version>
16 # For details, see the Debian Policy §6.5 in the ‘debian-policy’ package
17 # or on the web at <URL:http://www.debian.org/doc/debian-policy/>.
18
19 action="$1"
20
21 PRIORITY=50
22 ICONDIR=/usr/share/icons
23 TARGET="${ICONDIR}/default/index.theme"
24 ALTERNATIVE_NAME=x-cursor-theme
25
26 case "$action" in
27 configure)
28 # We work around Bug#392657 by *not* removing and re-installing on
29 # upgrade. Instead, in preinst we remove themes no longer shipped,
30 # and on upgrade we add new themes.
31 for theme in `find $ICONDIR -regex '.*@THEMESET_PREFIX@.*/index\.theme$'`; do
32 if ! update-alternatives --list $ALTERNATIVE_NAME | grep -q "$theme" ; then
33 update-alternatives --install "$TARGET" $ALTERNATIVE_NAME "$theme" $PRIORITY
34 fi
35 done
36 ;;
37
38 abort-upgrade|abort-remove|abort-deconfigure)
39 ;;
40
41 *)
42 printf "postinst called with unknown action ‘%s’\n" "$action" >&2
43 exit 1
44 ;;
45
46 esac
47
48 # ‘dh_installdeb’ will replace this with shell code automatically generated
49 # by other Debhelper scripts.
50
51 #DEBHELPER#
52
53 exit 0