[go: up one dir, main page]

File: prerm

package info (click to toggle)
svgalib 1%3A1.4.3-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,572 kB
  • ctags: 9,256
  • sloc: ansic: 59,532; makefile: 1,337; asm: 630; sh: 162; perl: 54; pascal: 49
file content (53 lines) | stat: -rw-r--r-- 1,734 bytes parent folder | download
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