diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-02-29 17:47:52 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-02-29 18:07:46 +0100 |
commit | 7fb3ee34da91c7db0c6a98b35abd97b521581007 (patch) | |
tree | 7ea6ddc153b9bed93a32a937e387653887247b84 /src/other_tools/ops_maps/archive_fetch_map.cpp | |
parent | e8a9df96a084dc8c34d928a63e8fedbcb2eec9b6 (diff) | |
download | justbuild-7fb3ee34da91c7db0c6a98b35abd97b521581007.tar.gz |
archive_fetch_map: only have the actual archive content in the interface
... as this is the only part this map depends on, and not the
information on what to do with the archive, like style of unpacking,
etc. In this way, this map will also be reusable for fetching
foreign files.
Diffstat (limited to 'src/other_tools/ops_maps/archive_fetch_map.cpp')
-rw-r--r-- | src/other_tools/ops_maps/archive_fetch_map.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/other_tools/ops_maps/archive_fetch_map.cpp b/src/other_tools/ops_maps/archive_fetch_map.cpp index ab4ca7e8..1e89025d 100644 --- a/src/other_tools/ops_maps/archive_fetch_map.cpp +++ b/src/other_tools/ops_maps/archive_fetch_map.cpp @@ -82,19 +82,18 @@ auto CreateArchiveFetchMap( auto const& key) { // get corresponding distfile auto distfile = - (key.archive.distfile ? key.archive.distfile.value() - : std::filesystem::path(key.archive.fetch_url) - .filename() - .string()); + (key.distfile + ? key.distfile.value() + : std::filesystem::path(key.fetch_url).filename().string()); auto target_name = fetch_dir / distfile; // make sure content is in CAS content_cas_map->ConsumeAfterKeysReady( ts, - {key.archive}, + {key}, [target_name, local_api, remote_api, - content = key.archive.content, + content = key.content, setter, logger]([[maybe_unused]] auto const& values) { // content is in local CAS now @@ -111,8 +110,7 @@ auto CreateArchiveFetchMap( setter, logger); }, - [logger, content = key.archive.content](auto const& msg, - bool fatal) { + [logger, content = key.content](auto const& msg, bool fatal) { (*logger)( fmt::format("While ensuring content {} is in CAS:\n{}", content, @@ -120,5 +118,5 @@ auto CreateArchiveFetchMap( fatal); }); }; - return AsyncMapConsumer<ArchiveRepoInfo, bool>(fetch_archive, jobs); + return AsyncMapConsumer<ArchiveContent, bool>(fetch_archive, jobs); } |