Skip to content

Commit

Permalink
replay: make condition check strict and use parsed nevra
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura authored and j-mracek committed Jun 10, 2024
1 parent 3a96e7f commit af8f535
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libdnf5/base/goal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,15 @@ GoalProblem Goal::Impl::add_replay_to_goal(

const auto nevras = rpm::Nevra::parse(package_replay.nevra, {rpm::Nevra::Form::NEVRA});
libdnf_assert(
nevras.size() > 0, "Cannot parse rpm nevra \"{}\" while replaying transaction.", package_replay.nevra);
nevras.size() == 1,
"Cannot parse rpm nevra or ambiguous \"{}\" while replaying transaction.",
package_replay.nevra);

rpm::PackageQuery query_na(base);
query_na.filter_name(nevras[0].get_name());
query_na.filter_arch(nevras[0].get_arch());
auto query_nevra = query_na;
query_nevra.filter_nevra(package_replay.nevra);
query_nevra.filter_nevra(nevras[0]);

if (!package_replay.repo_id.empty()) {
repo::RepoQuery enabled_repos(base);
Expand Down

0 comments on commit af8f535

Please sign in to comment.