Bug 96896 - fontconfig caches/registers dpkg temporary files instead of ignoring them
Summary: fontconfig caches/registers dpkg temporary files instead of ignoring them
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: fc-cache (show other bugs)
Version: 2.11
Hardware: Other All
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-12 09:36 UTC by Raphaël Hertzog
Modified: 2016-08-24 06:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Skip over .dpkg-tmp files (659 bytes, patch)
2016-07-12 09:36 UTC, Raphaël Hertzog
Details | Splinter Review

Description Raphaël Hertzog 2016-07-12 09:36:54 UTC
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:
/usr/share/fonts/opentype/cantarell/Cantarell-Regular.otf.dpkg-tmp

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
Comment 1 Raphaël Hertzog 2016-08-17 09:28:01 UTC
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.
Comment 2 Akira TAGOH 2016-08-17 12:16:32 UTC
I don't want to include any specific fixes in fontconfig. just to ignore reading certain caches, you could try:

<fontconfig>
  <selectfont>
    <rejectfont><glob>*.dpkg-tmp</glob></rejectfont>
  </selectfont>
</fontconfig>

This would works unless anyone has any <acceptfont> rule there which may matches such temporary file as well.
Comment 3 Raphaël Hertzog 2016-08-17 16:00:00 UTC
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.
Comment 4 Akira TAGOH 2016-08-24 06:58:27 UTC
(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.


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.