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

Re: Forcing a rpm install to fail on some condition



On Thu, 28 Aug 2003, Dukhan, Meir wrote:

> Hi,
> 
> I would like to know if some kind of %script exists and help to do the following:
> 	1. fail to install the rpm package if architecture is wrong 
> 	2. fail to install the rpm package if OS is wrong 
> 	3. fail to install the rpm package if a specific user or environment variables are missing 
>
You can do this in %pre.  Do you checks and if one fails exit with a 1.
The only disavantage to this is if you are installing this rpm within a 
set of rpms, it will show up as a real error.  Sun packages had a verify 
script that if it failed with the appropriate return code, no error was 
returned.  

One, hackish way you could achieve the same thing would be to include a 
script in your files payload and then in your install script use rpm2cpio
to pull the script out manually and run it.  This of course would only 
work with your own handy dandy install script.

The first approach is what we use where I work.  The downside of course is 
that we have rpm setup to autorollback things if an error occurs (which is 
good for us in general), but it would be nice if there was some script 
that was ran before packages were run through the package state machine, 
so that the transaction would not even run if this scriptlet returned an 
error (i.e. it would be part of the checks that are done like disk space 
utilization and dependency checks which are done before packages are 
sent through the package state machine and thus the system would not be 
touched).

Cheers...james 
> I know bout %ifarch (%ifnoarch), %ifos (%ifnos) but I want to make the rpm install 
> to fail if one of the above condition is missing. 
> 
> Thanks a lot
> 
> -- Meir 
> ***********************************************************************************
> Information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@ndsisrael.com and destroy the original message.
> ***********************************************************************************
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@redhat.com
> https://www.redhat.com/mailman/listinfo/rpm-list
> 




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