Re: how to get version of package 'x' when installing package 'y'

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

 





On Wed, Nov 18, 2009 at 4:06 PM, Jos Vos <jos@xxxxxx> wrote:
On Wed, Nov 18, 2009 at 03:52:59PM -0500, Fulko Hew wrote:

> Here's my dilemma (maybe I'm taking the wrong approach)...
>
> In the spec file for 'mypackage', I want to have a shell script as part of
> the %post
> that does something based on the version of _another_ of my (already
> installed) packages
>
> in pseudo code:
>
> %post
>
> VER=`rpm -q other_package --queryformat'%{VERSION}'
> if VER > 1.2 then
>    do something
> else
>    do something different
> fi

Use %trigger scripts.  In your mypackage spec file, add:


%triggerin -- other_package > 1.2
do something

%triggerin -- other_package <= 1.2
do something different


This will execute the scripts every time other_package is installed/updated
and also when your package is installed/upgraded and other_package was
already installed.

Thanks!
That was exactly what I was looking for.

My trouble was that the feature wasn't described in 'Maximum RPM' and so
I didn't know it existed and, fortunately, the version of RPM on my target has
this feature.
 

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-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