aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24 16:00:29 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-24 16:19:41 +0200
commit03103c0a36cc94238542de2bdf6eedcb679cca49 (patch)
tree04ab7ba5b8568937df7331f2347ab5c982517cef /src/nix-store/nix-store.cc
parent62309a2c56206821370b87285fcacacba1cb3566 (diff)
Implement nix-copy-closure --from via nix-store --serve
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index f874ffead..f2621a995 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);
}