mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-04 23:37:14 +08:00
60 lines
1.4 KiB
Plaintext
60 lines
1.4 KiB
Plaintext
configs=(90-ttf-bengali-fonts.conf
|
|
90-ttf-gujarati-fonts.conf
|
|
90-ttf-malayalam-fonts.conf
|
|
90-ttf-punjabi-fonts.conf
|
|
90-ttf-telugu-fonts.conf
|
|
90-ttf-devanagari-fonts.conf
|
|
90-ttf-kannada-fonts.conf
|
|
90-ttf-oriya-fonts.conf
|
|
90-ttf-tamil-fonts.conf)
|
|
post_install() {
|
|
pushd /etc/fonts/conf.d > /dev/null
|
|
for config in "${configs[@]}"; do
|
|
ln -sf ../conf.avail/${config} .
|
|
done
|
|
popd > /dev/null
|
|
fc-cache -fs
|
|
mkfontscale usr/share/fonts/TTF
|
|
mkfontdir usr/share/fonts/TTF
|
|
}
|
|
|
|
post_upgrade() {
|
|
if [ `vercmp 2.30-2 $2` -gt 0 ]; then
|
|
pushd /etc/fonts/conf.d > /dev/null
|
|
for config in "${configs[@]}"; do
|
|
ln -sf ../conf.avail/${config} .
|
|
done
|
|
popd > /dev/null
|
|
fi
|
|
for config in /etc/fonts/conf.d/*; do
|
|
if [ ! -f ${config} ]; then
|
|
rm -f ${config}
|
|
fi
|
|
done
|
|
fc-cache -fs
|
|
mkfontscale usr/share/fonts/TTF
|
|
mkfontdir usr/share/fonts/TTF
|
|
}
|
|
|
|
pre_upgrade() {
|
|
# Link new config files not present on system yet
|
|
pushd /etc/fonts/conf.d > /dev/null
|
|
for config in "${configs[@]}"; do
|
|
if [ ! -f ../conf.avail/${config} ]; then
|
|
ln -sf ../conf.avail/${config} .
|
|
fi
|
|
done
|
|
popd > /dev/null
|
|
}
|
|
|
|
post_remove() {
|
|
pushd /etc/fonts/conf.d > /dev/null
|
|
for config in "${configs[@]}"; do
|
|
rm -f ${config}
|
|
done
|
|
popd > /dev/null
|
|
fc-cache -fs
|
|
mkfontscale usr/share/fonts/TTF
|
|
mkfontdir usr/share/fonts/TTF
|
|
}
|