aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-05-27 13:04:20 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2020-05-27 13:21:26 -0500
commitc66441a646c2bbfab05fa4a4fd05c2ae897dda8b (patch)
treeb5d365df4b38b0c95b8a0d8011a2b9ac22cd14f5 /src/libexpr
parent7873fd175d9e4e5bdb281e005b18c388bcfe1dd8 (diff)
Rename some variables named “recursive” to “method”
This is much less confusing since recursive is no longer a boolean.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index fcbb75ceb..d458ab272 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1042,7 +1042,7 @@ static void prim_toFile(EvalState & state, const Pos & pos, Value * * args, Valu
static void addPath(EvalState & state, const Pos & pos, const string & name, const Path & path_,
- Value * filterFun, FileIngestionMethod recursive, const Hash & expectedHash, Value & v)
+ Value * filterFun, FileIngestionMethod method, const Hash & expectedHash, Value & v)
{
const auto path = evalSettings.pureEval && expectedHash ?
path_ :
@@ -1073,12 +1073,12 @@ static void addPath(EvalState & state, const Pos & pos, const string & name, con
std::optional<StorePath> expectedStorePath;
if (expectedHash)
- expectedStorePath = state.store->makeFixedOutputPath(recursive, expectedHash, name);
+ expectedStorePath = state.store->makeFixedOutputPath(method, expectedHash, name);
Path dstPath;
if (!expectedHash || !state.store->isValidPath(*expectedStorePath)) {
dstPath = state.store->printStorePath(settings.readOnlyMode
- ? state.store->computeStorePathForPath(name, path, recursive, htSHA256, filter).first
- : state.store->addToStore(name, path, recursive, htSHA256, filter, state.repair));
+ ? state.store->computeStorePathForPath(name, path, method, htSHA256, filter).first
+ : state.store->addToStore(name, path, method, htSHA256, filter, state.repair));
if (expectedHash && expectedStorePath != state.store->parseStorePath(dstPath))
throw Error("store path mismatch in (possibly filtered) path added from '%s'", path);
} else
@@ -1108,7 +1108,7 @@ static void prim_path(EvalState & state, const Pos & pos, Value * * args, Value
Path path;
string name;
Value * filterFun = nullptr;
- auto recursive = FileIngestionMethod::Recursive;
+ auto method = FileIngestionMethod::Recursive;
Hash expectedHash;
for (auto & attr : *args[0]->attrs) {
@@ -1124,7 +1124,7 @@ static void prim_path(EvalState & state, const Pos & pos, Value * * args, Value
state.forceValue(*attr.value, pos);
filterFun = attr.value;
} else if (n == "recursive")
- recursive = FileIngestionMethod { state.forceBool(*attr.value, *attr.pos) };
+ method = FileIngestionMethod { state.forceBool(*attr.value, *attr.pos) };
else if (n == "sha256")
expectedHash = Hash(state.forceStringNoCtx(*attr.value, *attr.pos), htSHA256);
else
@@ -1135,7 +1135,7 @@ static void prim_path(EvalState & state, const Pos & pos, Value * * args, Value
if (name.empty())
name = baseNameOf(path);
- addPath(state, pos, name, path, filterFun, recursive, expectedHash, v);
+ addPath(state, pos, name, path, filterFun, method, expectedHash, v);
}