Skip to content

Commit

Permalink
remove: Keep cache for the command (RhBug:2237883)
Browse files Browse the repository at this point in the history
We don't want to remove the stored packages cache after running the `remove` command transaction, therefore we override the `keepcache` option to true.

This is useful for use cases when the previous transaction downloaded a large amount of data, but didn't finished correctly. Then we'd like to fix the system state by removing some problematic package. We don't want to lose our cached data in this case.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2237883
  • Loading branch information
jan-kolarik committed Sep 15, 2023
1 parent c0bdd92 commit d6895e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dnf5/commands/remove/remove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void RemoveCommand::configure() {
auto & context = get_context();
context.set_load_system_repo(true);
context.set_load_available_repos(Context::LoadAvailableRepos::NONE);
context.base.get_config().get_keepcache_option().set(libdnf5::Option::Priority::RUNTIME, true);
}

void RemoveCommand::run() {
Expand Down

0 comments on commit d6895e1

Please sign in to comment.