From fcd9900d74b0eb3d57402c448ede2a411133fa46 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Dec 2006 21:00:39 +0000 Subject: * Replace read-only calls to addTextToStore. --- src/libexpr/primops.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libexpr') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 17a04bc83390..1d0d9c6b2245 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 -- cgit 1.4.1