Skip to content

Commit

Permalink
dnf5daemon-server: Add RPM package Group attribute
Browse files Browse the repository at this point in the history
This is needed for porting over dnfdragora from dnfdaemon.
  • Loading branch information
Conan-Kudo committed Jan 3, 2024
1 parent 05aeae5 commit 3649b62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dnf5daemon-server/package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const std::map<std::string, PackageAttribute> package_attributes{
{"nevra", PackageAttribute::nevra},
{"full_nevra", PackageAttribute::full_nevra},
{"reason", PackageAttribute::reason},
{"vendor", PackageAttribute::vendor}};
{"vendor", PackageAttribute::vendor},
{"group", PackageAttribute::group}};

std::vector<std::string> reldeplist_to_strings(const libdnf5::rpm::ReldepList & reldeps) {
std::vector<std::string> lst;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion dnf5daemon-server/package.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ enum class PackageAttribute {
nevra,
full_nevra,
reason,
vendor
vendor,
group
};

dnfdaemon::KeyValueMap package_to_map(
Expand Down

0 comments on commit 3649b62

Please sign in to comment.