about summary refs log tree commit diff
path: root/src/nix-worker
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/nix-worker
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/nix-worker')
-rw-r--r--src/nix-worker/main.cc17
1 files changed, 5 insertions, 12 deletions
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;