~ubuntu-branches/debian/sid/thaifonts-scalable/sid

5 by Theppitak Karoonboonyanan
* debian/ttf-thai-tlwg.preinst, debian/otf-thai-tlwg.preinst:
1
#! /bin/sh
2
# preinst script for otf-thai-tlwg
3
#
4
# see: dh_installdeb(1)
5
6
set -e
7
8
# summary of how this script can be called:
9
#        * <new-preinst> `install'
10
#        * <new-preinst> `install' <old-version>
11
#        * <new-preinst> `upgrade' <old-version>
12
#        * <old-preinst> `abort-upgrade' <new-version>
13
#
14
# For details see /usr/share/doc/packaging-manual/
15
7 by Theppitak Karoonboonyanan
* debian/{t1,ttf,otf}-thai-tlwg.preinst:
16
# Remove obsolete conffile
5 by Theppitak Karoonboonyanan
* debian/ttf-thai-tlwg.preinst, debian/otf-thai-tlwg.preinst:
17
rm_conffile() {
7 by Theppitak Karoonboonyanan
* debian/{t1,ttf,otf}-thai-tlwg.preinst:
18
    local PKGNAME="$1"
19
    local CONFFILE="$2"
20
    [ -e "$CONFFILE" ] || return 0
5 by Theppitak Karoonboonyanan
* debian/ttf-thai-tlwg.preinst, debian/otf-thai-tlwg.preinst:
21
7 by Theppitak Karoonboonyanan
* debian/{t1,ttf,otf}-thai-tlwg.preinst:
22
    local md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
23
    local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME \
24
                | sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
25
    if [ "$md5sum" != "$old_md5sum" ]; then
26
        echo "Obsolete conffile $CONFFILE has been modified by you."
27
        echo "Saving as $CONFFILE.dpkg-bak ..."
28
        mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
29
    else
30
        echo "Removing obsolete conffile $CONFFILE ..."
31
        rm -f "$CONFFILE"
5 by Theppitak Karoonboonyanan
* debian/ttf-thai-tlwg.preinst, debian/otf-thai-tlwg.preinst:
32
    fi
33
}
34
35
case "$1" in
36
    install|upgrade)
7 by Theppitak Karoonboonyanan
* debian/{t1,ttf,otf}-thai-tlwg.preinst:
37
        if dpkg --compare-versions "$2" lt-nl "1:0.4.12-1"; then
5.1.2 by Theppitak Karoonboonyanan
* New upstream bugfix release.
38
	    rm_conffile otf-thai-tlwg "/etc/fonts/conf.avail/90-otf-thai-tlwg-synthetic.conf"
39
	fi
7 by Theppitak Karoonboonyanan
* debian/{t1,ttf,otf}-thai-tlwg.preinst:
40
        if dpkg --compare-versions "$2" lt-nl "1:0.4.13-3"; then
41
            HINTS_FILE="/etc/defoma/hints/otf-thai-tlwg.hints"
42
            if [ -f $HINTS_FILE ] && [ -x /usr/bin/defoma-font ]; then
43
                defoma-font purge-all $HINTS_FILE || true
44
            fi
45
	    rm_conffile otf-thai-tlwg $HINTS_FILE
46
	fi
5 by Theppitak Karoonboonyanan
* debian/ttf-thai-tlwg.preinst, debian/otf-thai-tlwg.preinst:
47
    ;;
48
49
    abort-upgrade)
50
    ;;
51
52
    *)
53
        echo "preinst called with unknown argument \`$1'" >&2
54
        exit 0
55
    ;;
56
esac
57
58
# dh_installdeb will replace this with shell code automatically
59
# generated by other debhelper scripts.
60
61
#DEBHELPER#
62
63
exit 0
64
65