aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-12-16 22:31:25 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-12-16 22:31:25 +0000
commit273b288a7e862ac1918064537ff130cc751fa9fd (patch)
tree06494346db77ff96da1f68dbb271e9c3a2e64e12 /src/nix-store/nix-store.cc
parent8d3dfa2c1782e955d2b7796d19dc0d0381596b98 (diff)
* importPath() -> importPaths(). Because of buffering of the input
stream it's now necessary for the daemon to process the entire sequence of exported paths, rather than letting the client do it.
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 740033b45..e92ccb153 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -600,12 +600,10 @@ static void opImport(Strings opFlags, Strings opArgs)
if (!opArgs.empty()) throw UsageError("no arguments expected");
FdSource source(STDIN_FILENO);
- while (true) {
- unsigned long long n = readLongLong(source);
- if (n == 0) break;
- if (n != 1) throw Error("input doesn't look like something created by `nix-store --export'");
- cout << format("%1%\n") % store->importPath(requireSignature, source) << std::flush;
- }
+ Paths paths = store->importPaths(requireSignature, source);
+
+ foreach (Paths::iterator, i, paths)
+ cout << format("%1%\n") % *i << std::flush;
}