From aa5b83d93ce1b7bb67bf81ceda7ebf7706b1efa0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 15 Feb 2022 14:33:31 +0100 Subject: InputScheme::fetch(): Return a StorePath instead of a Tree --- src/libfetchers/fetchers.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libfetchers/fetchers.hh') diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh index c43b047a7..2836af5fa 100644 --- a/src/libfetchers/fetchers.hh +++ b/src/libfetchers/fetchers.hh @@ -16,7 +16,6 @@ struct Tree { Path actualPath; StorePath storePath; - Tree(Path && actualPath, StorePath && storePath) : actualPath(actualPath), storePath(std::move(storePath)) {} }; struct InputScheme; @@ -131,7 +130,7 @@ struct InputScheme virtual void markChangedFile(const Input & input, std::string_view file, std::optional commitMsg); - virtual std::pair fetch(ref store, const Input & input) = 0; + virtual std::pair fetch(ref store, const Input & input) = 0; }; void registerInputScheme(std::shared_ptr && fetcher); -- cgit v1.2.3 From 8518cebfceb36f3744c276cc8dbf432b1275f53f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 24 Feb 2022 18:09:00 +0100 Subject: libfetchers: Rename immutable -> locked This is more consistent with flake terminology. --- src/libfetchers/fetchers.hh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/libfetchers/fetchers.hh') diff --git a/src/libfetchers/fetchers.hh b/src/libfetchers/fetchers.hh index 2836af5fa..bc9a76b0b 100644 --- a/src/libfetchers/fetchers.hh +++ b/src/libfetchers/fetchers.hh @@ -34,7 +34,7 @@ struct Input std::shared_ptr scheme; // note: can be null Attrs attrs; - bool immutable = false; + bool locked = false; bool direct = true; /* path of the parent of this input, used for relative path resolution */ @@ -59,9 +59,9 @@ public: one that goes through a registry. */ bool isDirect() const { return direct; } - /* Check whether this is an "immutable" input, that is, + /* Check whether this is a "locked" input, that is, one that contains a commit hash or content hash. */ - bool isImmutable() const { return immutable; } + bool isLocked() const { return locked; } bool hasAllInfo() const; @@ -69,6 +69,8 @@ public: bool contains(const Input & other) const; + /* Fetch the input into the Nix store, returning the location in + the Nix store and the locked input. */ std::pair fetch(ref store) const; Input applyOverrides( @@ -146,14 +148,14 @@ DownloadFileResult downloadFile( ref store, const std::string & url, const std::string & name, - bool immutable, + bool locked, const Headers & headers = {}); std::pair downloadTarball( ref store, const std::string & url, const std::string & name, - bool immutable, + bool locked, const Headers & headers = {}); } -- cgit v1.2.3