aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2013-12-05 11:51:54 -0500
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-12-10 15:07:04 +0100
commit22d665019a3770148929b7504c73bcdbe025ec12 (patch)
treec0b858911e4b71436e8e92f25cf00a9720149796 /src/libexpr
parenta6add93d734279db8503951ac6466c275b3c8e4e (diff)
builtins.storePath: Try to substitute the path if it is not yet valid
Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 2 insertions, 2 deletions
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);
}