Skip to content
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

Merged
merged 3 commits into from May 27, 2020

Commits on May 27, 2020

  1. Refactor expression parser comparisons to use common logic for all types

    It's less code, less redundancy and makes adding new types nicer.
    pmatilai committed May 27, 2020
    Configuration menu
    Copy the full SHA
    f32957e View commit details
    Browse the repository at this point in the history
  2. Handle expression value reset centrally

    Less redundancy and makes adding new types nicer.
    pmatilai committed May 27, 2020
    Configuration menu
    Copy the full SHA
    2082055 View commit details
    Browse the repository at this point in the history
  3. Support rpm version comparison in expressions

    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
    pmatilai committed May 27, 2020
    Configuration menu
    Copy the full SHA
    fe949fe View commit details
    Browse the repository at this point in the history