#!/bin/sh set -e # The whole body runs in a subshell so the cd cannot outlive it. Nothing is # appended after this scriptlet today -- font-alias does not inherit # fontcache, checked against the recipe (`require xorg-font-common.inc', # `inherit allarch') -- so this is about the cd, not about protecting an # fc-cache that is not there. ( cd $D/usr/share/fonts/X11 2>/dev/null || exit 0 for _fa_dir in 100dpi 75dpi cyrillic; do [ -d "$_fa_dir" ] || continue mkfontscale "$_fa_dir" if [ -d encodings ] && [ -d encodings/large ]; then mkfontdir -p /usr/share/fonts/X11/ -e encodings -e encodings/large "$_fa_dir" else mkfontdir "$_fa_dir" fi for _fa_idx in "$_fa_dir/fonts.scale" "$_fa_dir/fonts.dir"; do [ -f "$_fa_idx" ] || continue if [ "$(wc -c < "$_fa_idx")" -le 2 ]; then rm -f "$_fa_idx" fi done done )