OS (Linux): detects Ubuntu Studio before Kubuntu on KDE systems (#2298)

* fix(os): detect Ubuntu Studio before KDE-based flavor checks

Add an explicit Ubuntu Studio detection in `getUbuntuFlavour()` by
checking for `/usr/share/doc/ubuntustudio-desktop` and setting
`name`, `id`, and `idLike` accordingly.

This prevents Ubuntu Studio systems from being misidentified as
Kubuntu when KDE/Plasma-related XDG config paths are present.fix(os): detect Ubuntu Studio before KDE-based flavor checks

Add an explicit Ubuntu Studio detection in `getUbuntuFlavour()` by
checking for `/usr/share/doc/ubuntustudio-desktop` and setting
`name`, `id`, and `idLike` accordingly.

This prevents Ubuntu Studio systems from being misidentified as
Kubuntu when KDE/Plasma-related XDG config paths are present.

* refactor(os): detect Ubuntu Studio via package presence
This commit is contained in:
Oliver Lin
2026-05-02 21:54:33 +08:00
committed by GitHub
parent 0dd8d80e02
commit 90e2d8f8d9
+8
View File
@@ -99,6 +99,14 @@ FF_A_UNUSED static bool getUbuntuFlavour(FFOSResult* result) {
return false;
}
if (ffPathExists("/var/lib/dpkg/info/ubuntustudio-desktop.list", FF_PATHTYPE_FILE))
{
ffStrbufSetStatic(&result->name, "Ubuntu Studio");
ffStrbufSetStatic(&result->id, "ubuntu-studio");
ffStrbufSetStatic(&result->idLike, "ubuntu");
return false;
}
if (ffStrContains(xdgConfigDirs, "kde") || ffStrContains(xdgConfigDirs, "plasma") || ffStrContains(xdgConfigDirs, "kubuntu")) {
ffStrbufSetStatic(&result->name, "Kubuntu");
ffStrbufSetStatic(&result->id, "kubuntu");