Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Packaging (http://www.linux-archive.org/fedora-packaging/)
-   -   Adding a section on GSettingsSchema (http://www.linux-archive.org/fedora-packaging/373771-adding-section-gsettingsschema.html)

Richard Hughes 05-20-2010 02:37 PM

Adding a section on GSettingsSchema
 
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,

Richard.
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging

Rex Dieter 05-20-2010 02:56 PM

Adding a section on GSettingsSchema
 
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
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging


All times are GMT. The time now is 11:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.