From ee019d0afce63f5145a043b025a37dfc39444a3d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 27 Feb 2022 15:59:34 +0100 Subject: Add EvalState::allowAndSetStorePathString helper This switches addPath from `printStorePath` to `toRealPath`. --- src/libexpr/eval.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libexpr/eval.cc') 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_; -- cgit v1.2.3