Packages (Linux): fix snap package number detection on systems other than Ubuntu

Fixes 562
This commit is contained in:
李通洲
2023-09-20 16:00:09 +08:00
parent 576fcd7d3d
commit 5337e5cead
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -197,6 +197,9 @@ static uint32_t getSnap(FFstrbuf* baseDir)
{
uint32_t result = getNumElements(baseDir, "/snap", DT_DIR);
if (result == 0)
result = getNumElements(baseDir, "/var/lib/snapd/snap", DT_DIR);
//Accounting for the /snap/bin folder
return result > 0 ? result - 1 : 0;
}