nix verify --all: Support local binary caches
This commit is contained in:
parent
0dd988d2e3
commit
6963de2091
|
@ -33,6 +33,20 @@ protected:
|
||||||
|
|
||||||
std::shared_ptr<std::string> getFile(const std::string & path) override;
|
std::shared_ptr<std::string> getFile(const std::string & path) override;
|
||||||
|
|
||||||
|
PathSet queryAllValidPaths() override
|
||||||
|
{
|
||||||
|
PathSet paths;
|
||||||
|
|
||||||
|
for (auto & entry : readDirectory(binaryCacheDir)) {
|
||||||
|
if (entry.name.size() != 40 ||
|
||||||
|
!hasSuffix(entry.name, ".narinfo"))
|
||||||
|
continue;
|
||||||
|
paths.insert(settings.nixStore + "/" + entry.name.substr(0, entry.name.size() - 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
return paths;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void LocalBinaryCacheStore::init()
|
void LocalBinaryCacheStore::init()
|
||||||
|
|
|
@ -227,8 +227,8 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore
|
||||||
|
|
||||||
for (auto object : contents) {
|
for (auto object : contents) {
|
||||||
auto & key = object.GetKey();
|
auto & key = object.GetKey();
|
||||||
if (!hasSuffix(key, ".narinfo")) continue;
|
if (key.size() != 40 || !hasSuffix(key, ".narinfo")) continue;
|
||||||
paths.insert(settings.nixStore + "/" + std::string(key, 0, key.size() - 8));
|
paths.insert(settings.nixStore + "/" + key.substr(0, key.size() - 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
marker = res.GetNextMarker();
|
marker = res.GetNextMarker();
|
||||||
|
|
Loading…
Reference in a new issue