FS#14237 - icon-theme.cache for gnome-icon-theme and hicolor-icon-theme

Attached to Project: Arch Linux
Opened by Martin Feilhauer (gnidam) - Tuesday, 14 April 2009, 16:29 GMT
Last edited by Jan de Groot (JGC) - Monday, 20 April 2009, 21:38 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Some gtk+ programs seem to require an uptodate icon-theme.cache file in /usr/share/icons/THEME which is currently not created on install/upgrade of the respective package. (Attached install-files as a proposal / taken and adapted from xfce4-icon-theme).

Additional info:
gnome-icon-theme 2.26.0-1
hicolor-icon-theme 0.10-2
xfce4-settings 4.6.0-1

Steps to reproduce:
<a href="http://aur.archlinux.org/packages.php?ID=11186">RawTherapee</a> segfaults after an upgrade of gnome-icon-theme and/or hicolor-icon-theme, if the respective icon-theme.cache is not re-created manually. After running "gtk-update-icon-cache -q -t -f /usr/share/icons/USED-ICON-THEME" on the configure/used icon-theme and the hicolor-icon-theme everything's fine.
This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 20 April 2009, 21:38 GMT
Reason for closing:  Not a bug
Comment by Jan de Groot (JGC) - Wednesday, 15 April 2009, 10:46 GMT
If this application crashes, it's either a bug in the application, or an outdated cache file on your system that shouldn't be there.
The icon theme caches are meant to speedup icon lookup, that's why they're called caches. The problem with an icon theme cache is that you will have to keep it consistent with the icons that are on the system. In case of hicolor, we have this policy, as the hicolor icon theme contains a lot of icons. For other themes, the policy is not to do this, as this fails miserably without doing it consistent in each and every package.
Comment by Martin Feilhauer (gnidam) - Wednesday, 15 April 2009, 11:08 GMT
Thanks for clarification, Jan.
Yet not totally sure if I understand correctly...
There are more packages involved in writing to /usr/share/icons/hicolor and /usr/share/icons/gnome. So to update the cache-files only on install/upgrade of gnome- and hicolor- icon-theme packages wouldn't be sufficient for garanteeing an up-to-date cache. For that reason, trying to get a consistent solution for all icons in packages might end up quite un-KISS-y, and the real solution should be that a program shouldn't segfault simply because of the lack of or existence of outdated cache-files.
Something along these lines?
Comment by Jan de Groot (JGC) - Wednesday, 15 April 2009, 11:14 GMT
outdated cache files, combined with buggy icon loading, causes crashes like these. Let's say your application is coded like this:

icon = gtk_get_icon(someicon);
do_something(icon);

this code will work when the icon exists, but will fail if the icon doesn't exist. As the program is always shipped with the icon, this shouldn't be a problem. Now comes the problem with outdated icon caches: "someicon" is not in the icon cache, but it exists on the filesystem. As the icon cache says the icon doesn't exist, it isn't loaded, and the do_something() function that operates on the icon without checking it, segfaults.

When I introduced the icon cache to archlinux, the policy was to only update the hicolor icon cache, nothing else. Any icon cache created for different themes can be considered a bug. Any package shipping icons in the hicolor theme and not updating the cache can be considered as a bug also.
Comment by Martin Feilhauer (gnidam) - Wednesday, 15 April 2009, 11:23 GMT
Jan, thanx again for explaining!

Loading...