[Rpm-maint] upgrade process

Stanislav Brabec sbrabec at suse.cz
Thu Mar 19 13:12:01 UTC 2009


Michael Schroeder wrote in Fri 03/13 2009 at 17:24 +0100:
>> so i am loosing the symlink as it gets removed by the postun in the old 
>> package - i guess i need to work on the install/upgrade/erase syntax in 
>> there but i am struggling to fins an example i fully understand!!
>
>There are two ways to detect if it's an update or not:

A third way is an update-alternatives package and call of
update-alternatives in %posttrans.

> I think we should thus extend rpm to make things easier. How about
> adding support for %update scriptlets? The order would be
> 
>     preup new
>     install files from new
>     delete files from old that are not shared
>     postup new
> 
> No preun/postun would be run in -U mode if the new package has a preup
> or postup scriptlet. rpm should also tell the up scripts wich
> packages in which versions were obsoleted. Maybe as a list of
> HDRNUMs so that the scriplets can do a --querybynumber.

I have been thinking about it as well. Such simple definition may work
in simple cases (foo-1.0 replaced by foo-1.1), but it will be
problematic for more complicated cases:


1) Imagine that package foo-1 is going to be split to three
sub-packages: foo-core-2, foo-plugins-base-2 and foo-plugins-extra-2.
Now we are going to upgrade from foo-1 to foo-core-2+foo-plugins-base-2,
omitting the foo-plugins-extra-2. Is it an upgrade or not?

Possible solution:
%prenew, %postnew, %preup, %postup, %prerm, %postrm could optionally
refer to a particular file and would be called only if it is an
new/update/removal for this file.


2) Imagine that package foo needs to run "adduser fooser" during the
first installation and it should call "deluser fooser" on package
removal. Now imagine that yet another package foof needs to do the same
for the same user. Even after package foo removal, fooser should be
defined. It should be removed only if none of foo and foof will be
present.

Possible solution:
%prenew, %postnew, %preup, %postup, %prerm, %postrm could optionally
refer to a virtual symbol and would be called only if it the symbol is
new/non-zero number of providers changes/all providers removed for this
file.


3) Imagine that non-conflicting packages foo and package oof provide the
same function and both want to install compatibility script or symlink
foo-or-oof. It should exist, if any of foo or oof are installed.

Possible solution:
Create a virtual symbol foo-or-oof-script and then continue with 2).
%postnew foo-or-oof-script and %postrm foo-or-oof-script should do what
you expect.


>The real problem you have is that there's no way to fix the bugs in
>scriptlets of the installed packages.

Is it possible to introduce new feature removing selected script from
the database?

%blockscript package_name [<=> package version] script_type script_args

%killscript package_name [<=> package version] script_type script_args

%replacescript package_name [<=> package version] script_type script_args
new contents of the script


All these problems were already mentioned in
http://www.rpm.org/wiki/Problems

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