From e1cb494e522d352f8d06d4f210a4d1dfbf3a890c Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 3 Nov 2023 11:32:41 +0100 Subject: just-mr: Parse mirrors specification from checkout locations file --- src/other_tools/just_mr/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/other_tools/just_mr/main.cpp') diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp index 1e8905d6..47ec2633 100644 --- a/src/other_tools/just_mr/main.cpp +++ b/src/other_tools/just_mr/main.cpp @@ -676,7 +676,7 @@ auto main(int argc, char* argv[]) -> int { kDefaultDistdirs); } - // read checkout locations + // read checkout locations and alternative mirrors if (arguments.common.checkout_locations_file) { try { std::ifstream ifs(*arguments.common.checkout_locations_file); @@ -685,6 +685,12 @@ auto main(int argc, char* argv[]) -> int { checkout_locations_json .value("checkouts", nlohmann::json::object()) .value("git", nlohmann::json::object()); + arguments.common.alternative_mirrors->local_mirrors = + checkout_locations_json.value("local mirrors", + nlohmann::json::object()); + arguments.common.alternative_mirrors->preferred_hostnames = + checkout_locations_json.value("preferred hostnames", + nlohmann::json::array()); } catch (std::exception const& e) { Logger::Log( LogLevel::Error, -- cgit v1.2.3