Re: Processing of post and postun Tags

Panu Matilainen <[email protected]> Sat, 25 Sep 2004 18:51:54 +0300 (EEST)
Newsgroups gmane.linux.conectiva.apt-rpm
Message-ID <[email protected]>
On Sat, 25 Sep 2004, Jeff Pitman wrote:

> On Saturday 25 September 2004 18:59, Christian Metzen wrote:
> > Anyone already experienced that too? Or does anyone know a solution
> > for this? For some packages this makes things for the users really
> > nasty...

Yes - it's a standard rpm feature which packagers need to take into 
account.

> 
> If you're building your own packages, then there is something you can 
> do.  Otherwise, there's not much you can do.  I ran into this while 
> trying to setup alternatives for different python versions using the 
> Redhat-supplied alternatives system found in chkconfig.  I found that 
> the order in which things were installed caused it so that the ``best" 
> alternative was not selected after install.  So, to get around this I 
> had to create a trigger:
> 
> %triggerpostun -- python, python23
> %{_bindir}/alternatives --auto python
> exit 0
> 
> The files were already in place to go, but because %preun executes 
> "alternatives --remove", things would go haywire.
> 
> You can check out the order of script execution by looking at 
> "/usr/share/doc/rpm-4.y.z/triggers" (where y.z are the version numbers 
> for your rpm install.)

This might also be helpful:
http://www.fedora.us/wiki/PackagingHints#scriptwhen

	- Panu -