about summary refs log tree commit diff
path: root/src/nix-worker/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-05T01·31+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-05T01·31+0000
commit29cf434a35d82529f56c085c9cd50858c148d086 (patch)
treeed6df2ab56312989b4e8e50ba5b246b9d5641396 /src/nix-worker/main.cc
parent8623256f483f77e090e689ae332165a530a489a5 (diff)
* The determination of the root set should be made by the privileged
  process, so forward the operation.
* Spam the user about GC misconfigurations (NIX-71).
* findRoots: skip all roots that are unreadable - the warnings with
  which we spam the user should be enough.

Diffstat (limited to 'src/nix-worker/main.cc')
-rw-r--r--src/nix-worker/main.cc29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/nix-worker/main.cc b/src/nix-worker/main.cc
index 80db782e90ba..e772421f39bc 100644
--- a/src/nix-worker/main.cc
+++ b/src/nix-worker/main.cc
@@ -23,23 +23,6 @@ using namespace nix;
 #endif
 
 
-static Path readStorePath(Source & from)
-{
-    Path path = readString(from);
-    assertStorePath(path);
-    return path;
-}
-
-
-static PathSet readStorePaths(Source & from)
-{
-    PathSet paths = readStringSet(from);
-    for (PathSet::iterator i = paths.begin(); i != paths.end(); ++i)
-        assertStorePath(*i);
-    return paths;
-}
-
-
 static FdSource from(STDIN_FILENO);
 static FdSink to(STDOUT_FILENO);
 
@@ -286,6 +269,18 @@ static void performOp(Source & from, Sink & to, unsigned int op)
         break;
     }
 
+    case wopFindRoots: {
+        startWork();
+        Roots roots = store->findRoots();
+        stopWork();
+        writeInt(roots.size(), to);
+        for (Roots::iterator i = roots.begin(); i != roots.end(); ++i) {
+            writeString(i->first, to);
+            writeString(i->second, to);
+        }
+        break;
+    }
+
     default:
         throw Error(format("invalid operation %1%") % op);
     }