aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-02-27 15:59:34 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-02-28 21:37:49 +0100
commitee019d0afce63f5145a043b025a37dfc39444a3d (patch)
tree8872736356fa78e438a2e45db10bcb90d27e19fc /src/libexpr/eval.cc
parent158280d8e9b9d7fbf1ccee9cef829081859810e6 (diff)
Add EvalState::allowAndSetStorePathString helper
This switches addPath from `printStorePath` to `toRealPath`.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 60f0bf08c..d94afbb99 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -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_;