[Yum] How to verify from a pre scriptlet that yum is installing and not updating the RPM package.

Demetri Mouratis dmourati at gmail.com
Thu Nov 16 06:37:31 UTC 2006

On 11/15/06, John Rouillard <rouilj-yum at renesys.com> wrote:

> My RPM's have a pre(install) scriptlet that verifies that they are
> being installed and not updated. If I install with rpm, I can parse
> the command line ofx the parent process of the scriptlet and verify
> that -i or --install was used rather than -U or --update.

Look at $1 being passed to the %pre.

            install   erase   upgrade  reinstall
  %pre         1        -         2         2

if [ $1 -eq 1 ]; then
    do your thing;
   do what you feel;


More information about the Yum mailing list