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

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

 




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


_______________________________________________
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