builtins.storePath: Try to substitute the path if it is not yet valid

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-12-05 11:51:54 -05:00 committed by Eelco Dolstra
parent a6add93d73
commit 22d665019a
1 changed files with 2 additions and 2 deletions

View File

@ -582,8 +582,8 @@ static void prim_storePath(EvalState & state, Value * * args, Value & v)
if (!isInStore(path))
throw EvalError(format("path `%1%' is not in the Nix store") % path);
Path path2 = toStorePath(path);
if (!store->isValidPath(path2))
throw EvalError(format("store path `%1%' is not valid") % path2);
if (!settings.readOnlyMode)
store->ensurePath(path2);
context.insert(path2);
mkString(v, path, context);
}