Skip to content

Commit

Permalink
dnf5: OfflineExecuteCommand needs to set transaction
Browse files Browse the repository at this point in the history
Some RPM transaction callback functionality (e.g. reporting RPM logs and
scriptlet outputs) depends on the current transaction being set in the
context.
  • Loading branch information
m-blaha committed Sep 27, 2024
1 parent 71e9e8e commit e8f40f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dnf5/commands/offline/offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ void OfflineExecuteCommand::run() {

goal->add_serialized_transaction(transaction_json_path);

auto transaction = goal->resolve();
auto & context = get_context();
context.set_transaction(goal->resolve());
auto transaction = *context.get_transaction();
if (transaction.get_problems() != libdnf5::GoalProblem::NO_PROBLEM) {
std::cerr << "Failed to resolve transaction. This indicates some bigger problem, since the offline transaction "
"was already successfully resolved before. Was the cache at "
Expand Down

0 comments on commit e8f40f7

Please sign in to comment.