about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-01T20·51+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-01T20·51+0000
commita824d58b566752b2a89a718fd628053754968d72 (patch)
treeff624d24dbbc61e199d699aa32e7bcf54773de39 /src/libexpr/eval.cc
parentceb982a1be381d59532d0405451f38d263abb617 (diff)
* Merge addToStore and addToStoreFixed.
* addToStore now adds unconditionally, it doesn't use readOnlyMode.
  Read-only operation is up to the caller (who can call
  computeStorePathForPath).

Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 04712e74b564..e58ff695c59c 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -5,6 +5,7 @@
 #include "store-api.hh"
 #include "derivations.hh"
 #include "nixexpr-ast.hh"
+#include "globals.hh"
 
 
 namespace nix {
@@ -251,7 +252,9 @@ string coerceToString(EvalState & state, Expr e, PathSet & context,
         if (state.srcToStore[path] != "")
             dstPath = state.srcToStore[path];
         else {
-            dstPath = store->addToStore(path);
+            dstPath = readOnlyMode
+                ? computeStorePathForPath(path).first
+                : store->addToStore(path);
             state.srcToStore[path] = dstPath;
             printMsg(lvlChatty, format("copied source `%1%' -> `%2%'")
                 % path % dstPath);