Mailinglist Archive: opensuse-packaging (36 mails)

< Previous Next >
Re: [opensuse-packaging] Querying version of a package
Hello,

Am Mittwoch, 26. Dezember 2018, 20:11:30 CET schrieb Axel Braun:
tl;dr
I have a package foo, depending on package bar.
If I query the version of bar on the command line I get:
rpm -q --qf '%{VERSION}' bar -> 4.6.9 (correct result)

If I do the same in the build environment (specfile) I get the version
of foo instead (wrong result)

Any idea where this comes from, and how to fix?

You didn't explain what problem you want to solve, so

- if you want an answer to exactly your question, see Andrei's
answer ;-)

- if you want a solution that gives you
Requires: bar = <version of bar used for build>
(that's just a wild guess, but a typical usecase)
then you might instead want to use
%requires_eq bar
or, if you want _at least_ <version of bar used for build>, use
%requires_eq bar
to avoid that you have to do the "magic" yourself ;-)

In practise:

# rpm -q python3
python3-3.6.5-3.4.x86_64
# rpm --eval '%requires_eq python3'
Requires: python3 = 3.6.5
# rpm --eval '%requires_ge python3'
Requires: python3 >= 3.6.5


Regards,

Christian Boltz
--
GUI
Ein Hintergrundbild und 12 Xterms (Kristian Köhntopp)



--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >
List Navigation
References