aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-03-21 14:34:45 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-03-24 21:33:33 +0100
commit7f6fe8ca1d41bceef32790aa0313aa62ae2b65fb (patch)
treec14d575f76121e586e3e256b2ec6abfd988e3499 /src
parent41659418cfeb7a33fc76716a1847f79ae13d9b0c (diff)
Rename
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops/fetchClosure.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/libexpr/primops/fetchClosure.cc b/src/libexpr/primops/fetchClosure.cc
index 22a4649a4..8e60b2ccc 100644
--- a/src/libexpr/primops/fetchClosure.cc
+++ b/src/libexpr/primops/fetchClosure.cc
@@ -7,17 +7,17 @@ static void prim_fetchClosure(EvalState & state, const Pos & pos, Value * * args
{
state.forceAttrs(*args[0], pos);
- std::optional<StorePath> storePath;
- std::optional<std::string> from;
+ std::optional<std::string> fromStoreUrl;
+ std::optional<StorePath> fromPath;
for (auto & attr : *args[0]->attrs) {
- if (attr.name == "storePath") {
+ if (attr.name == "fromPath") {
PathSet context;
- storePath = state.coerceToStorePath(*attr.pos, *attr.value, context);
+ fromPath = state.coerceToStorePath(*attr.pos, *attr.value, context);
}
- else if (attr.name == "from")
- from = state.forceStringNoCtx(*attr.value, *attr.pos);
+ else if (attr.name == "fromStore")
+ fromStoreUrl = state.forceStringNoCtx(*attr.value, *attr.pos);
else
throw Error({
@@ -26,36 +26,36 @@ static void prim_fetchClosure(EvalState & state, const Pos & pos, Value * * args
});
}
- if (!storePath)
+ if (!fromPath)
throw Error({
- .msg = hintfmt("attribute '%s' is missing in call to 'fetchClosure'", "storePath"),
+ .msg = hintfmt("attribute '%s' is missing in call to 'fetchClosure'", "fromPath"),
.errPos = pos
});
- if (!from)
+ if (!fromStoreUrl)
throw Error({
- .msg = hintfmt("attribute '%s' is missing in call to 'fetchClosure'", "from"),
+ .msg = hintfmt("attribute '%s' is missing in call to 'fetchClosure'", "fromStore"),
.errPos = pos
});
// FIXME: only allow some "trusted" store types (like BinaryCacheStore).
- auto srcStore = openStore(*from);
+ auto fromStore = openStore(*fromStoreUrl);
- copyClosure(*srcStore, *state.store, RealisedPath::Set { *storePath });
+ copyClosure(*fromStore, *state.store, RealisedPath::Set { *fromPath });
/* In pure mode, require a CA path. */
if (evalSettings.pureEval) {
- auto info = state.store->queryPathInfo(*storePath);
+ auto info = state.store->queryPathInfo(*fromPath);
if (!info->isContentAddressed(*state.store))
throw Error({
.msg = hintfmt("in pure mode, 'fetchClosure' requires a content-addressed path, which '%s' isn't",
- state.store->printStorePath(*storePath)),
+ state.store->printStorePath(*fromPath)),
.errPos = pos
});
}
- auto storePathS = state.store->printStorePath(*storePath);
- v.mkString(storePathS, {storePathS});
+ auto fromPathS = state.store->printStorePath(*fromPath);
+ v.mkString(fromPathS, {fromPathS});
}
static RegisterPrimOp primop_fetchClosure({