If font modifications occur during the second after fc-cache writes a cache file then the next call to fc-cache won't pick up the changes. This is very likely to occur when installing a bunch of font packages in a row. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=140335 Very simple solution is to sleep a second before the end of fc-cache. I'll attach a patch for that. Long term, it might be good to do something more complex, add locking and try to deal with parallel font installation as well. (One possibility is to have a way to tell fc-cache that something was known to change in a particular directory, and it would automatically not trust that directory and the parent directory)
Created attachment 1438 [details] [review] Patch adding sleep() The gettimeofday() checks in this patch are a little paranoid - my memory is that sleep() will be woken up by sigsuspend(), etc, and I don't entirely trust sleep(1) not to sleep say, 0.9 seconds. They'd need conditionalization with a configure.ac check since they won't work on windows.
I'm just sleeping for two seconds; there's no need to be paranoid in this code; it's not in the library, and we know there aren't any signals involved. If people are using SIGSTOP or SIGTSTP in installation scripts, they've got more serious issues...
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.