* 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
|
|
@ -1156,7 +1156,7 @@ void LocalStore::exportPath(const Path & path, bool sign,
|
|||
|
||||
PathSet references;
|
||||
queryReferences(path, references);
|
||||
writeStringSet(references, hashAndWriteSink);
|
||||
writeStrings(references, hashAndWriteSink);
|
||||
|
||||
Path deriver = queryDeriver(path);
|
||||
writeString(deriver, hashAndWriteSink);
|
||||
|
|
@ -1243,7 +1243,7 @@ Path LocalStore::importPath(bool requireSignature, Source & source)
|
|||
|
||||
Path dstPath = readStorePath(hashAndReadSource);
|
||||
|
||||
PathSet references = readStorePaths(hashAndReadSource);
|
||||
PathSet references = readStorePaths<PathSet>(hashAndReadSource);
|
||||
|
||||
Path deriver = readString(hashAndReadSource);
|
||||
if (deriver != "") assertStorePath(deriver);
|
||||
|
|
@ -1330,6 +1330,19 @@ Path LocalStore::importPath(bool requireSignature, Source & source)
|
|||
}
|
||||
|
||||
|
||||
Paths LocalStore::importPaths(bool requireSignature, Source & source)
|
||||
{
|
||||
Paths res;
|
||||
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'");
|
||||
res.push_back(importPath(requireSignature, source));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
void LocalStore::deleteFromStore(const Path & path, unsigned long long & bytesFreed,
|
||||
unsigned long long & blocksFreed)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue