# Fix up preremove script so it will do the KanjiMap substitutions
# involving @kanjiEmbed@ and @kanjiVariant@; otherwise the
# corresponding maps will not be disabled.

PN="texlive-collection-langjapanese"

mv /etc/preremove/${PN}.sh /etc/preremove/${PN}.in
cp /etc/preremove/${PN}.new /etc/preremove/${PN}.sh
/usr/bin/fmtutil-sys --enablefmt platex/eptex
/usr/bin/fmtutil-sys --enablefmt ptex/ptex
/usr/bin/fmtutil-sys --enablefmt eptex/eptex
/usr/bin/fmtutil-sys --enablefmt uplatex/euptex
/usr/bin/fmtutil-sys --enablefmt uptex/uptex
/usr/bin/fmtutil-sys --enablefmt euptex/euptex
if [ ! -f /var/lib/texmf/postinstall/texlive.rebuild_all_fmts ]
then
/usr/bin/fmtutil-sys --byfmt eptex
/usr/bin/fmtutil-sys --byfmt euptex
/usr/bin/fmtutil-sys --byfmt platex
/usr/bin/fmtutil-sys --byfmt ptex
/usr/bin/fmtutil-sys --byfmt uplatex
/usr/bin/fmtutil-sys --byfmt uptex
fi
