aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/fetchers.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libfetchers/fetchers.cc')
-rw-r--r--src/libfetchers/fetchers.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc
index 7a88b4acc..4c457966d 100644
--- a/src/libfetchers/fetchers.cc
+++ b/src/libfetchers/fetchers.cc
@@ -24,11 +24,11 @@ static void fixupInput(Input & input)
input.getType();
input.getRef();
if (input.getRev())
- input.immutable = true;
+ input.locked = true;
input.getRevCount();
input.getLastModified();
if (input.getNarHash())
- input.immutable = true;
+ input.locked = true;
}
Input Input::fromURL(const ParsedURL & url)
@@ -124,15 +124,13 @@ std::pair<Tree, Input> Input::fetch(ref<Store> store) const
debug("using substituted/cached input '%s' in '%s'",
to_string(), store->printStorePath(storePath));
- auto actualPath = store->toRealPath(storePath);
-
- return {fetchers::Tree(std::move(actualPath), std::move(storePath)), *this};
+ return {Tree { .actualPath = store->toRealPath(storePath), .storePath = std::move(storePath) }, *this};
} catch (Error & e) {
debug("substitution of input '%s' failed: %s", to_string(), e.what());
}
}
- auto [tree, input] = [&]() -> std::pair<Tree, Input> {
+ auto [storePath, input] = [&]() -> std::pair<StorePath, Input> {
try {
return scheme->fetch(store, *this);
} catch (Error & e) {
@@ -141,8 +139,10 @@ std::pair<Tree, Input> Input::fetch(ref<Store> store) const
}
}();
- if (tree.actualPath == "")
- tree.actualPath = store->toRealPath(tree.storePath);
+ Tree tree {
+ .actualPath = store->toRealPath(storePath),
+ .storePath = storePath,
+ };
auto narHash = store->queryPathInfo(tree.storePath)->narHash;
input.attrs.insert_or_assign("narHash", narHash.to_string(SRI, true));
@@ -165,7 +165,7 @@ std::pair<Tree, Input> Input::fetch(ref<Store> store) const
input.to_string(), *prevRevCount);
}
- input.immutable = true;
+ input.locked = true;
assert(input.hasAllInfo());
@@ -209,7 +209,7 @@ StorePath Input::computeStorePath(Store & store) const
{
auto narHash = getNarHash();
if (!narHash)
- throw Error("cannot compute store path for mutable input '%s'", to_string());
+ throw Error("cannot compute store path for unlocked input '%s'", to_string());
return store.makeFixedOutputPath(getName(), FixedOutputInfo {
{
.method = FileIngestionMethod::Recursive,