OS (Linux): improve performance of proxmox version detection

Fix #1370
This commit is contained in:
李通洲
2024-11-03 09:51:13 +08:00
parent f7288fec01
commit dab02f176f
+6 -6
View File
@@ -186,13 +186,13 @@ static bool detectDebianDerived(FFOSResult* result)
ffStrbufSetS(&result->name, "Proxmox VE");
ffStrbufClear(&result->versionID);
if (ffProcessAppendStdOut(&result->versionID, (char* const[]) {
"/usr/bin/pveversion",
"/usr/bin/dpkg-query",
"--showformat=${version}",
"--show",
"pve-manager",
NULL,
}) == NULL) // pve-manager/8.2.2/9355359cd7afbae4 (running kernel: 6.8.4-2-pve)
{
ffStrbufSubstrBeforeLastC(&result->versionID, '/');
ffStrbufSubstrAfterFirstC(&result->versionID, '/');
}
}) == NULL) // 8.2.2
ffStrbufTrimRightSpace(&result->versionID);
ffStrbufSetF(&result->prettyName, "Proxmox VE %s", result->versionID.chars);
return true;
}