about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-01T21·00+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-01T21·00+0000
commitfcd9900d74b0eb3d57402c448ede2a411133fa46 (patch)
tree642df2be381e3c9b239ca59c170052a43113fa30 /src/libexpr/primops.cc
parenta824d58b566752b2a89a718fd628053754968d72 (diff)
* Replace read-only calls to addTextToStore.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 17a04bc833..1d0d9c6b22 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -389,7 +389,9 @@ static Expr primToFile(EvalState & state, const ATermVector & args)
         refs.insert(*i);
     }
     
-    Path storePath = store->addTextToStore(name, contents, refs);
+    Path storePath = readOnlyMode
+        ? computeStorePathForText(name, contents)
+        : store->addTextToStore(name, contents, refs);
 
     /* Note: we don't need to add `context' to the context of the
        result, since `storePath' itself has references to the paths