2006-01-08 18:33:54 +00:00
|
|
|
#!/bin/sh
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
CONFIGFILE=/etc/mplayer/mplayer.conf
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
set -e
|
2002-02-03 20:27:20 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
# Source debconf library.
|
|
|
|
. /usr/share/debconf/confmodule
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
if test -r $CONFIGFILE && ! grep -q '### mplayer DEBCONF AREA' $CONFIGFILE
|
|
|
|
then
|
|
|
|
db_input medium 'mplayer/replace-existing-files' || true
|
|
|
|
db_go || true
|
|
|
|
if [ "$RET" != "true" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
db_get 'mplayer/replace-existing-files' || true
|
|
|
|
fi
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
########################################## find fonts
|
|
|
|
#default font (if available)
|
|
|
|
BESTFONT=/usr/share/fonts/truetype/Arial.ttf
|
|
|
|
[ -r $BESTFONT ] || BESTFONT=/usr/share/fonts/truetype/freefont/FreeSans.ttf
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
t=$(tempfile -p fonts )
|
|
|
|
find /usr/share/fonts/ /?/?in*/?ont* -type f -iname '*.ttf' -maxdepth 3 2> /dev/null > $t || true
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
if test -s $t
|
|
|
|
then
|
|
|
|
fonts=$( awk '{print a $0;a=", "}' $t || true )
|
|
|
|
db_subst "mplayer/ttfont" ttfontchoices $fonts || true
|
|
|
|
## suppose the question is skipped: give a default
|
|
|
|
a=$BESTFONT
|
|
|
|
[ -r $BESTFONT ] || a=$(head -1 $t)
|
|
|
|
db_subst "mplayer/ttfont" ttfontdefault $a || true
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
db_input medium mplayer/ttfont || true
|
|
|
|
if [ "$?" = 30 ] ; then
|
|
|
|
db_set mplayer/ttfont $a || true
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
db_input medium "mplayer/no-ttfont" || true
|
|
|
|
fi
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
rm $t
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
db_go || true
|
2001-07-28 07:54:52 +00:00
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
############################################################
|
2001-07-28 07:54:52 +00:00
|
|
|
|
|
|
|
|
2006-01-08 18:33:54 +00:00
|
|
|
exit 0
|