Skip to content

Commit

Permalink
builtins.storePath: Try to substitute the path if it is not yet valid
Browse files Browse the repository at this point in the history
Signed-off-by: Shea Levy <shea@shealevy.com>
  • Loading branch information
shlevy authored and edolstra committed Dec 10, 2013
1 parent a6add93 commit 22d6650
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 22d6650

Please sign in to comment.