how to get version of package 'x' when installing package 'y'
Fulko Hew
fulko.hew at gmail.com
Thu Nov 19 20:57:37 UTC 2009
On Wed, Nov 18, 2009 at 4:06 PM, Jos Vos <jos at xos.nl> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20091119/62bcc232/attachment.htm>
More information about the Rpm-list
mailing list