From a332822385c4b65c553a040d3fbee32214faa501 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 3 Jan 2024 00:07:37 -0500 Subject: [PATCH] dnf5daemon-server: Add RPM package Group attribute This is needed for porting over dnfdragora from dnfdaemon. --- dnf5daemon-server/package.cpp | 6 +++++- dnf5daemon-server/package.hpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dnf5daemon-server/package.cpp b/dnf5daemon-server/package.cpp index d721c49b8..e643de533 100644 --- a/dnf5daemon-server/package.cpp +++ b/dnf5daemon-server/package.cpp @@ -56,7 +56,8 @@ const std::map package_attributes{ {"nevra", PackageAttribute::nevra}, {"full_nevra", PackageAttribute::full_nevra}, {"reason", PackageAttribute::reason}, - {"vendor", PackageAttribute::vendor}}; + {"vendor", PackageAttribute::vendor}, + {"group", PackageAttribute::group}}; std::vector reldeplist_to_strings(const libdnf5::rpm::ReldepList & reldeps) { std::vector lst; @@ -188,6 +189,9 @@ dnfdaemon::KeyValueMap package_to_map( case PackageAttribute::vendor: dbus_package.emplace(attr, libdnf_package.get_vendor()); break; + case PackageAttribute::group: + dbus_package.emplace(attr, libdnf_package.get_group()); + break; } } return dbus_package; diff --git a/dnf5daemon-server/package.hpp b/dnf5daemon-server/package.hpp index cb73de979..74f34e265 100644 --- a/dnf5daemon-server/package.hpp +++ b/dnf5daemon-server/package.hpp @@ -65,7 +65,8 @@ enum class PackageAttribute { nevra, full_nevra, reason, - vendor + vendor, + group }; dnfdaemon::KeyValueMap package_to_map(