From 22d665019a3770148929b7504c73bcdbe025ec12 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 5 Dec 2013 11:51:54 -0500 Subject: builtins.storePath: Try to substitute the path if it is not yet valid Signed-off-by: Shea Levy --- src/libexpr/primops.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libexpr') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 9c9d202ed..6d09bb7b1 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -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); } -- cgit v1.2.3