1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 02:11:15 +02:00

inline the usage of nix::readDirectory

`nix::readDirectory` is removed. `std::filesystem::directory_iterator`
is used directly in places that used this util.
This commit is contained in:
siddhantCodes 2024-05-12 17:42:18 +05:30
parent 87ab3c0ea4
commit 1db7d1b840
18 changed files with 26 additions and 44 deletions

View file

@ -1406,7 +1406,7 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair)
printInfo("checking link hashes...");
for (auto & link : readDirectory(linksDir)) {
for (auto & link : std::filesystem::directory_iterator{linksDir}) {
auto name = link.path().filename();
printMsg(lvlTalkative, "checking contents of '%s'", name);
PosixSourceAccessor accessor;
@ -1498,7 +1498,7 @@ LocalStore::VerificationResult LocalStore::verifyAllValidPaths(RepairFlag repair
database and the filesystem) in the loop below, in order to catch
invalid states.
*/
for (auto & i : readDirectory(realStoreDir)) {
for (auto & i : std::filesystem::directory_iterator{realStoreDir.to_string()}) {
try {
storePathsInStoreDir.insert({i.path().filename().string()});
} catch (BadStorePath &) { }