title: RPM upgrade post install exit
body: <p>Is there a way to exit from %post section in case of a upgrade RPM.</p>
  
  <p>I have simple rpm with following sections.
  NOTE: here I have exit in %post.</p>
  
  <p>When I run rpm -Uvh package_name, there is an error encountered in %post section. The exit does happen only from %post section. However the rpm then continues with %preun and %postun section.</p>
  
  <p>I just want to exit if there are any error in %post section.
  Can this be achieved?</p>
  
  <pre><code>  %pre
    perform few checks here
  
    %post
    perform upgrade steps.
    If there is a error performing upgrade steps. **Then exit**
  
    %preun
    Perform pre-uninstall checks
  
  
    %postun
    Perform un-installation steps of previous package
  </code></pre>
  
  <p>Can someone clarify on this upgrade rpm package.</p>