File: postinst

package info (click to toggle)
xfonts-wqy 1.0.0~rc1-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 23,900 kB
  • sloc: perl: 98; makefile: 95; sh: 90
file content (48 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -e

case "$1" in
    configure)
	# remove bogus backup directory generated by preinst
	rm -rf /etc/X11/fonts/misc/xfonts-wqy.alias.dpkg-* || true

	. /usr/share/debconf/confmodule

	CONFAVAIL=/etc/fonts/conf.avail
	CONFDIR=/etc/fonts/conf.d

	db_get xfonts-wqy/enable_wqy
	enable_wqy="$RET"

	wqy_old_conf="70-debconf-wqy.conf"
	wqy_old_conf_2="85-xfonts-wqy.conf"
	wqy_conf="85-xfonts-wqy-1.conf"

	if [ -h $CONFDIR/$wqy_old_conf ]; then
	    rm -f $CONFDIR/$wqy_old_conf
	fi

	if [ -h $CONFDIR/$wqy_old_conf_2 ]; then
	    rm -f $CONFDIR/$wqy_old_conf_2
	fi

	if [ -h $CONFDIR/$wqy_conf ]; then
	    rm -f $CONFDIR/$wqy_conf
	fi

	if [ "$enable_wqy" = "true" ]; then
	    ln -s $CONFAVAIL/$wqy_conf $CONFDIR
	fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
	echo "postinst called with unknown argument \`$1'" >&2
	exit 1
    ;;
esac

#DEBHELPER#