diff options
-rw-r--r-- | release.nix | 3 | ||||
-rw-r--r-- | src/libstore/remote-store.cc | 23 | ||||
-rw-r--r-- | src/nix-daemon/nix-daemon.cc | 2 |
3 files changed, 25 insertions, 3 deletions
diff --git a/release.nix b/release.nix index d236cdae9..6b16bc718 100644 --- a/release.nix +++ b/release.nix @@ -25,7 +25,7 @@ let buildInputs = [ curl bison flex perl libxml2 libxslt bzip2 xz - pkgconfig sqlite libsodium + pkgconfig sqlite libsodium boehmgc docbook5 docbook5_xsl autoconf-archive ] ++ lib.optional (!lib.inNixShell) git; @@ -34,6 +34,7 @@ let --with-dbi=${perlPackages.DBI}/${perl.libPrefix} --with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix} --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} + --enable-gc ''; postUnpack = '' diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 7a041c6e0..a4bf7b587 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -335,7 +335,28 @@ Path RemoteStore::queryPathFromHashPart(const string & hashPart) void RemoteStore::addToStore(const ValidPathInfo & info, const ref<std::string> & nar, bool repair, bool dontCheckSigs, std::shared_ptr<FSAccessor> accessor) { - throw Error("RemoteStore::addToStore() not implemented"); + auto conn(connections->get()); + conn->to << wopImportPaths; + + StringSink sink; + sink << 1 // == path follows + ; + assert(nar->size() % 8 == 0); + sink((unsigned char *) nar->data(), nar->size()); + sink + << exportMagic + << info.path + << info.references + << info.deriver + << 0 // == no legacy signature + << 0 // == no path follows + ; + + StringSource source(*sink.s); + conn->processStderr(0, &source); + + auto importedPaths = readStorePaths<PathSet>(*this, conn->from); + assert(importedPaths.size() <= 1); } diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 41c847dad..0e4bcb525 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -324,7 +324,7 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe case wopImportPaths: { startWork(); TunnelSource source(from); - Paths paths = store->importPaths(source, 0); + Paths paths = store->importPaths(source, 0, trusted); stopWork(); to << paths; break; |