Finding out triggered package version

2010-07-14 Thread Jefferson Ogata
I'm trying to write a SPEC file for a package that will be triggered on 
kernel upgrades. Its trigger scriptlet will execute a script to install 
a kernel module. The script needs to know the version of the new kernel.


Is there any way for a trigger scriptlet to discover the version of the 
triggered package that is being installed?


Thanks in advance.
__
RPM Package Managerhttp://rpm5.org
User Communication List rpm-users@rpm5.org


Re: Finding out triggered package version

2010-07-14 Thread Jeff Johnson

On Jul 14, 2010, at 9:28 PM, Jeff Johnson wrote:

 
 The package that was just installed is what fired the trigger
 script. Perhaps easiest to get the last package installed is
   rpm -qa --last | gead -n 1
--- head of course
 but there's likely simpler if I thought a bit.
 

73 de Jeff

__
RPM Package Managerhttp://rpm5.org
User Communication List rpm-users@rpm5.org


Re: Finding out triggered package version

2010-07-14 Thread Jefferson Ogata

On 2010-07-15 01:28, Jeff Johnson wrote:

On Jul 14, 2010, at 8:26 PM, Jefferson Ogata wrote:

I'm trying to write a SPEC file for a package that will be triggered on kernel 
upgrades. Its trigger scriptlet will execute a script to install a kernel 
module. The script needs to know the version of the new kernel.

Is there any way for a trigger scriptlet to discover the version of the 
triggered package that is being installed?


I'm gonna assume rpm-5.x behavior (because different than @rpm.org).

There is a means iirc (but I can't remember offhand which of these methods 
works)


Thanks for the detailed response. Actually using rpm-4.4.2.3-18.el5 and 
will ask on the rpm.org list as well, but thought you might have some 
ideas, and you did.


Given that no matter what I do it seems a bit klugey, I'm leaning toward 
just enumerating all the installed kernels and making sure the target 
module is installed in each of them.


Will follow up in a couple of days. Thanks again for the great info!

__
RPM Package Managerhttp://rpm5.org
User Communication List rpm-users@rpm5.org