1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-13 14:02:42 +01:00

gc: Only track sensible paths from maps file

This commit is contained in:
Théophane Hufschmitt 2022-04-11 10:20:36 +02:00
parent 3839eb15d6
commit 35c7d5d2f1

View file

@ -234,9 +234,12 @@ void scanMapsFile(const GlobalOpts & opts, const fs::path & mapsFile, Roots & re
std::string line;
while (std::getline(mappedFile, line)) {
auto match = std::smatch{};
if (std::regex_match(line, match, mapRegex))
if (std::regex_match(line, match, mapRegex)) {
auto matchedPath = fs::path(match[1]);
if (isInStore(opts.storeDir, matchedPath))
res[fs::path(match[1])].emplace(mapsFile);
}
}
}