Richard Hughes wrote:
As more applications convert from GConf to GSettings, Fedora packages are going to need to deal with schema files.
At the moment in gnome-color-manager I use this:
%post glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%postun glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
Although doing it for every single package seems like a waste of time. Maybe posttrans would be better in this case? Anyway, I think we need to sort out a policy and stick it on https://fedoraproject.org/wiki/Packaging:ScriptletSnippets before people start packaging applications that use GSettings schema files.
Let the discussion commence.
Thanks for the suggestions, I think %posttrans should be the way to go in general for stuff like this (I've been meaning to make a similar proposal to modify scriptletsnippets for update-desktop-database and update-mime-database for awhile).
So, what that means, is using something like this instead:
%posttrans glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%postun if [ $1 -eq 0 ]; then glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : fi
the main advantage of this approach is * if these items were theoretically optimized (similar to gtk-update-icon-cache is now) the batched commands would run and finish faster
Need to be careful that %posttrans is suitable only for stuff that's not needed for other (later) items in any install transaction (so, this obviously wouldn't be good for stuff like ldconfig).
Anyway, given that, I've tried hard and failed to come up with any disadvantages to moving this (and the other update-* items) to %posttrans in general. Please do chime in, if I missed anything.
-- Rex