1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 11:41:15 +02:00

Refactoring: Add allowPath() method

This commit is contained in:
Eelco Dolstra 2021-10-07 12:11:00 +02:00
parent c9ee634f75
commit cfaad7168e
7 changed files with 21 additions and 17 deletions

View file

@ -445,12 +445,12 @@ EvalState::EvalState(
StorePathSet closure;
store->computeFSClosure(store->toStorePath(r.second).first, closure);
for (auto & path : closure)
allowedPaths->insert(store->printStorePath(path));
allowPath(store->printStorePath(path));
} catch (InvalidPath &) {
allowedPaths->insert(r.second);
allowPath(r.second);
}
} else
allowedPaths->insert(r.second);
allowPath(r.second);
}
}
@ -482,6 +482,12 @@ void EvalState::requireExperimentalFeatureOnEvaluation(
}
}
void EvalState::allowPath(const Path & path)
{
if (allowedPaths)
allowedPaths->insert(path);
}
Path EvalState::checkSourcePath(const Path & path_)
{
if (!allowedPaths) return path_;