xorg-x11 supplies the /etc/init.d/xfs script. This script contains the
following:
# While we at it, update fontconfig's cache as well
if [ -x /usr/bin/fc-cache -a "${changed}" = "yes" ]
then
ebegin "Updating FC cache"
HOME="/root" /usr/bin/fc-cache -f
eend 0
fi
It appears that the -f flag rebuilds all the font caches even if they are up to
date. When there are a lot of fonts installed, this is a big waste of time,
and significantly slows down boot-up time (the code always executes on
boot-up). On my system, fc-cache -f takes 2 minutes to execute, while fc-cache
takes under a second, both in the typical scenario of no caches to update.
Since fc-cache can apparently detect for itself when rebuilding a cache is
necessary, why is the shell-script check there, when you can just omit the -f
flag instead?
I would rewrite the above code as:
# While we at it, ensure fontconfig's cache is up to date
if [ -x /usr/bin/fc-cache ]
then
ebegin "Updating FC cache"
HOME="/root" /usr/bin/fc-cache
eend 0
fi
Reproducible: Always
Steps to Reproduce: