Re: die function for RPM %pre, %post sections, etc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/21/05, Sean Sosik-Hamor <sean@xxxxxxxxxxxxxxx> wrote:
> On Jun 21, 2005, at 5:27 PM, Dan Trainor wrote:
> 
> > Sorry, I forgot to mention - the prereq's would be determined based on
> > some shell chickenscratch that simply checks for the existance of
> > files,
> > what machine type, etc etc.  I understand that Requires: would work in
> > certain situations, but not for this one.
> 
> Plenty of examples of how people are forcing RPM to stop the
> installation process during %pre and %post. :)
> 
> http://www.google.com/search?q=filetype:spec+exit
> http://www.google.com/search?q=filetype:spec+die
> 
But remember, if you are installing this package with other packages
in the same transaction, and if you want this to somehow cause the
whole transaction to fail before it runs the other packages through
the package state machine (i.e. runs their %pre, %files and %post)
then this won't work.  If you get lucky then your package is the first
one to run as an install element through the package state machine
(psm), but if your not you have some clean up to do.

Also, by default, rpm transactions are best effort.  That is a package
fails it will not stop the transaction right there but will continue
running the remaining transaction elements through the psm.   There is
a hack in rpmtsRun() to snip the corresponding erase element of a
failed install element but that is as far as it goes.
End result is that your package may fail early but packages that would
be ordered before and after your package would still be installed (or
erased or upgraded).

Solaris had a verify script for its packages that was ran pre
transaction and whose whole purpose in life was stop a transaction
before it touched the package db or the filesystem.  RPM doesn't have
this (well it depends on your version of rpm, because it does support
pre and post transaction scriptletes in newer versions; have not used
this though).  Even still these don't necessarily have the semantic of
verification, as much as these are things you need done before any
packages run through the psm.

Cheers...james


[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux