import, builtins.readFile: Handle diverted stores

Fixes #1791
This commit is contained in:
Eelco Dolstra
2018-01-12 17:31:08 +01:00
parent 435ccc7980
commit 74f75c8558
4 changed files with 33 additions and 8 deletions
+10
View File
@@ -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();