Created attachment 125020 [details] [review]
Skip over .dpkg-tmp files
During package upgrades, it happened multiple times that the labels of my GNOME application have been replaced by many squares. When this happens, fc-list returns entries such as this one:
And that file is already gone at that time... this file is created by dpkg during its unpack procedure but it is renamed back into its definitive name at the end of the unpack procedure. It's not clear what is running the fc-cache run at the wrong time (I suspect gnome-settings-daemon... does a call to FcInitReinitialize updates the user's cache?). "fc-cache -s" is also run after the unpack through a dpkg trigger and this update seems to not be enough to have the desktop switch back to the correct font file.
I would suggest that fontconfig should skip over files finishing with .dpkg-tmp (as in the attached patch, currently untested but it compiles fine) or that it considers only files with extensions that are known font files.
This has been initially reported in Debian bug https://bugs.debian.org/828037
Ping? We have been using the patch I prepared in Kali Linux and I haven't had any new report since then so I guess it's working. It would be nice to have some comment from you and have this bug fixed upstream.
I don't want to include any specific fixes in fontconfig. just to ignore reading certain caches, you could try:
This would works unless anyone has any <acceptfont> rule there which may matches such temporary file as well.
Thanks for the suggestion Akira. I confirm that your configuration snippet has the expected result.
I'll make sure it gets included in Debian. You might still want to include that rule in a conf.d/70-dpkg.conf file on the upstream side for example.
(In reply to Raphaël Hertzog from comment #3)
> Thanks for the suggestion Akira. I confirm that your configuration snippet
> has the expected result.
> I'll make sure it gets included in Debian. You might still want to include
> that rule in a conf.d/70-dpkg.conf file on the upstream side for example.
If this issue affects more widely, perhaps. otherwise it should be added and maintained in their own. for instance, Ubuntu also uses the deb format for packaging though, I suppose they might be also watching the changes in Debian. so I'd suggest maintaining it yourself would be a good option.
I'll close this at this moment.