WIP: shepherd initsystem

This commit is contained in:
Yelninei
2025-08-20 12:58:21 +00:00
committed by Carter Li
parent add2bfd108
commit d553bc4893
+15 -1
View File
@@ -48,7 +48,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
if (instance.config.general.detectVersion)
{
#if __linux__ && !__ANDROID__
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(__GNU__)
if (ffStrbufEqualS(&result->name, "systemd"))
{
ffBinaryExtractStrings(result->exe.chars, extractSystemdVersion, &result->version, (uint32_t) strlen("systemd 0.0 running in x"));
@@ -84,6 +84,20 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
ffStrbufSubstrAfterLastC(&result->version, ' ');
}
}
else if (ffStrbufEqualS(&result->name, "guile"))
{
/* TODO: guile is actually shepherd */
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
ffStrbufEndsWithS(&result->exe, "/guile") ? result->exe.chars : "guile",
"--version",
NULL,
}) == NULL && result->version.length)
{
/* guile (GNU Guile) 3.0.9 */
ffStrbufSubstrBeforeFirstC(&result->version, '\n');
ffStrbufSubstrAfterLastC(&result->version, ' ');
}
}
#elif __APPLE__
if (ffStrbufEqualS(&result->name, "launchd"))
{