summaryrefslogtreecommitdiff
path: root/src/buildtool/storage/fs_utils.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-16 11:19:51 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-07-19 15:50:15 +0200
commit7e6330e7c2ecdee4cc7edf137b9e4616c55a57b1 (patch)
treed0c019513a10abbb792323f3d1724f23476e1a8f /src/buildtool/storage/fs_utils.hpp
parentff8ecea73904cf6348fee13e83814809f55e26f5 (diff)
downloadjustbuild-7e6330e7c2ecdee4cc7edf137b9e4616c55a57b1.tar.gz
Storage config: change layout to support several storage generations
Diffstat (limited to 'src/buildtool/storage/fs_utils.hpp')
-rw-r--r--src/buildtool/storage/fs_utils.hpp21
1 files changed, 13 insertions, 8 deletions
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,