This commit is contained in:
Marek Blaha 2025-07-04 11:41:38 +02:00 committed by GitHub
commit 7fdcc9822e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -139,6 +139,7 @@ private:
WeakPtrGuard<RepoSack, false> sack_guard;
repo::Repo * system_repo{nullptr};
repo::Repo * cmdline_repo{nullptr};
RepoWeakPtr stored_transaction_repo;
bool repos_updated_and_loaded{false};
friend RepoSack;
};
@ -188,7 +189,12 @@ RepoWeakPtr RepoSack::get_stored_transaction_repo(const std::string & repo_id) {
RepoWeakPtr stored_repo;
for (const auto & existing_repo : get_data()) {
if (existing_repo->get_id() == real_repo_id) {
stored_repo = existing_repo->get_weak_ptr();
if (existing_repo->get_type() == Repo::Type::COMMANDLINE) {
stored_repo = existing_repo->get_weak_ptr();
} else {
stored_repo = p_impl->stored_transaction_repo;
real_repo_id = STORED_TRANSACTION_NAME;
}
break;
}
}
@ -197,6 +203,7 @@ RepoWeakPtr RepoSack::get_stored_transaction_repo(const std::string & repo_id) {
std::unique_ptr<Repo> repo(new Repo(p_impl->base, real_repo_id, Repo::Type::COMMANDLINE));
repo->get_config().get_build_cache_option().set(libdnf5::Option::Priority::RUNTIME, false);
stored_repo = add_item_with_return(std::move(repo));
p_impl->stored_transaction_repo = stored_repo;
}
return stored_repo;