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
|
#!/bin/sh
_type="$1"
_vers="$2"
if [ "$_type" = "upgrade" -o "$_type" = "remove" ]; then
if [ -L /usr/doc/#PACKAGE# ]; then
rm -f /usr/doc/#PACKAGE#
fi
fi
test "$_type" = upgrade || exit 0
test -f /etc/vga/libvga.config || exit 0
set -e
# record the current mouse type
#
# hopefully now all the people who have microsoft mice will be able to live
# with the default type being unconfigured, although they will have to change
# it once.
#
# we only do this iff:
# 1. We haven't already done it one.
# 2. We can find a mouse line in the config file
# 3. It isn't already set to unconfigured.
MOUSEFILE=/etc/vga/libvga.installer.mousetype
CONFFILE=/etc/vga/libvga.config
if test ! -f "$MOUSEFILE"; then
if MOUSETYPE=`grep -i '^mouse [A-Za-z0-9]*$' $CONFFILE`; then
if test "$MOUSETYPE" != "mouse unconfigured"; then
echo "Preserving old mouse type setting in $MOUSEFILE."
{ echo '# this file contains your mouse type setting, which is preserved'
echo '# over the installation of SVGAlib so you can keep the canonical'
echo '# config file apart from the mouse type. As long as you edit'
echo '# nothing else, the package will upgrade correctly without bothering'
echo '# you about having changed the config file.'
echo '#'
echo '# This is especially useful given that the default mouse type has'
echo '# changed to unconfigured, which wont suit many people.'
echo '#'
echo '# If for some reason the package wont configure, you can safely delete'
echo '# this file and change the mouse type manually.'
echo '#'
echo 'MOUSELINE="'"$MOUSETYPE"'"'
} > "$MOUSEFILE"
cp $CONFFILE $CONFFILE.bak
sed "s;^$MOUSETYPE\$;mouse unconfigured;g" $CONFFILE.bak > $CONFFILE
fi
fi
fi
|