analyze: add compare-versions
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 May 2022 14:28:45 +0000 (16:28 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 May 2022 07:07:34 +0000 (09:07 +0200)
commitbc012a3e913075d14ac39d33a090c5dcddce2e09
treeaaca9e491b34bd4ca37edf12295b7bb04352827e
parentfddad5f4a66a68682892e3fa7f22ec2689786d33
analyze: add compare-versions

The interface, output, and exit status convention are all taken directly from
rpmdev-vercmp and dpkg --compare-versions. The implementation is different
though. See test-string-util for a list of known cases where we compare
strings incompatibly.

The idea is that this string comparison function will be declared as "the"
method to use for boot entry ordering in the specification and similar
uses. Thus it's nice to allow users to compare strings.
man/systemd-analyze.xml
src/analyze/analyze-compare-versions.c [new file with mode: 0644]
src/analyze/analyze-compare-versions.h [new file with mode: 0644]
src/analyze/analyze.c
src/analyze/meson.build