mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
* 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.
This commit is contained in:
parent
8d3dfa2c17
commit
273b288a7e
10 changed files with 75 additions and 57 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue