File: keytouch.postrm

package info (click to toggle)
keytouch 2.3.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,480 kB
  • ctags: 1,475
  • sloc: ansic: 9,591; sh: 4,008; makefile: 466; perl: 75
file content (52 lines) | stat: -rw-r--r-- 1,370 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
#!/bin/sh

CONFFILE1="/etc/X11/Xsession.d/91keytouch-acpid_launch"
CONFFILE2="/etc/X11/Xsession.d/92keytouchd_launch"

case "$1" in
abort-upgrade)

  if dpkg --compare-versions "$2" le "2.2.2-2"; then
    
    ## Our preinst tried to remove or rename obsolete conffiles. If we're here
    ## it means instalation failed and dpkg is trying to revert to the previous
    ## version, which uses said conffiles.
    ## We try to recover them. If we can't we signal dpkg, and the package
    ## will be left in half-installed, needs-reinstall state. That avoids
    ## the posibility the user just runs dpkg --configure on the
    ## unpacked previous version and is left with a package with
    ## conffiles missing and no notice of it.

    if [ ! -f "$CONFFILE1" ] ; then
        if [ ! -f "$CONFFILE1".dpkg-bak ]; then
                exit 1;
        fi

        mv "$CONFFILE1".dpkg-bak "$CONFFILE1"
    fi

    if [ ! -f "$CONFFILE2" ] ; then
        if [ ! -f "$CONFFILE2".dpkg-bak ]; then
                exit 1;
        fi

        mv "$CONFFILE2".dpkg-bak "$CONFFILE2"
    fi

  fi
esac

case "$1" in
purge)
 if [ -f /etc/keytouch/current_keyboard.xml ] ; then
     rm /etc/keytouch/current_keyboard.xml 
     rmdir /etc/keytouch
 fi
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0