From 643966865d6ff5292b59f876a78c7c67a90ddb16 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 19 Jul 2023 15:13:20 +0200 Subject: just-mr utils: Add resolved tree id file getter --- src/other_tools/just_mr/utils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/other_tools/just_mr/utils.cpp') diff --git a/src/other_tools/just_mr/utils.cpp b/src/other_tools/just_mr/utils.cpp index 92563824..57ef6830 100644 --- a/src/other_tools/just_mr/utils.cpp +++ b/src/other_tools/just_mr/utils.cpp @@ -55,6 +55,13 @@ auto GetDistdirTreeIDFile(std::string const& content) noexcept return StorageConfig::BuildRoot() / "distfiles-tree-map" / content; } +auto GetResolvedTreeIDFile(std::string const& tree_hash, + PragmaSpecial const& pragma_special) noexcept + -> std::filesystem::path { + return StorageConfig::BuildRoot() / "special-tree-map" / + kPragmaSpecialInverseMap.at(pragma_special) / tree_hash; +} + auto WriteTreeIDFile(std::filesystem::path const& tree_id_file, std::string const& tree_id) noexcept -> bool { // needs to be done safely, so use the rename trick -- cgit v1.2.3