[Rpm-maint] [rpm-software-management/rpm] RFE: Support rpm version comparison in expressions (#1233)

Panu Matilainen notifications at github.com
Tue May 19 13:15:39 UTC 2020


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: #1217

You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1233

-- Commit Summary --

  * Move rpmVersionCompare() to headerutil.c for better layer match
  * Move rpmvercmp() to librpmio
  * Consolidate our Lua-bindings to librpmio now that we can
  * Axe --nopromote and most of the related infrastructure
  * Add (beginnings of) a rpm version API (parsing, comparison)
  * Refactor rpmdsCompare() to use the new version API
  * Refactor python labelCompare() to use the new version API, add more tests
  * Fix Lua rpm.vercmp() to compare actual EVRs instead of segments (#897)
  * Refactor expression parser comparisons to use common logic for all types
  * Handle expression value reset centrally
  * Support rpm version comparison in expressions

-- File Changes --

    M Makefile.am (1)
    M doc/librpm/Doxyheader.h (3)
    M doc/manual/macros (10)
    M lib/Makefile.am (8)
    M lib/depends.c (6)
    M lib/headerutil.c (21)
    M lib/poptALL.c (5)
    M lib/rpmds.c (137)
    M lib/rpmds.h (28)
    M lib/rpmds_internal.h (3)
    M lib/rpmlib.h (10)
    D lib/rpmliblua.c (41)
    D lib/rpmliblua.h (18)
    M lib/rpmrc.c (6)
    M lib/rpmtypes.h (1)
    M lib/transaction.c (2)
    M po/POTFILES.in (2)
    M preinstall.am (4)
    M python/header-py.c (34)
    M python/rpmmodule.c (11)
    M rpmio/Makefile.am (2)
    M rpmio/expression.c (165)
    M rpmio/rpmlua.c (26)
    A rpmio/rpmver.c (214)
    A rpmio/rpmver.h (99)
    R rpmio/rpmvercmp.c (20)
    M tests/rpmmacro.at (21)
    M tests/rpmpython.at (25)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1233.patch
https://github.com/rpm-software-management/rpm/pull/1233.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1233
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200519/145a2c5f/attachment-0001.html>


More information about the Rpm-maint mailing list