mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 08:13:44 +01:00
OS (Linux): clean up dietpi related code
This commit is contained in:
+10
-11
@@ -237,27 +237,26 @@ FF_MAYBE_UNUSED static bool detectDebianDerived(FFOSResult* result)
|
||||
if (ffPathExists("/boot/dietpi/.version", FF_PATHTYPE_FILE))
|
||||
{
|
||||
// DietPi
|
||||
ffStrbufSetS(&result->id, "dietpi");
|
||||
ffStrbufSetS(&result->name, "DietPi");
|
||||
ffStrbufClear(&result->version);
|
||||
ffStrbufSetStatic(&result->id, "dietpi");
|
||||
ffStrbufSetStatic(&result->name, "DietPi");
|
||||
ffStrbufSetStatic(&result->prettyName, "DietPi");
|
||||
FF_STRBUF_AUTO_DESTROY core = ffStrbufCreate();
|
||||
FF_STRBUF_AUTO_DESTROY sub = ffStrbufCreate();
|
||||
FF_STRBUF_AUTO_DESTROY rc = ffStrbufCreate();
|
||||
if (ffParsePropFileValues("/boot/dietpi/.version", 3, (FFpropquery[]) {
|
||||
{"G_DIETPI_VERSION_CORE=", &result->version},
|
||||
{"G_DIETPI_VERSION_CORE=", &core},
|
||||
{"G_DIETPI_VERSION_SUB=", &sub},
|
||||
{"G_DIETPI_VERSION_RC=", &rc},
|
||||
})) ffStrbufAppendF(&result->version, ".%s.%s", sub.chars, rc.chars);
|
||||
ffStrbufSet(&result->versionID, &result->version);
|
||||
ffStrbufSetF(&result->prettyName, "DietPi %s", result->version.chars);
|
||||
})) ffStrbufAppendF(&result->prettyName, " %s.%s.%s", core.chars, sub.chars, rc.chars);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Raspberry Pi OS
|
||||
ffStrbufSetS(&result->id, "raspbian");
|
||||
ffStrbufSetS(&result->name, "Raspberry Pi OS");
|
||||
ffStrbufSetS(&result->prettyName, "Raspberry Pi OS");
|
||||
return true;
|
||||
ffStrbufSetStatic(&result->id, "raspbian");
|
||||
ffStrbufSetStatic(&result->name, "Raspberry Pi OS");
|
||||
ffStrbufSetStatic(&result->prettyName, "Raspberry Pi OS");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (ffStrbufEndsWithS(&instance.state.platform.sysinfo.release, "+truenas"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user