New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: Support rpm version comparison in expressions #1233
Conversation
This is on top of #1221 as that is required for this to work, but in a separate PR to hopefully keep it more reviewable. We might want to add s"" as an alias to regular "" just for symmetry if/when this goes in, but leaving that out for now as it doesn't add anything new. |
So, this basically compares evrs, correct? |
Yes. It also has provisions for validating EVR strings, but the only validation currently done is that an EVR string cannot be empty. |
This looks good (only looking at the last three - parser related - patches). |
It's less code, less redundancy and makes adding new types nicer.
Less redundancy and makes adding new types nicer.
Adds rpm version as a new expression value type, denoted by v"" (similar to Python u"", b"" etc), which are compared using rpm version comparison algorithm rather than regular string comparison. For example in specs: %if v"%{python_version}" < v"3.9" %endif ...but also command lines, arbitrary macros etc: rpm --eval '%[v"1:1.2" < v"2.0"]' Fixes: rpm-software-management#1217
Rebased. |
🎆 |
Adds rpm version as a new expression value type, denoted by v"" (similar to Python u"", b"" etc), which are compared using rpm version comparison algorithm rather than regular string comparison.
For example in specs:
...but also command lines, arbitrary macros etc:
rpm --eval '%[v"1:1.2" < v"2.0"]'
Fixes: #1217