From 7fb3ee34da91c7db0c6a98b35abd97b521581007 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 29 Feb 2024 17:47:52 +0100 Subject: 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. --- src/other_tools/ops_maps/archive_fetch_map.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/other_tools/ops_maps/archive_fetch_map.cpp') 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(fetch_archive, jobs); + return AsyncMapConsumer(fetch_archive, jobs); } -- cgit v1.2.3