<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>91470</bug_id>
          
          <creation_ts>2005-05-04 12:05 0000</creation_ts>
          <short_desc>Unnecessary, slow font cache rebuilding</short_desc>
          <delta_ts>2006-11-16 19:39:17 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <keywords>Inclusion</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jim@bugs.gentoo.org.dabell.name</reporter>
          <assigned_to>x11@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>jim@bugs.gentoo.org.dabell.name</who>
            <bug_when>2005-05-04 12:05:43 0000</bug_when>
            <thetext>xorg-x11 supplies the /etc/init.d/xfs script.  This script contains the following:

# While we at it, update fontconfig&apos;s cache as well
if [ -x /usr/bin/fc-cache -a &quot;${changed}&quot; = &quot;yes&quot; ]
then
    ebegin &quot;Updating FC cache&quot;
    HOME=&quot;/root&quot; /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&apos;s cache is up to date
if [ -x /usr/bin/fc-cache ]
then
    ebegin &quot;Updating FC cache&quot;
    HOME=&quot;/root&quot; /usr/bin/fc-cache
    eend 0
fi



Reproducible: Always
Steps to Reproduce:</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dberkholz@gentoo.org</who>
            <bug_when>2005-05-04 17:39:41 0000</bug_when>
            <thetext>You&apos;re clearly correct that the -f is a bad idea on a number of levels. But since we already have ${changed}, why waste the time of even running fc-cache if it&apos;s unnecessary?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>foser@gentoo.org</who>
            <bug_when>2005-05-05 04:30:52 0000</bug_when>
            <thetext>I didn&apos;t know it was there, &apos;fc-cache -f&apos; was bad for the fonts eclass (altough that will change). But I think there is indeed little point in having it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dberkholz@gentoo.org</who>
            <bug_when>2005-05-23 20:13:01 0000</bug_when>
            <thetext>Fixed in 6.8.2-r2 and 6.8.99.5. Thanks!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jim@bugs.gentoo.org.dabell.name</who>
            <bug_when>2006-11-16 19:39:17 0000</bug_when>
            <thetext>Closing.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>