aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-binary-cache-store.cc
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2020-09-11 11:11:05 +0200
committerregnat <rg@regnat.ovh>2020-09-16 13:53:09 +0200
commit7f103dcddd4cf3c0748b7a379a117f3262c4c5f7 (patch)
tree7288d4b6552bb45be7c0dfa1e985340769e2f114 /src/libstore/local-binary-cache-store.cc
parent5895184df44e86ae55270390402c8263b0f24ae2 (diff)
Properly filter the stores according to their declared uriSchemes
When opening a store, only try the stores whose `uriSchemes()` include the current one
Diffstat (limited to 'src/libstore/local-binary-cache-store.cc')
-rw-r--r--src/libstore/local-binary-cache-store.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc
index becd74c75..4d11e0f2a 100644
--- a/src/libstore/local-binary-cache-store.cc
+++ b/src/libstore/local-binary-cache-store.cc
@@ -18,6 +18,7 @@ private:
public:
LocalBinaryCacheStore(
+ [[maybe_unused]] const std::string scheme,
const Path & binaryCacheDir,
const Params & params)
: StoreConfig(params)
@@ -35,7 +36,7 @@ public:
return "file://" + binaryCacheDir;
}
- static std::vector<std::string> uriPrefixes();
+ static std::set<std::string> uriSchemes();
protected:
@@ -96,7 +97,7 @@ bool LocalBinaryCacheStore::fileExists(const std::string & path)
return pathExists(binaryCacheDir + "/" + path);
}
-std::vector<std::string> LocalBinaryCacheStore::uriPrefixes()
+std::set<std::string> LocalBinaryCacheStore::uriSchemes()
{
if (getEnv("_NIX_FORCE_HTTP_BINARY_CACHE_STORE") == "1")
return {};