Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 384649

Summary: Fonts inheriting "xorg-2" eclass should update fonts.scale and fonts.dir also on uninstallation
Product: Gentoo Linux Reporter: Siim Ainsaar <ainsaar>
Component: [OLD] UnspecifiedAssignee: Gentoo X packagers <x11>
Status: RESOLVED FIXED    
Severity: minor Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Update fonts.scale & fonts.dir on font removal.

Description Siim Ainsaar 2011-09-27 12:20:42 UTC
When emerging a xorg font (for example, media-fonts/font-adobe-100dpi) the xorg-2 eclass correctly updates fonts.scale (which it, curiously, calls "font.scale"), fonts.dir and the "global fontcache". But when uninstalling, it only updates the global fontcache, leaving fonts.scale and fonts.dir stale. Then xlsfonts still lists the fonts (even after a re-login) and xfontsel crashes (hangs) when selecting them. It appears that all the cache-files should be updated on uninstallation.

Reproduction:

emerge -1n media-fonts/font-adobe-100dpi
emerge -C media-fonts/font-adobe-100dpi
Log out
Log in
xlsfonts -fn '-*-helvetica-bold-r-normal--*-*-100-100-*-*-*-*'
  (it still lists the fonts, but shouldn't)
Emerge any other 100dpi font
Log out
Log in
xlsfonts -fn '-*-helvetica-bold-r-normal--*-*-100-100-*-*-*-*'
  (the fonts are gone now, as the should have been already earlier)
emerge -1 media-fonts/font-adobe-100dpi
Log out
Log in
xlsfonts -fn '-*-helvetica-bold-r-normal--*-*-100-100-*-*-*-*'
  (the fonts are back)
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-10-09 07:48:53 UTC
(In reply to comment #0)
> xorg-2 eclass correctly updates fonts.scale (which it, curiously, calls
> "font.scale")

Fixed the typo.

> fonts.dir and the "global fontcache". But when uninstalling, it
> only updates the global fontcache, leaving fonts.scale and fonts.dir stale.
> Then xlsfonts still lists the fonts (even after a re-login) and xfontsel
> crashes (hangs) when selecting them. It appears that all the cache-files should
> be updated on uninstallation.

Seems right. AFAIK font.eclass will remove stale generated files when all fonts are removed so we should be free to regen them.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-10-09 08:07:53 UTC
Created attachment 289305 [details, diff]
Update fonts.scale & fonts.dir on font removal.

This way, user won't end up with invalid fonts in the listings (and thus
segfaulting xfontsel).

Fixes:
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-10-14 20:28:10 UTC
Patch title (first comment line): Update fonts.scale & fonts.dir on font removal.
Autocommit
  cvs commit -F .msg 'xorg-2.eclass'
/var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v  <--  xorg-2.eclass
new revision: 1.50; previous revision: 1.49