[Fedora-packaging] Re: GConf schema packaging guidelines

Toshio toshio at tiki-lounge.com
Tue Mar 15 13:42:59 UTC 2005

From rom the Fedora-maintainers list

Code in question:
> Le mardi 01 mars 2005 à 14:42 -0500, David Malcolm a écrit :
> > Some spec files try to uninstall the schema e.g. from
> > evolution-connector:
> > %preun
> > export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
> > gconftool-2 --makefile-uninstall-rule \
> >   %{_sysconfdir}/gconf/schemas/apps_evolution_exchange.schemas
> > >/dev/null || :

The problem:
> On Sat, 2005-03-12 at 15:11 +0100, Dams wrote:
> This is a packaging bug if you dont test the upgrade case.
> If you uninstall schemas you just *must* have an `if' statement
> surrounding the gconf schema un-installation in %preun, to test if
> being upgraded or un-installed.
> Remember that, when upgrading, %preun of the old package is ran after
> the new package %post.
I think the intent is to remove the old schema from gconf before
installing the new schema.  So I think this %pre script would work::
  # For GConf apps
  if [ "$1" -gt 1]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule \
      %{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || :

Is that wrong (or my assumption that we're trying to clean up the old
schema?)  If it's good, then maybe the scriptlets in the spectemplates
(fedora-rpmdevtools) should be changed.

> And anyway, we have a problem in cases like:
>       * foo-1 which has foo.schema is installed
>       * you upgrade to foo-2 which has foo2.schema, but has no
>         foo.schema.
> foo.schema will never be uninstalled, as foo-2 knows nothing about it.
> (Yes, that sort of things has already happened).

The packager should know about foo.schema... So one inelegant solution
would be to put uninstall rules for both foo.schema and foo2.schema with
discarded error conditions into the %pre.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-packaging/attachments/20050315/a4e99a8c/attachment.sig>

More information about the Fedora-packaging mailing list