diff --git a/include/libdnf5/rpm/package_query.hpp b/include/libdnf5/rpm/package_query.hpp index c67783e53..1df5d1fe4 100644 --- a/include/libdnf5/rpm/package_query.hpp +++ b/include/libdnf5/rpm/package_query.hpp @@ -360,7 +360,7 @@ class PackageQuery : public PackageSet { void filter_summary( const std::vector & patterns, libdnf5::sack::QueryCmp cmp_type = libdnf5::sack::QueryCmp::EQ); - /// Filter packages by their `summary`. + /// Filter packages by their `description`. /// /// @param pattern A string the filter is matched against. /// @param cmp_type A comparison (match) operator, defaults to `QueryCmp::EQ`. @@ -373,7 +373,7 @@ class PackageQuery : public PackageSet { filter_description(std::vector{pattern}, cmp_type); }; - /// Filter packages by their `summary`. + /// Filter packages by their `description`. /// /// @param patterns A vector of strings the filter is matched against. /// @param cmp_type A comparison (match) operator, defaults to `QueryCmp::EQ`. @@ -847,19 +847,45 @@ class PackageQuery : public PackageSet { PackageQuery & installed, libdnf5::sack::QueryCmp cmp_type = libdnf5::sack::QueryCmp::GTE); + /// Filter installed packages. + /// + /// Removes from the query all packages that are not installed. + /// @since 5.0 + // @replaces libdnf/sack/query.hpp:method:installed() void filter_installed(); + /// Filter available packages. + /// + /// Removes from the query all packages that are installed. + /// @since 5.0 + // @replaces libdnf/sack/query.hpp:method:available() void filter_available(); + /// Filter available packages that are upgrades to installed packages. + /// + /// Removes from the query all packages that are not upgrades to installed packages. + /// @since 5.0 // @replaces libdnf/sack/query.hpp:method:addFilter(int keyname, int cmp_type, int match) - cmp_type = HY_PKG_UPGRADES void filter_upgrades(); + /// Filter available packages that are downgrades to installed packages. + /// + /// Removes from the query all packages that are not downgrades to installed packages. + /// @since 5.0 // @replaces libdnf/sack/query.hpp:method:addFilter(int keyname, int cmp_type, int match) - cmp_type = HY_PKG_DOWNGRADES void filter_downgrades(); + /// Filter installed packages for which there are available upgrades. + /// + /// Only installed packages remain in the query, and only those for which upgrades are available. + /// @since 5.0 // @replaces libdnf/sack/query.hpp:method:addFilter(int keyname, int cmp_type, int match) - cmp_type = HY_PKG_UPGRADABLE void filter_upgradable(); + /// Filter installed packages for which there are available downgrades. + /// + /// Only installed packages remain in the query, and only those for which downgrades are available. + /// @since 5.0 // @replaces libdnf/sack/query.hpp:method:addFilter(int keyname, int cmp_type, int match) - cmp_type = HY_PKG_DOWNGRADABLE void filter_downgradable(); diff --git a/libdnf5/rpm/package_query.cpp b/libdnf5/rpm/package_query.cpp index a9aaf93e8..37c2223e6 100644 --- a/libdnf5/rpm/package_query.cpp +++ b/libdnf5/rpm/package_query.cpp @@ -181,7 +181,7 @@ Id what_upgrades(libdnf5::solv::RpmPool & spool, const Solvable * solvable) { return l; } -/// Return id of a package that can be upgraded with pkg. +/// Return id of a package that can be downgraded with pkg. /// /// The returned package Id fulfills the following criteria: /// :: it is installed