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
No known key found for this signature in database
GPG Key ID: 269AD4F5325A22A3
2 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,7 @@ Bugfixes:
* Fix Termux Monet terminal version detection (Terminal)
* Fix zpool volumes detection (Disk, Linux)
* Fix external volumes detection (Disk, Linux)
* Fix snap package number detection on systems other than Ubuntu (Packages, Linux)
Logo:
* Add Afterglow

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;
}