about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-01-12T16·31+0100
committerEelco Dolstra <edolstra@gmail.com>2018-01-12T16·31+0100
commit74f75c855837bce7f48491e9ce8ac03794e5b40d (patch)
treeedf3ff8bfd9ebd4bf038a78dc7991ebe3f1b28e2 /src/libexpr/eval.cc
parent435ccc798077e6291fd34fd1720c6abcf3521557 (diff)
import, builtins.readFile: Handle diverted stores
Fixes #1791
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 63de2d60a147..087a95ddef8c 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -375,6 +375,16 @@ void EvalState::checkURI(const std::string & uri)
 }
 
 
+Path EvalState::toRealPath(const Path & path, const PathSet & context)
+{
+    // FIXME: check whether 'path' is in 'context'.
+    return
+        !context.empty() && store->isInStore(path)
+        ? store->toRealPath(path)
+        : path;
+};
+
+
 void EvalState::addConstant(const string & name, Value & v)
 {
     Value * v2 = allocValue();