forked from lix-project/lix
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:
parent
a6add93d73
commit
22d665019a
|
@ -582,8 +582,8 @@ static void prim_storePath(EvalState & state, Value * * args, Value & v)
|
||||||
if (!isInStore(path))
|
if (!isInStore(path))
|
||||||
throw EvalError(format("path `%1%' is not in the Nix store") % path);
|
throw EvalError(format("path `%1%' is not in the Nix store") % path);
|
||||||
Path path2 = toStorePath(path);
|
Path path2 = toStorePath(path);
|
||||||
if (!store->isValidPath(path2))
|
if (!settings.readOnlyMode)
|
||||||
throw EvalError(format("store path `%1%' is not valid") % path2);
|
store->ensurePath(path2);
|
||||||
context.insert(path2);
|
context.insert(path2);
|
||||||
mkString(v, path, context);
|
mkString(v, path, context);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue