| 1 |
#! /bin/sh |
| 2 |
# Pre-remove script for ‘@PACKAGE@’. |
| 3 |
# |
| 4 |
# Manpage: ‘dh_installdeb(1)’ |
| 5 |
|
| 6 |
set -e |
| 7 |
|
| 8 |
# Summary of ways 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 |
| 13 |
# in-favour <package> <new-version> |
| 14 |
# * <deconfigured's-prerm> deconfigure |
| 15 |
# in-favour <package-being-installed> <version> |
| 16 |
# removing <conflicting-package> <version> |
| 17 |
# For details, see the Debian Policy §6.5 in the ‘debian-policy’ package |
| 18 |
# or on the web at <URL:http://www.debian.org/doc/debian-policy/>. |
| 19 |
|
| 20 |
action="$1" |
| 21 |
|
| 22 |
ICONDIR=/usr/share/icons |
| 23 |
ALTERNATIVE_NAME=x-cursor-theme |
| 24 |
|
| 25 |
case "$action" in |
| 26 |
remove|deconfigure) |
| 27 |
for theme in `find "$ICONDIR" -regex '.*@THEMESET_PREFIX@.*/index\.theme$'`; do |
| 28 |
update-alternatives --remove $ALTERNATIVE_NAME "$theme" |
| 29 |
done |
| 30 |
;; |
| 31 |
|
| 32 |
upgrade) |
| 33 |
# We work around Bug#392657 by *not* removing and |
| 34 |
# re-installing on upgrade. Instead, we remove themes no |
| 35 |
# longer shipped in preinst, and add new themes on upgrade. |
| 36 |
;; |
| 37 |
|
| 38 |
failed-upgrade) |
| 39 |
;; |
| 40 |
|
| 41 |
*) |
| 42 |
printf "prerm 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 |