options: Make dynamic dup hack work with new options
[mplayer.git] / debian / config
blobab3c8c1b5b6be181fe637954923234a45751c3ab
1 #!/bin/sh
3 CONFIGFILE=/etc/mplayer/mplayer.conf
5 set -e
7 # Source debconf library.
8 . /usr/share/debconf/confmodule
10 if test -r $CONFIGFILE && ! grep -q '### mplayer DEBCONF AREA' $CONFIGFILE
11 then
12 db_input medium 'mplayer/replace-existing-files' || true
13 db_go || true
14 if [ "$RET" != "true" ]; then
15 exit 0
17 db_get 'mplayer/replace-existing-files' || true
20 ########################################## find fonts
21 #default font (if available)
22 BESTFONT=/usr/share/fonts/truetype/Arial.ttf
23 [ -r $BESTFONT ] || BESTFONT=/usr/share/fonts/truetype/freefont/FreeSans.ttf
25 t=$(tempfile -p fonts )
26 find /usr/share/fonts/ /?/?in*/?ont* -type f -iname '*.ttf' -maxdepth 3 2> /dev/null > $t || true
28 if test -s $t
29 then
30 fonts=$( awk '{print a $0;a=", "}' $t || true )
31 db_subst "mplayer/ttfont" ttfontchoices $fonts || true
32 ## suppose the question is skipped: give a default
33 a=$BESTFONT
34 [ -r $BESTFONT ] || a=$(head -1 $t)
35 db_subst "mplayer/ttfont" ttfontdefault $a || true
37 db_input medium mplayer/ttfont || true
38 if [ "$?" = 30 ] ; then
39 db_set mplayer/ttfont $a || true
41 else
42 db_input medium "mplayer/no-ttfont" || true
45 rm $t
47 db_go || true
49 ############################################################
52 exit 0