about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc17
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)) {