feat(pacman): report install origin and size for installed packages

listInstalled only returned name and version, leaving the size and the
origin repository empty for installed packages. Enrich each entry with
its installed size (parsed from pacman -Qi) and the repository it was
installed from (parsed from pacman -Sl), defaulting foreign/AUR
packages to "AUR" so the origin is always visible.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-08-27 21:45:38 +02:00
1 parent 9043632ba9
commit f525d52ab2
3 files changed
+146 -1

No files matched your search

+9
View File
@@ -1,6 +1,7 @@
#pragma once
#include "package-manager.h"
#include <map>
// Native Arch Linux package manager, integrated directly into the application
class PacmanManager : public IPackageManager {
@@ -25,6 +26,14 @@ public:
// Exposed as static so the parsing can be unit-tested without invoking pacman.
static std::vector<PackageInfo> parseInstalledOutput(const std::string& output);
// Parse `pacman -Qi` output (one block per package) into a name -> installed size map.
// Exposed as static so the parsing can be unit-tested without invoking pacman.
static std::map<std::string, std::string> parseInstalledSizes(const std::string& output);
// Parse `pacman -Sl` output ("repo name version" per line) into a name -> repository map.
// Exposed as static so the parsing can be unit-tested without invoking pacman.
static std::map<std::string, std::string> parseSyncRepos(const std::string& output);
std::vector<PackageInfo> search(const std::string& query) override;
bool install(const std::string& packageName,
std::function<void(const std::string&)> progressCallback) override;