1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +02:00

Unify FSAccessor::Type and SourceAccessor::Type

This commit is contained in:
Eelco Dolstra 2023-11-01 14:43:20 +01:00
parent b2ac6fc040
commit 8ffd1695ce
4 changed files with 22 additions and 19 deletions

View file

@ -208,7 +208,7 @@ ref<const ValidPathInfo> BinaryCacheStore::addToStoreCommon(
std::string buildIdDir = "/lib/debug/.build-id";
if (auto st = narAccessor->stat(buildIdDir); st && st->type == FSAccessor::tDirectory) {
if (auto st = narAccessor->stat(buildIdDir); st && st->type == SourceAccessor::tDirectory) {
ThreadPool threadPool(25);
@ -234,14 +234,14 @@ ref<const ValidPathInfo> BinaryCacheStore::addToStoreCommon(
for (auto & s1 : narAccessor->readDirectory(buildIdDir)) {
auto dir = buildIdDir + "/" + s1;
if (auto st = narAccessor->stat(dir); !st || st->type != FSAccessor::tDirectory
if (auto st = narAccessor->stat(dir); !st || st->type != SourceAccessor::tDirectory
|| !std::regex_match(s1, regex1))
continue;
for (auto & s2 : narAccessor->readDirectory(dir)) {
auto debugPath = dir + "/" + s2;
if (auto st = narAccessor->stat(debugPath); !st || st->type != FSAccessor::tRegular
if (auto st = narAccessor->stat(debugPath); !st || st->type != SourceAccessor::tRegular
|| !std::regex_match(s2, regex2))
continue;