1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 12:41:00 +01: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

@ -8,7 +8,7 @@ struct DummyStoreConfig : StoreConfig {
struct DummyStore : public Store, public virtual DummyStoreConfig
{
DummyStore(const std::string uri, const Params & params)
DummyStore(const std::string scheme, const std::string uri, const Params & params)
: DummyStore(params)
{ }
@ -21,7 +21,7 @@ struct DummyStore : public Store, public virtual DummyStoreConfig
string getUri() override
{
return uriPrefixes()[0] + "://";
return *uriSchemes().begin();
}
void queryPathInfoUncached(const StorePath & path,
@ -30,7 +30,7 @@ struct DummyStore : public Store, public virtual DummyStoreConfig
callback(nullptr);
}
static std::vector<std::string> uriPrefixes() {
static std::set<std::string> uriSchemes() {
return {"dummy"};
}