preinst is in comixcursors-lefthanded 0.8.2-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | #! /bin/sh
# Pre-install script for ‘comixcursors-lefthanded’.
#
# Manpage: ‘dh_installdeb(1)’
set -e
# Summary of ways this script can be called:
# * <new-preinst> install
# * <new-preinst> install <old-version>
# * <new-preinst> upgrade <old-version>
# * <old-preinst> abort-upgrade <new-version>
# For details, see the Debian Policy §6.5 in the ‘debian-policy’ package
# or on the web at <URL:http://www.debian.org/doc/debian-policy/>.
action="$1"
# All of the size-specific themes are removed in version 0.8.
REMOVED_LIST=$(
for colour in Black Blue Green Orange Red White ; do
color_suffix="-$colour"
for size in Huge Large Regular Small ; do
size_suffix="-$size"
for width_suffix in "" "-Slim" ; do
printf "ComixCursors%s%s%s\n" \
"$color_suffix" "$size_suffix" "$width_suffix"
done
done
done)
ICONDIR=/usr/share/icons
ALTERNATIVE_NAME=x-cursor-theme
remove_omitted_alternatives () {
# Remove themes installed by previous versions but omitted
# from this version of the package.
list_alternatives_cmd="update-alternatives --list $ALTERNATIVE_NAME"
# We need to test this explicitly to avoid exiting with an error when
# listing the alternatives.
if ! ( $list_alternatives_cmd > /dev/null 2>&1 ) ; then
# No alternatives installed, so we're done.
return
fi
installed_cursor_themes=`$list_alternatives_cmd`
for theme in $REMOVED_LIST ; do
theme_dir="${ICONDIR}/${theme}"
theme_file="${theme_dir}/index.theme"
if printf "$installed_cursor_themes" | grep -q "${theme_file}" ; then
update-alternatives --remove $ALTERNATIVE_NAME "${theme_file}"
rm -f "${theme_dir}"
fi
done
}
case "$action" in
upgrade)
remove_omitted_alternatives
;;
install|abort-upgrade)
;;
*)
printf "preinst called with unknown action ‘%s’\n" "$action" >&2
exit 1
;;
esac
# ‘dh_installdeb’ will replace this with shell code automatically generated
# by other debhelper scripts.
exit 0
|