Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo: While cloning root metadata copy also metalink #1880

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libdnf5/repo/repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,17 @@ bool Repo::clone_root_metadata() {
repo_cache.remove_solv_files();

auto repodata_cachedir = std::filesystem::path(repo_cachedir) / CACHE_METADATA_DIR;
auto root_repodata_metalink = std::filesystem::path(root_repo_cachedir) / CACHE_METALINK_FILE;
auto root_repodata_mirrorlist = std::filesystem::path(root_repo_cachedir) / CACHE_MIRRORLIST_FILE;
try {
std::filesystem::create_directories(repodata_cachedir);
std::filesystem::copy(root_repodata_cachedir, repodata_cachedir);
if (std::filesystem::exists(root_repodata_metalink)) {
std::filesystem::copy(root_repodata_metalink, repo_cachedir);
}
if (std::filesystem::exists(root_repodata_mirrorlist)) {
std::filesystem::copy(root_repodata_mirrorlist, repo_cachedir);
}
} catch (const std::filesystem::filesystem_error & e) {
logger.debug(
"Error when cloning root repodata from \"{}\" to \"{}\" : \"{}\"",
Expand Down
2 changes: 0 additions & 2 deletions libdnf5/repo/repo_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ namespace libdnf5::repo {
namespace {

constexpr const char * CACHE_ATTRS_DIR = "attrs";
constexpr const char * CACHE_MIRRORLIST_FILE = "mirrorlist";
constexpr const char * CACHE_METALINK_FILE = "metalink.xml";


// Removes a file or empty directory.
Expand Down
2 changes: 2 additions & 0 deletions libdnf5/repo/repo_cache_private.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ namespace {
constexpr const char * CACHE_METADATA_DIR = "repodata";
constexpr const char * CACHE_PACKAGES_DIR = "packages";
constexpr const char * CACHE_SOLV_FILES_DIR = "solv";
constexpr const char * CACHE_METALINK_FILE = "metalink.xml";
constexpr const char * CACHE_MIRRORLIST_FILE = "mirrorlist";

} // namespace

Expand Down
Loading