I think, `FcDirCacheDeleteUUID()` should not be called from `FcDirCacheRead()`
FcDirCacheDeleteUUID() is called from
But why so often? Say, there are
.uuid files in empty directories. They shouldn't cause any issues. If package manager wants to clear those files, it can call
fc-cache -r. Package managers already call
fc-cache in post-inst scripts, so there should be any difficulties with running it in pre-rm scripts too.
There are no ways to unlink file and change directory in an atomic way. There always will be a gap. More often there are directory modifications due to UUID removal, more opportunities to cause some application to eat CPU. On the other hand, if
FcDirCacheRead() will no longer call
FcDirCacheDeleteUUID(), there will be no need to change mtime back: font installations are usually rare.