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

Fulko Hew fulko.hew at gmail.com
Wed Nov 18 20:52:59 UTC 2009


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

The trouble is that the RPM (or the version on my target (V4.0)) doesn't
allow me to run rpm when rpm is already running (trying to install my
package)

It complains about the database, etc. (I'm omitting the actual error
response
because I don't think it will help.

Its probably rpm protecting itself.  In my case the 2nd running is
effectively
read-only, but rpm doesn't care about that.

I can't really make it a 'dependency' on a version because I'd like the
%post to make an intelligent decision.

Am I doing this wrong?  Is there a better way? Do I need a newer 'rpm'?
Am I out of luck?

TIA
Fulko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20091118/d537eb07/attachment.htm>


More information about the Rpm-list mailing list