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
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 33 additions and 8 deletions

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();