gtk-update-icon-cache %posttrans (was Re: Error output from rpm pre/post scripts)

Phil Knirsch pknirsch at
Fri Jul 6 14:28:35 UTC 2007

Panu Matilainen wrote:
> On Thu, 5 Jul 2007, Toshio Kuratomi wrote:
>> On Thu, 2007-07-05 at 16:15 -0400, Matthias Clasen wrote:
>>> On Thu, 2007-07-05 at 16:13 -0400, Jesse Keating wrote:
>>>> On Thursday 05 July 2007 16:15:02 Michael Thomas wrote:
>>>>> What about adding 'Requires(post): coreutils' to bring in 'touch' for
>>>>> the gtk+ icon cache scriptlet:
>>>>> It seems excessive to me, because I can't imagine a situation where
>>>>> coreutils would not get installed.  But I also haven't looked that
>>>>> closely at the dependency tree either.
>>>> Often it's not about whether it will be installed or not, but rather 
>>>> it's
>>>> about whether it will be installed /before/ your %pre/%post script 
>>>> is ran if
>>>> the packages are in the same transaction (IE installer or big 
>>>> upgrades).
>>> Now that we are discussing this again, I'd like to point out that the
>>> recent ldconfig/%posttrans discussion is somewhat related to this. If
>>> we can make %posttrans useful for ldconfig, we can use it for icon cache
>>> updates too. That would be a big win.
>> That would be great.  Unfortunately, %posttrans doesn't work in the
>> ldconfig case because it doesn't run when only erasing packages.  Will
>> that make a difference for gtk-update-icon-cache as well?
> Well, the cache wouldn't be updated when packages are removed so it 
> would cache nonexistent icons. Dunno how bad that is in reality.
> What both ldconfig and gtk-update-icon-cache really beg for is a system, 
> not package-level scripts that do stuff after the transaction completes.
> Yum and apt both have such a mechanism, what's missing is one on plain 
> rpm level.
> Of course it would be possible to add some tracking mechanism ("touch 
> need-ldconfig" style) but is it actually needed... I think not. It could 
> be dirt simple like:
> -- 
> #!/bin/sh
> /sbin/ldconfig
> [ -x /usr/bin/gtk-update-icon-cache ] && /usr/bin/gtk-update-icon-cache
> # any other similar stuff
> -- 
> That completes fast enough not to be noticeable *at all* when run just 
> once at end of any transaction (the vast majority of the time spent will 
> be in the transaction in all cases really), regardless of whether 
> libraries or gtk-icon containing packages were installed or removed.
>     - Panu -

I really like that solution to be honest. It avoids lots of unnecessary 
gtk-update-icon-cache calls during the update and only does it once at 
the end. Could something similar be done for the scrollkeeper-update 
calls as well btw? Or do they need to be done after each package install?

Read ya, Phil

Philipp Knirsch                  | Tel.:  +49-711-96437-470
Team Lead Core Services          | Fax.:  +49-711-96437-111
Red Hat GmbH                     | Email: Phil Knirsch <phil at>
Hauptstaetterstr. 58             | Web:
D-70178 Stuttgart, Germany
Motd:  You're only jealous cos the little penguins are talking to me.

More information about the Fedora-maintainers mailing list