Skip to content

Commit

Permalink
dnf5: Sort repos in 'repo info' command output
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha authored and jan-kolarik committed Sep 4, 2023
1 parent 906285a commit c8c7d7f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dnf5/commands/repo/repo_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ void RepoInfoCommand::configure() {
}

void RepoInfoCommand::print(const libdnf5::repo::RepoQuery & query, [[maybe_unused]] bool with_status) {
// sort the query to always get the same results
std::vector<libdnf5::repo::RepoWeakPtr> repos;
for (auto & repo : query) {
repos.emplace_back(repo);
}
std::sort(repos.begin(), repos.end(), [](const auto & l, const auto & r) { return l->get_id() < r->get_id(); });

for (auto & repo : repos) {
libdnf5::rpm::PackageQuery pkgs(get_context().base, libdnf5::sack::ExcludeFlags::IGNORE_EXCLUDES);
pkgs.filter_repo_id({repo->get_id()});

Expand Down

0 comments on commit c8c7d7f

Please sign in to comment.