Skip to content

Commit

Permalink
repo: Load filelists based on the configuration
Browse files Browse the repository at this point in the history
Prepare libdnf to not load the filelists metadata by default in the future.
They will be loaded only when requested through the `optional_metadata_types`
configuration option.
  • Loading branch information
jan-kolarik committed Jan 18, 2024
1 parent f9dcbfa commit e588234
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libdnf/repo/Repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,12 +432,18 @@ std::string Repo::getMetadataContent(const std::string &metadataType)
std::unique_ptr<LrHandle> Repo::Impl::lrHandleInitBase()
{
std::unique_ptr<LrHandle> h(lr_handle_init());
std::vector<const char *> dlist = {MD_TYPE_PRIMARY, MD_TYPE_FILELISTS, MD_TYPE_PRESTODELTA,
MD_TYPE_GROUP_GZ, MD_TYPE_UPDATEINFO};
std::vector<const char *> dlist = {MD_TYPE_PRIMARY, MD_TYPE_PRESTODELTA, MD_TYPE_GROUP_GZ, MD_TYPE_UPDATEINFO};

auto & optionalMetadataTypes = conf->getMainConfig().optional_metadata_types().getValue();
auto loadFilelists = std::find(optionalMetadataTypes.begin(), optionalMetadataTypes.end(), "filelists") !=
optionalMetadataTypes.end();

#ifdef MODULEMD
dlist.push_back(MD_TYPE_MODULES);
#endif
if (loadFilelists) {
dlist.push_back(MD_TYPE_FILELISTS);
}
if (loadMetadataOther) {
dlist.push_back(MD_TYPE_OTHER);
}
Expand Down

0 comments on commit e588234

Please sign in to comment.