From a824d58b566752b2a89a718fd628053754968d72 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Dec 2006 20:51:18 +0000 Subject: * 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). --- src/nix-worker/main.cc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/nix-worker/main.cc') diff --git a/src/nix-worker/main.cc b/src/nix-worker/main.cc index 3642697dcf87..6d6571536b9c 100644 --- a/src/nix-worker/main.cc +++ b/src/nix-worker/main.cc @@ -79,25 +79,18 @@ void processConnection(Source & from, Sink & to) break; } - case wopAddToStore: - case wopAddToStoreFixed: { + case wopAddToStore: { /* !!! uberquick hack */ string baseName = readString(from); - bool recursive = false; - string hashAlgo; - if (op == wopAddToStoreFixed) { - recursive = readInt(from) == 1; - hashAlgo = readString(from); - } + bool fixed = readInt(from) == 1; + bool recursive = readInt(from) == 1; + string hashAlgo = readString(from); Path tmp = createTempDir(); Path tmp2 = tmp + "/" + baseName; restorePath(tmp2, from); - if (op == wopAddToStoreFixed) - writeString(store->addToStoreFixed(recursive, hashAlgo, tmp2), to); - else - writeString(store->addToStore(tmp2), to); + writeString(store->addToStore(tmp2, fixed, recursive, hashAlgo), to); deletePath(tmp); break; -- cgit 1.4.1