[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
we're
> 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::
  %pre
  # 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 || :
  fi

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.

-Toshio

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.fedoraproject.org/pipermail/packaging/attachments/20050315/a4e99a8c/attachment.bin 


More information about the packaging mailing list