diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-10-10T21·23+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-10-10T21·23+0000 |
commit | 0c4c5c2020383db9c2d39d7a3420195568d06312 (patch) | |
tree | 5a21b8fd92e06a6b2d2f8a56926c27a69d5337ed /src/libexpr/primops.cc | |
parent | bd0c40e1e93d2239b44bd1f73c2587cd62e66e4d (diff) |
* Quick hack to fix NIX-67: evaluation result differing if the Nix
expression resides in the store.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 0b1ea7f39bf4..761677a706b6 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -159,8 +159,15 @@ void toString(EvalState & state, Expr e, else if (matchPath(e, s)) { Path path(canonPath(aterm2String(s))); - if (!isInStore(path)) { + if (isStorePath(path) || (isWrapped && isInStore(path))) { + result += path; + /* !!! smells hacky. Check whether this is the Right + Thing To Do. */ + if (!isWrapped) + context = ATinsert(context, makePath(toATerm(toStorePath(path)))); + } + else { if (isDerivation(path)) throw EvalError(format("file names are not allowed to end in `%1%'") % drvExtension); @@ -178,14 +185,6 @@ void toString(EvalState & state, Expr e, result += dstPath; context = ATinsert(context, makePath(toATerm(dstPath))); } - - else { - result += path; - /* !!! smells hacky. Check whether this is the Right - Thing To Do. */ - if (!isWrapped) - context = ATinsert(context, makePath(toATerm(toStorePath(path)))); - } } else if (matchList(e, es)) { |