diff --git a/libdnf/repo/Repo-private.hpp b/libdnf/repo/Repo-private.hpp index 01224a1444..f1c2d2c268 100644 --- a/libdnf/repo/Repo-private.hpp +++ b/libdnf/repo/Repo-private.hpp @@ -148,6 +148,7 @@ class Repo::Impl { std::string revision; std::vector content_tags; std::vector> distro_tags; + std::vector> metadata_locations; unsigned char checksum[CHKSUM_BYTES]; bool useIncludes{false}; bool loadMetadataOther; diff --git a/libdnf/repo/Repo.cpp b/libdnf/repo/Repo.cpp index 44ea3f38b1..44da192ee9 100644 --- a/libdnf/repo/Repo.cpp +++ b/libdnf/repo/Repo.cpp @@ -1007,6 +1007,15 @@ bool Repo::Impl::loadCache(bool throwExcept) distro_tags.emplace_back(distroTag->cpeid, distroTag->tag); } } + + metadata_locations.clear(); + for (auto elem = yum_repomd->records; elem; elem = g_slist_next(elem)) { + if (elem->data) { + auto rec = static_cast(elem->data); + metadata_locations.emplace_back(rec->type, rec->location_href); + } + } + if (auto cRevision = yum_repomd->revision) { revision = cRevision; } @@ -1499,6 +1508,11 @@ const std::vector> & Repo::getDistroTags() return pImpl->distro_tags; } +const std::vector> Repo::getMetadataLocations() const +{ + return pImpl->metadata_locations; +} + const std::string & Repo::getRevision() const { return pImpl->revision; diff --git a/libdnf/repo/Repo.hpp b/libdnf/repo/Repo.hpp index 785c6e9d52..f095b2a3dd 100644 --- a/libdnf/repo/Repo.hpp +++ b/libdnf/repo/Repo.hpp @@ -245,6 +245,7 @@ struct Repo { const std::vector & getContentTags(); const std::vector> & getDistroTags(); + const std::vector> getMetadataLocations() const; std::string getCachedir() const; void setRepoFilePath(const std::string & path);