On 31/05/17 15:43, Antonio Larrosa wrote:
On 31/05/17 12:37, Nikola Pajkovsky wrote:
Antonio Larrosa <alarrosa@suse.de> writes:
On 31/05/17 12:26, Jan Engelhardt wrote:
On Wednesday 2017-05-31 12:23, Antonio Larrosa wrote:
The full list of macros added and simple descriptions is:
%pkg_version_at_least : Arguments are a package/capability name and a version number and returns true if package >= version %pkg_version_at_most : package <= version %pkg_version_equals : package == version %pkg_version_greater_than : package > version %pkg_version_less_than : package < version %pkg_version_not_equals : package != version
So, any opinion/suggestion about these macros?
So much to type. Can't we just have something similar to %requires_ge, _gt, _le, _lt, _eq, _ne?
I thought about that, but it's not actually a "requirement" so %requires_* is not accurate and may clash with other macro names in the future. I also thought about using %pkg_version_ge _gt ... but I thought what I submitted was more readable and you read the code more times than you write it :). I'm open to change the names in that sense though if it's generally accepted that those names are preferred.
And can that be in form
%pkg_version gcc <= 7.0
or there are limits on rpm side?
Hmm, I think that's a very good idea. Just note pkg_version is the macro that returns the package version, so I'll call it %pkg_version_test if that's ok for you. That could very well replace the %pkg_version_at_least/ %pkg_version_at_most/... "high-level" macros with something probably even more readable and equally short.
Just wondering... let's do a small poll. How would you call ... 1) The macro that has one argument (package name) and returns its version number? a) pkg_version b) pkg_version_number c) package_version d) pkg_ver other? 2) The macro that has 3 arguments (package_name, operator, version number) and tests whether the condition is true or not? a) pkg_version_test b) pkg_version_check c) pkg_version d) is_pkg_version e) test_pkg_version other? Note that 1.a and 2.c can't be chosen at the same time. If you have any other proposal, just add a letter and your proposal. In my case, I'd vote for 1.a and 2.a . Greetings, -- Antonio Larrosa -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org