From 538a64e8c314f23ba0c5d76201f1c20e71884a21 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 4 May 2016 13:36:54 +0200 Subject: 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. --- src/libstore/remote-store.cc | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src/libstore/remote-store.cc') diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 1616f98f00..1a6afe46bb 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -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 accessor) -{ - auto conn(connections->get()); - conn->to << wopImportPaths; - conn->processStderr(0, &source); - return readStorePaths(conn->from); -} - - void RemoteStore::buildPaths(const PathSet & drvPaths, BuildMode buildMode) { auto conn(connections->get()); -- cgit 1.4.1