[Rpm-maint] upgrade process
Michael Schroeder
mls at suse.de
Fri Mar 13 16:24:17 UTC 2009
On Fri, Mar 13, 2009 at 03:57:22PM +0000, Tom Brown wrote:
> >Not really. The order is:
> >
> > prein new
> > install files from new
> > postin new
> > preun old
> > delete files from old that are not shared
> > postun old
> >
> >
>
> 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:
1) check $1 in the postun script, it contains the number of left
packages with the same name. Thus, if it's zero, it's a delete,
otherwise it's an update
2) check for the existance of some crucial file. If it's no longer
there, it's a delete.
Method 2) has the advantage that it also works with package renames.
The real problem you have is that there's no way to fix the bugs in
scriptlets of the installed packages.
(off-topic:
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.
off-topic-end)
Cheers,
Michael.
--
Michael Schroeder mls at suse.de
SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
More information about the Rpm-maint
mailing list