Install Debian's ion_0.0.20020207-1.diff.gz patch.
[ion1.git] / debian / postinst
blobabae2a487b1178e2c803b7c437b91aaa83f22bce
1 #!/bin/sh
2 set -e
4 PACKAGE=ion
6 if [ "$1" = "configure" ]; then
7 if [ -d /usr/doc -a ! -e /usr/doc/$PACKAGE \
8 -a -d /usr/share/doc/$PACKAGE ]; then
9 ln -sf ../share/doc/$PACKAGE /usr/doc/$PACKAGE
16 FILES="bindings-default.conf ion.conf look-brownsteel.conf
17 look-simpleblue.conf sample.conf bindings-sun.conf
18 kludges.conf look-greyviolet.conf look-wheat.conf"
20 remove_old_cfg () {
21 # In previous versions, ion used /etc/ion as a config dir. It
22 # now uses /etc/X11/ion. We remove the files we copied in preinst
23 for file in $FILES; do
24 if [ -e "/etc/X11/ion/$file" -a -e "/etc/ion/$file" ]; then
25 rm "/etc/ion/$file"
27 done
28 rmdir "/etc/ion" >/dev/null 2>&1 || true
31 remove_old_cfg_abort () {
32 # If upgrade fails, then let the files where they were before
33 # install/upgrade (cancel the 'move' stuff initiated in preinst).
34 for file in $FILES; do
35 if [ -e "/etc/X11/ion/$file" -a -e "/etc/ion/$file" ]; then
36 rm "/etc/X11/ion/$file"
38 done
42 case "$1" in
43 configure) remove_old_cfg ;;
45 abort-upgrade) remove_old_cfg_abort ;;
48 echo "postinst called with unknown argument \`$1'" >&2
49 exit 0
51 esac
54 update-alternatives --install \
55 /usr/bin/x-window-manager x-window-manager /usr/bin/ion 20 \
56 --slave /usr/share/man/man1/x-window-manager.1.gz x-window-manager.1.gz \
57 /usr/share/man/man1/ion.1x.gz
59 if test -x /usr/bin/update-menus; then update-menus; fi