HomeClusterLabs Projects

Refactor: libcrmcommon: New pcmk__compare_versions()
c2b55235a5f8Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Refactor: libcrmcommon: New pcmk__compare_versions()

To replace compare_version()

The next commit replaces this with a regex implementation that I think I
like better. We can squash the commits if we decide to use that.

We could also take a middle ground approach of splitting each version
string on dots using g_strsplit() and then parsing each segment that
way, without involving a regex. All we'd have to do is iterate over each
segment to make sure it's only digits. Not sure which one is more
readable. Probably the regex approach, but regex.h functions are pretty
ugly.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 24 2025, 7:21 AM
Parents
rP9bdac739db0c: Test: libcrmcommon: More compare_version() unit tests
Branches
Unknown
Tags
Unknown

Event Timeline