diff --git a/src/nspawn/nspawn-util.c b/src/nspawn/nspawn-util.c index 4b3bf2aa00..402554fa38 100644 --- a/src/nspawn/nspawn-util.c +++ b/src/nspawn/nspawn-util.c @@ -4,13 +4,11 @@ #include "glob-util.h" #include "log.h" #include "nspawn-util.h" -#include "nulstr-util.h" #include "parse-util.h" #include "path-util.h" #include "string-util.h" int systemd_installation_has_version(const char *root, const char *minimal_version) { - const char *pattern; int r; /* Try to guess if systemd installation is later than the specified version. This @@ -18,15 +16,15 @@ int systemd_installation_has_version(const char *root, const char *minimal_versi * is non-standard. False positives should be relatively rare. */ - NULSTR_FOREACH(pattern, + FOREACH_STRING(pattern, /* /lib works for systems without usr-merge, and for systems with a sane * usr-merge, where /lib is a symlink to /usr/lib. /usr/lib is necessary * for Gentoo which does a merge without making /lib a symlink. */ - "lib/systemd/libsystemd-shared-*.so\0" - "lib64/systemd/libsystemd-shared-*.so\0" - "usr/lib/systemd/libsystemd-shared-*.so\0" - "usr/lib64/systemd/libsystemd-shared-*.so\0") { + "/lib/systemd/libsystemd-shared-*.so", + "/lib64/systemd/libsystemd-shared-*.so", + "/usr/lib/systemd/libsystemd-shared-*.so", + "/usr/lib64/systemd/libsystemd-shared-*.so") { _cleanup_strv_free_ char **names = NULL; _cleanup_free_ char *path = NULL; diff --git a/src/nspawn/test-nspawn-util.c b/src/nspawn/test-nspawn-util.c index ed68063630..08c8050dc5 100644 --- a/src/nspawn/test-nspawn-util.c +++ b/src/nspawn/test-nspawn-util.c @@ -16,4 +16,7 @@ TEST(systemd_installation_has_version) { } } +/* This program can be called with a path to an installation root. + * For example: build/test-nspawn-util /var/lib/machines/rawhide + */ DEFINE_TEST_MAIN(LOG_DEBUG);