From 03103c0a36cc94238542de2bdf6eedcb679cca49 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 24 Jul 2014 16:00:29 +0200 Subject: Implement nix-copy-closure --from via nix-store --serve --- src/nix-store/nix-store.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/nix-store/nix-store.cc') 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(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(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); } -- cgit 1.4.1