mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
Add EvalState::allowAndSetStorePathString helper
This switches addPath from `printStorePath` to `toRealPath`.
This commit is contained in:
parent
158280d8e9
commit
ee019d0afc
4 changed files with 18 additions and 19 deletions
|
@ -517,6 +517,14 @@ void EvalState::allowPath(const StorePath & storePath)
|
|||
allowedPaths->insert(store->toRealPath(storePath));
|
||||
}
|
||||
|
||||
void EvalState::allowAndSetStorePathString(const StorePath &storePath, Value &v)
|
||||
{
|
||||
allowPath(storePath);
|
||||
|
||||
auto path = store->printStorePath(storePath);
|
||||
v.mkString(path, PathSet({path}));
|
||||
}
|
||||
|
||||
Path EvalState::checkSourcePath(const Path & path_)
|
||||
{
|
||||
if (!allowedPaths) return path_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue