1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 23:42:43 +01:00

Add a Store::addToStore() variant that accepts a NAR

As a side effect, this ensures that signatures are propagated when
copying paths between stores.

Also refactored import/export to make use of this.
This commit is contained in:
Eelco Dolstra 2016-05-04 13:36:54 +02:00
parent b6c768fb6a
commit 538a64e8c3
15 changed files with 235 additions and 338 deletions

View file

@ -326,6 +326,12 @@ Path RemoteStore::queryPathFromHashPart(const string & hashPart)
}
void RemoteStore::addToStore(const ValidPathInfo & info, const std::string & nar, bool repair)
{
throw Error("RemoteStore::addToStore() not implemented");
}
Path RemoteStore::addToStore(const string & name, const Path & _srcPath,
bool recursive, HashType hashAlgo, PathFilter & filter, bool repair)
{
@ -373,25 +379,6 @@ Path RemoteStore::addTextToStore(const string & name, const string & s,
}
void RemoteStore::exportPath(const Path & path, Sink & sink)
{
auto conn(connections->get());
conn->to << wopExportPath << path << 0;
conn->processStderr(&sink); /* sink receives the actual data */
readInt(conn->from);
}
Paths RemoteStore::importPaths(Source & source,
std::shared_ptr<FSAccessor> accessor)
{
auto conn(connections->get());
conn->to << wopImportPaths;
conn->processStderr(0, &source);
return readStorePaths<Paths>(conn->from);
}
void RemoteStore::buildPaths(const PathSet & drvPaths, BuildMode buildMode)
{
auto conn(connections->get());