Get the command in the rpm spec

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


Hi expertise,


I’m a newbie in RPM. I’m working on making a RPM package which only one instance is allowed to install on users machine. Then I need to check whether there is other version of the software installed on the machine before installation (I’m writing some scripts in %pre section). Then I use the $1 variable to check for it. But I notice that no matter the user is running “rpm -i” command or “rpm -U”, $1 will always return 2 (if there is already one instance installed on the machine). But in fact I only need to stop the user when he’s running “rpm -i”, because “rpm -U” will remove the old versions after install.

  Then my question is, how can I know which command (“rpm -i” or “rpm -U”) the user is using in the rpm spec? Or do  you have any other suggestion?


Best Regards,

Wendy Zheng



Rpm-list mailing list

[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