fix(flatpak): per-user install fallback and real error reporting
Installing through a system-wide remote fails under polkit and, when a
remote exists in both installations, flatpak refuses non-interactive
installs ("Multiple remotes have refs matching"). Retry with an explicit
`--user flathub` target, refresh appstream metadata before giving up on
stale refs, and let update/refresh fall back to the user installation as
well. Expose the last command output through IPackageManager::lastError
and show it in a dialog on failure instead of failing silently.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
7 files changed
+144
-15
No files matched your search
@@ -22,6 +22,9 @@ public:
|
||||
return system("which flatpak > /dev/null 2>&1") == 0;
|
||||
}
|
||||
|
||||
// Last lines of the failed command output, shown to the user on failure.
|
||||
std::string lastError() const override { return m_lastError; }
|
||||
|
||||
// Parse `flatpak search` output (one whitespace-aligned row per app:
|
||||
// "Name Description Application ID Version Branch Remotes").
|
||||
// Exposed as static so the parsing can be unit-tested without flatpak.
|
||||
@@ -48,4 +51,6 @@ public:
|
||||
|
||||
private:
|
||||
bool isInstalled(const std::string& appId);
|
||||
|
||||
std::string m_lastError;
|
||||
};
|
||||
Reference in new issue
Block a user