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
RFC: support rpm version comparison in expression parser #1220
Conversation
No functional change, but we'll need this in the next step.
Thank you! |
This is prerequisite for supporting version comparison in expressions.
Add support for rpm version strings as distinct class of values in expressions, denoted by backticks (ie `1.2`) to differentiate from regular strings. This uses rpmvercmp() for comparison which is wrong for complete EVR labels, but sufficient for a proof-of-concept.
Another possibility would be the pythonish/perlish |
Listed in #1217 (comment) |
How about supporting EVR syntax instead of that rpmvercmp() call? |
@mlschroe , as noted in the description and commit messages: "this isn't right as it uses rpmvercmp() whereas this would need to compare entire EVR labels, but suffices for PoC purposes." |
I'll try to submit a more complete version tomorrowish, there's some bulldozing in order... |
Yeah, I should read the comments instead of just looking at the "Files Changed" tab... |
In Ruby, there is quite commonly used something like But also |
|
Folks, please keep the discussion in the ticket, this is just a PoC not intended for merging and will go away soonish. Sorry for not making this clear initially. |
(hmm, maybe we need a separate PoC label, or maybe we should just rename RFC to PoC...) |
Intended to rebase this on top of #1221 for poper EVR comparison and change to the proposed v".." syntax, but seems I emptied my bucket for the day. If somebody's bored and wants to have a go, feel free. If not, I'll get back into it next week. |
Thanks for the feeback folks, submitted a proper version as #1233 now. |
Inspired by #1217, this is a proof-of-concept patch series to add support for version comparison in the expression parser, allowing things like this to do the right thing:
...and also macros, eg
Backticks are used to denote versions as opposed to regular strings not because I particularly like them but just because I had to use something and single quotes get painful when testing with shell.
As noted in the commit messages, this isn't right as it uses rpmvercmp() whereas this would need to compare entire EVR labels, but suffices for PoC purposes.