diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-01 10:20:05 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-05 11:05:10 +0100 |
commit | e212faa63b7d602e73276e758d7c4371d3235ab4 (patch) | |
tree | ce8af77414f892fb9241908ea50f1c26921c60d4 /src | |
parent | 4daf637c2703ac2ce57691c7a03ffb551e0c7695 (diff) | |
download | justbuild-e212faa63b7d602e73276e758d7c4371d3235ab4.tar.gz |
Support fetching of foreign files
Diffstat (limited to 'src')
-rw-r--r-- | src/other_tools/just_mr/fetch.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp index 74fc8fa8..8f3ae800 100644 --- a/src/other_tools/just_mr/fetch.cpp +++ b/src/other_tools/just_mr/fetch.cpp @@ -220,6 +220,28 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config, archive_repo_info->archive); } } break; + case CheckoutType::ForeignFile: { + auto logger = std::make_shared<AsyncMapConsumerLogger>( + [&repo_name](std::string const& msg, bool fatal) { + Logger::Log( + fatal ? LogLevel::Error : LogLevel::Warning, + "While parsing description of repository " + "{}:\n{}", + nlohmann::json(repo_name).dump(), + msg); + }); + + auto repo_info = ParseForeignFileDescription( + *resolved_repo_desc, repo_name, logger); + if (not repo_info) { + return kExitFetchError; + } + // only fetch if either archive is not marked absent, or if + // explicitly told to fetch absent archives + if (not repo_info->absent or common_args.fetch_absent) { + archives_to_fetch.emplace_back(repo_info->archive); + } + } break; case CheckoutType::GitTree: { // check "absent" pragma auto repo_desc_pragma = (*resolved_repo_desc)->At("pragma"); |