File: postinst

package info (click to toggle)
x-ttcidfont-conf 13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 96 kB
  • ctags: 1
  • sloc: sh: 67; makefile: 44
file content (57 lines) | stat: -rw-r--r-- 1,951 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
54
55
56
57
#! /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
    [ -d /etc/X11/fonts/TrueType ] && rmdir --ignore-fail-on-non-empty /etc/X11/fonts/TrueType
    
    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#