From 7e6330e7c2ecdee4cc7edf137b9e4616c55a57b1 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 16 Jul 2024 11:19:51 +0200 Subject: Storage config: change layout to support several storage generations --- src/buildtool/storage/fs_utils.hpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/buildtool/storage/fs_utils.hpp') diff --git a/src/buildtool/storage/fs_utils.hpp b/src/buildtool/storage/fs_utils.hpp index bd4852a9..7482457b 100644 --- a/src/buildtool/storage/fs_utils.hpp +++ b/src/buildtool/storage/fs_utils.hpp @@ -38,14 +38,16 @@ namespace StorageUtils { /// \brief Get the path to the file storing the tree id associated with /// a given commit. [[nodiscard]] auto GetCommitTreeIDFile(StorageConfig const& storage_config, - std::string const& commit) noexcept + std::string const& commit, + std::size_t generation = 0) noexcept -> std::filesystem::path; /// \brief Get the path to the file storing the tree id of an archive /// content. [[nodiscard]] auto GetArchiveTreeIDFile(StorageConfig const& storage_config, std::string const& repo_type, - std::string const& content) noexcept + std::string const& content, + std::size_t generation = 0) noexcept -> std::filesystem::path; /// \brief Get the path to the file storing the tree id of an archive @@ -53,20 +55,23 @@ namespace StorageUtils { [[nodiscard]] auto GetForeignFileTreeIDFile(StorageConfig const& storage_config, std::string const& content, std::string const& name, - bool executable) noexcept + bool executable, + std::size_t generation = 0) noexcept -> std::filesystem::path; /// \brief Get the path to the file storing the tree id of a distdir list /// content. [[nodiscard]] auto GetDistdirTreeIDFile(StorageConfig const& storage_config, - std::string const& content) noexcept + std::string const& content, + std::size_t generation = 0) noexcept -> std::filesystem::path; /// \brief Get the path to the file storing a resolved tree hash. -[[nodiscard]] auto GetResolvedTreeIDFile( - StorageConfig const& storage_config, - std::string const& tree_hash, - PragmaSpecial const& pragma_special) noexcept -> std::filesystem::path; +[[nodiscard]] auto GetResolvedTreeIDFile(StorageConfig const& storage_config, + std::string const& tree_hash, + PragmaSpecial const& pragma_special, + std::size_t generation = 0) noexcept + -> std::filesystem::path; /// \brief Write a tree id to file. The parent folder of the file must exist! [[nodiscard]] auto WriteTreeIDFile(std::filesystem::path const& tree_id_file, -- cgit v1.2.3