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:
parent
c9ee634f75
commit
cfaad7168e
7 changed files with 21 additions and 17 deletions
|
@ -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_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue