match glibc in ConditionVersion
Extend ConditionVersion= to allow matching against glibc version, as proposed in https://github.com/systemd/systemd/pull/36468#issuecomment-2674600909
This commit is contained in:
committed by
Yu Watanabe
parent
966f872880
commit
dcde1e903a
@@ -4,6 +4,7 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <fnmatch.h>
|
||||
#include <gnu/libc-version.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -258,6 +259,9 @@ static int condition_test_version(Condition *c, char **env) {
|
||||
if (streq(word, "systemd"))
|
||||
return condition_test_version_cmp(p, STRINGIFY(PROJECT_VERSION));
|
||||
|
||||
if (streq(word, "glibc"))
|
||||
return condition_test_version_cmp(p, gnu_get_libc_version());
|
||||
|
||||
/* if no predicate has been set, default to "kernel" and use the whole parameter as condition */
|
||||
if (!streq(word, "kernel"))
|
||||
p = c->parameter;
|
||||
|
||||
Reference in New Issue
Block a user