[Rpm-maint] discussion on problems of RPM in real life packaging

Stanislav Brabec sbrabec at suse.cz
Tue Jun 17 09:27:46 UTC 2008


Pixel wrote:
> Stanislav Brabec <sbrabec at suse.cz> writes:

> > Using %preun is acceptable only for uninstallation, not for upgrade.
> > But this is yet another problem mentioned in the document, not related
> > to one-time-scriptlets.
> 
> oops, right. mandriva never went that far :)
http://bugzilla.gnome.org/show_bug.cgi?id=306924
https://bugzilla.novell.com/show_bug.cgi?id=48114

> > However I can imagine an one-time unsubscription counterpart (something,
> > which will evaluate list of all files going to be removed or overwritten
> > in the forthcoming transaction and then issue a command with a such
> > list. I think it could be possible to write it as well, but only deep
> > inside the rpm (when rpm evaluates possible conflicts in forthcoming
> > transaction).
> 
> it should not be very hard to have pretrans filetriggers, but it would
> be dangerous if the transaction somehow fails.
> 
> eg: the gconf schema gets uninstalled in %prettrans, but a rollback
> re-adding it would be necessary on failure. And even if rollback was
> handled nicely, it would imply some unnecessary uninstall of schema
> (since the install will handle existing schema).

Current %pretrans (or something like it) is not suitable for it - it is
called from installed instance. We need a scriptlet like %preuntrans (or
%unpretrans) - the same as %pretrans, but called from removed instance.

> A solution could be: files needing subscription/unsubscription could
> be renamed to .rpmprevious instead of being removed ; then used in
> filetrigger, and only removed what all this is done. 
> Still, the filetrigger script would need to be able to check the
> difference between previous and new file, to know what to do, which
> may not be easy...

Maybe better would be adding new files as .rpmnew and putting them in
place after successful unsubscription:
- scripts may be file name sensitive
- this concept already exists in rpm for %config files, it means only
  few additional changes to place them.

I can imagine %safe_update tag in the file list. But even then, it would
require more changes than only the above to make such scripts effective.


Concept of rollback scripts is missing in rpm. If something fails, these
files would remain forever. I don't know, what is worse - orphan files,
orphan records in the database, missing records in the database.

Debian has advanced script concept:

http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

-- 
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