1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 21:51:50 +02:00

Properly filter the stores according to their declared uriSchemes

When opening a store, only try the stores whose `uriSchemes()` include
the current one
This commit is contained in:
regnat 2020-09-11 11:11:05 +02:00
parent 5895184df4
commit 7f103dcddd
10 changed files with 51 additions and 33 deletions

View file

@ -22,7 +22,7 @@ class SSHStore : public virtual RemoteStore, public virtual SSHStoreConfig
{
public:
SSHStore(const std::string & host, const Params & params)
SSHStore([[maybe_unused]] const std::string & scheme, const std::string & host, const Params & params)
: StoreConfig(params)
, Store(params)
, RemoteStoreConfig(params)
@ -38,11 +38,11 @@ public:
{
}
static std::vector<std::string> uriPrefixes() { return {"ssh-ng"}; }
static std::set<std::string> uriSchemes() { return {"ssh-ng"}; }
std::string getUri() override
{
return uriPrefixes()[0] + "://" + host;
return *uriSchemes().begin() + "://" + host;
}
bool sameMachine() override