Install Debian's ion_0.0.20020207-1.diff.gz patch.
[ion1.git] / debian / preinst
blob5aba9c1e8117053171dd2ac20e86e29ce3e05302
1 #! /bin/sh
2 set -e
4 FILES="bindings-default.conf ion.conf look-brownsteel.conf
5 look-simpleblue.conf sample.conf bindings-sun.conf
6 kludges.conf look-greyviolet.conf look-wheat.conf"
8 rename_conf () {
9 for file in $FILES; do
10 if [ -e "/etc/ion/$file" -a ! -e "/etc/X11/ion/$file" ]; then
11 # We first copy the file, it'll be removed in
12 # postinst. This allows us to unwind if install/upgrade
13 # fails or is aborted.
14 echo "Copying /etc/ion/$file to /etc/X11/ion"
15 test -d "/etc/X11/ion" || mkdir "/etc/X11/ion"
16 cp -a "/etc/ion/$file" "/etc/X11/ion/"
18 done
21 rename_conf_abort () {
22 for file in $FILES; do
23 if [ -e "/etc/ion/$file" -a -e "/etc/X11/ion/$file" ]; then
24 rm "/etc/X11/ion/$file"
26 done
29 case "$1" in
30 install|upgrade) rename_conf ;;
31 abort-upgrade) rename_conf_abort ;;
34 echo "preinst called with unknown argument \`$1'" >&2
35 exit 0
37 esac