about summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc13
-rw-r--r--src/nix-store/serve-protocol.hh1
2 files changed, 13 insertions, 1 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index f874ffeadc3e..f2621a9954bf 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -993,9 +993,10 @@ static void opServe(Strings opFlags, Strings opArgs)
             }
 
             case cmdExportPaths: {
+                bool sign = readInt(in);
                 Paths sorted = topoSortPaths(*store, readStorePaths<PathSet>(in));
                 reverse(sorted.begin(), sorted.end());
-                exportPaths(*store, sorted, false, out);
+                exportPaths(*store, sorted, sign, out);
                 break;
             }
 
@@ -1025,6 +1026,16 @@ static void opServe(Strings opFlags, Strings opArgs)
                 break;
             }
 
+            case cmdQueryClosure: {
+                bool includeOutputs = readInt(in);
+                PathSet paths = readStorePaths<PathSet>(in);
+                PathSet closure;
+                for (auto & i : paths)
+                    computeFSClosure(*store, i, closure, false, includeOutputs);
+                writeStrings(closure, out);
+                break;
+            }
+
             default:
                 throw Error(format("unknown serve command %1%") % cmd);
         }
diff --git a/src/nix-store/serve-protocol.hh b/src/nix-store/serve-protocol.hh
index eb13b46e51bd..741b622beb17 100644
--- a/src/nix-store/serve-protocol.hh
+++ b/src/nix-store/serve-protocol.hh
@@ -16,6 +16,7 @@ typedef enum {
     cmdImportPaths = 4,
     cmdExportPaths = 5,
     cmdBuildPaths = 6,
+    cmdQueryClosure = 7,
 } ServeCommand;
 
 }