1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Merge branch 'master' into no-manifests

This commit is contained in:
Eelco Dolstra 2012-07-18 10:47:59 -04:00
commit fe241ece29
16 changed files with 184 additions and 40 deletions

View file

@ -508,7 +508,11 @@ static void prim_toPath(EvalState & state, Value * * args, Value & v)
static void prim_storePath(EvalState & state, Value * * args, Value & v)
{
PathSet context;
Path path = canonPath(state.coerceToPath(*args[0], context));
Path path = state.coerceToPath(*args[0], context);
/* Resolve symlinks in path, unless path itself is a symlink
directly in the store. The latter condition is necessary so
e.g. nix-push does the right thing. */
if (!isStorePath(path)) path = canonPath(path, true);
if (!isInStore(path))
throw EvalError(format("path `%1%' is not in the Nix store") % path);
Path path2 = toStorePath(path);