diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-03-23 10:06:45 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-07-24 09:19:44 -0400 |
commit | 60d8dd7aeaf7fc022a1b207012c94180f6732b45 (patch) | |
tree | d75c4e83665fe7852938852f3d40908aa8d30784 /src/libstore/ssh-store.cc | |
parent | 13269ba93b7453def7084b00eb4a34ad787a7c45 (diff) |
Clean up store hierarchy with `IndirectRootStore`
See the API doc comments for details.
Diffstat (limited to 'src/libstore/ssh-store.cc')
-rw-r--r-- | src/libstore/ssh-store.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc index 0200076c0..9c6c42ef4 100644 --- a/src/libstore/ssh-store.cc +++ b/src/libstore/ssh-store.cc @@ -1,5 +1,6 @@ #include "ssh-store-config.hh" #include "store-api.hh" +#include "local-fs-store.hh" #include "remote-store.hh" #include "remote-store-connection.hh" #include "remote-fs-accessor.hh" @@ -61,7 +62,7 @@ public: std::optional<std::string> getBuildLogExact(const StorePath & path) override { unsupported("getBuildLogExact"); } -private: +protected: struct Connection : RemoteStore::Connection { @@ -93,9 +94,12 @@ private: ref<RemoteStore::Connection> SSHStore::openConnection() { auto conn = make_ref<Connection>(); - conn->sshConn = master.startCommand( - fmt("%s --stdio", remoteProgram) - + (remoteStore.get() == "" ? "" : " --store " + shellEscape(remoteStore.get()))); + + std::string command = remoteProgram + " --stdio"; + if (remoteStore.get() != "") + command += " --store " + shellEscape(remoteStore.get()); + + conn->sshConn = master.startCommand(command); conn->to = FdSink(conn->sshConn->in.get()); conn->from = FdSource(conn->sshConn->out.get()); return conn; |