~ubuntu-branches/ubuntu/lucid/wacom-tools/lucid

« back to all changes in this revision

Viewing changes to debian/xserver-xorg-input-wacom.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2009-02-27 00:27:10 UTC
  • Revision ID: james.westby@ubuntu.com-20090227002710-w9za6tsi4oc2dvdk
Tags: 1:0.8.1.6-1ubuntu8
Remove the xserver-xorg-input-wacom init script; the entire script is
better expressed as a single line added to the xserver-xorg-input-wacom
udev rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
# This script can be called in the following ways:
 
3
#
 
4
# Before the package is installed:
 
5
#       <new-preinst> install
 
6
#
 
7
# Before removed package is upgraded:
 
8
#       <new-preinst> install <old-version>
 
9
#
 
10
# Before the package is upgraded:
 
11
#       <new-preinst> upgrade <old-version>
 
12
#
 
13
#
 
14
# If postrm fails during upgrade or fails on failed upgrade:
 
15
#       <old-preinst> abort-upgrade <new-version>
 
16
 
 
17
 
 
18
# Remove a no-longer used conffile
 
19
rm_conffile()
 
20
{
 
21
    CONFFILE="$1"
 
22
 
 
23
    if [ -e "$CONFFILE" ]; then
 
24
        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
 
25
        old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`"
 
26
        if [ "$md5sum" != "$old_md5sum" ]; then
 
27
            echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak"
 
28
            mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
 
29
        else
 
30
            rm -f "$CONFFILE"
 
31
        fi
 
32
    fi
 
33
}
 
34
 
 
35
 
 
36
case "$1" in
 
37
    install|upgrade)
 
38
        rm_conffile /etc/init.d/xserver-xorg-input-wacom
 
39
        ;;
 
40
 
 
41
    abort-upgrade)
 
42
        ;;
 
43
 
 
44
    *)
 
45
        echo "$0 called with unknown argument \`$1'" 1>&2
 
46
        exit 1
 
47
        ;;
 
48
esac
 
49
 
 
50
#DEBHELPER#
 
51
exit 0