File: postinst

package info (click to toggle)
x-ttcidfont-conf 32
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 208 kB
  • sloc: sh: 70; makefile: 30
file content (61 lines) | stat: -rw-r--r-- 2,057 bytes parent folder | download | duplicates (4)
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
54
55
56
57
58
59
60
61
#! /bin/sh

set -e

. /usr/share/debconf/confmodule

FILE='/etc/defoma/config/x-ttcidfont-conf.conf'

case $1 in
    configure)
    rm -f /etc/X11/fonts/TrueType/x-ttcid.alias /etc/X11/fonts/TrueType/x-ttcid.scale
    rm -f /etc/X11/fonts/CID/x-ttcid.alias /etc/X11/fonts/CID/x-ttcid.scale
    [ -d /etc/X11/fonts/CID ] && rmdir --ignore-fail-on-non-empty /etc/X11/fonts/CID
    if [ -L /etc/X11/fonts/TrueType ] ; then
      rm /etc/X11/fonts/TrueType
    else if [ -d /etc/X11/fonts/TrueType ] ; then
      rmdir --ignore-fail-on-non-empty /etc/X11/fonts/TrueType
    fi fi
    
    if [ -d /etc/X11/fonts/defoma/TrueType ]; then
      rm -f /etc/X11/fonts/defoma/TrueType/x-ttcid.alias /etc/X11/fonts/defoma/TrueType/x-ttcid.scale
      rmdir --ignore-fail-on-non-empty /etc/X11/fonts/defoma/TrueType
    fi
    if [ -d /etc/X11/fonts/defoma/CID ]; then
      rm -f /etc/X11/fonts/defoma/CID/x-ttcid.alias /etc/X11/fonts/defoma/CID/x-ttcid.scale
      rmdir --ignore-fail-on-non-empty /etc/X11/fonts/defoma/CID
    fi
    [ -d /etc/X11/fonts/defoma ] && rmdir --ignore-fail-on-non-empty /etc/X11/fonts/defoma
    [ -d /var/lib/defoma/x-ttcid.d ] && rm -rf /var/lib/defoma/x-ttcid.d
    
    db_get x-ttcidfont-conf/tt_backend || true
    
    echo "# IF YOU EDIT THIS FILE MANUALLY, RUN:" > $FILE
    echo "#   defoma-app update x-ttcidfont-conf truetype" >> $FILE
    echo "# TO REFLECT THE CHANGE." >> $FILE
    echo "# The following variable decides which method is used for" >> $FILE
    echo "# handling truetype fonts." >> $FILE
    echo "X_TRUETYPE_METHOD=$RET" >> $FILE
    
    db_get x-ttcidfont-conf/xtt_vl || true

    echo "# The following variable decides if X calculate font" >> $FILE
    echo "# metrics in the very lazy way when the method is xtt." >> $FILE
    case "X$RET" in
	Xtrue) echo "XTT_VL=y" >> $FILE ;;
	*) echo "XTT_VL=n" >> $FILE ;;
    esac
    
    ;;
    
    abort-upgrade|abort-remove|abort-deconfigure)
    ;;
    
    *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 0
    ;;
esac

#DEBHELPER#