[opensuse-packaging] Querying version of a package
Good evening, 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? Long version: https://forums.opensuse.org/showthread.php/534165-Checking-version-of-a-requ... Have a good evening Axel -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
26.12.2018 22:11, Axel Braun пишет:
Good evening,
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?
%{VERSION} gets expanded by rpm as spec macro. You need to use %%{VERSION} to quote it.
Long version: https://forums.opensuse.org/showthread.php/534165-Checking-version-of-a-requ...
Have a good evening Axel
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am Mittwoch, 26. Dezember 2018, 20:29:57 CET schrieb Andrei Borzenkov:
26.12.2018 22:11, Axel Braun пишет:
Good evening,
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?
%{VERSION} gets expanded by rpm as spec macro. You need to use %%{VERSION} to quote it.
That was the solution, thank you! Axel -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (3)
-
Andrei Borzenkov
-
Axel Braun
-
Christian Boltz