diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-01-12T16·31+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-01-12T16·31+0100 |
commit | 74f75c855837bce7f48491e9ce8ac03794e5b40d (patch) | |
tree | edf3ff8bfd9ebd4bf038a78dc7991ebe3f1b28e2 /src/libexpr/eval.hh | |
parent | 435ccc798077e6291fd34fd1720c6abcf3521557 (diff) |
import, builtins.readFile: Handle diverted stores
Fixes #1791
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r-- | src/libexpr/eval.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index f0ab1435bff3..cc971ae80a43 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -112,6 +112,15 @@ public: void checkURI(const std::string & uri); + /* When using a diverted store and 'path' is in the Nix store, map + 'path' to the diverted location (e.g. /nix/store/foo is mapped + to /home/alice/my-nix/nix/store/foo). However, this is only + done if the context is not empty, since otherwise we're + probably trying to read from the actual /nix/store. This is + intended to distinguish between import-from-derivation and + sources stored in the actual /nix/store. */ + Path toRealPath(const Path & path, const PathSet & context); + /* Parse a Nix expression from the specified file. */ Expr * parseExprFromFile(const Path & path); Expr * parseExprFromFile(const Path & path, StaticEnv & staticEnv); |