[Rpm-maint] upgrade process

Stanislav Brabec sbrabec at suse.cz
Thu Mar 19 16:49:21 UTC 2009


Michael Schroeder wrote in Thu 03/19 2009 at 16:49 +0100:
> On Thu, Mar 19, 2009 at 04:32:27PM +0100, Stanislav Brabec wrote:
> > Michael Schroeder wrote in Thu 03/19 2009 at 15:35 +0100:
> > > If it obsoletes another package it's an upgrade.
> > 
> > And what if the action you need is say foo-extra-update and foo-extra
> > update was a part of foo-1 and later foo-plugins-extra-2?
> 
> The action is done in the package containing foo-extra-update.
> But maybe I'm not really understanding your example, can you be a bit
> more concrete in the setup you're talking about?

Possible examples from real life:

1)
Package smartsuite was renamed to smartmontools, but the
script /etc/init.d/smartd remains without change. Start on installation,
restart (once) on update, stop on removal.

It's easy top do with package-name based scripts.

2)
Package gstreamer was split+renamed to gstreamer-0_8 libgstreamer-0_8
gstreamer-0_8-utils.

You want to call gst-register just after finishing the update from
gstreamer to gstreamer-0_8-utils.

But if you if you decide to update just only a library, the gst-register
cache should be deleted instead.

In case of scripts assigned to package names, implementer must take
extra care to prevent incorrect behavior in such cases.

Featuring scripts assigned to files in the RPM database would be much
straight-forward in more complicated cases:

%postnew /usr/bin/gst-register
/usr/bin/gst-register

%postup /usr/bin/gst-register
/usr/bin/gst-register

%postrm /usr/bin/gst-register
rm -r /var/cache/gstreamer-0.8

Well, the last line is again not error-proof:

- After renaming of /usr/bin/gst-register to /usr/bin/gst-register-0.8
it will accidentally delete the whole directory (just exactly as it will
happen in the example above with a simple %postun).

- If developers decide to place another stuff to this directory, it may
behave incorrectly as well.

The idea below could provide a better solution.

> A cache file shared between different packages? It should be
> marked as %ghost in all of those packages so that it automatically
> is deleted when it's no longer needed.

Using %ghost works well for files.

But if the cache consist from an undefinable number of files in a whole
directory which may become obsolete, and you want to purge the whole
directory, you have a problem.

Example:

When we moved GNOME from /opt/gnome to /usr, we have had a hard time and
super-ugly scripts ensuring that cache files in /opt/gnome/share/mime
and /opt/gnome/share/applications disappeared only and only in the case
that no application remains installed in /opt/gnome.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: sbrabec at suse.cz
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/



More information about the Rpm-maint mailing list