forked from lix-project/lix
LocalStore::verifyPath
: Try to clarify data flow with more scopes
It was initially unclear to me which of these are temporary state for the verify paths computation, and which of these are the results of that computation to be used in the rest of the function. Now, it is clear, and enforced.
This commit is contained in:
parent
2a5f5fbb17
commit
6525265f46
|
@ -1499,21 +1499,24 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair)
|
||||||
auto fdGCLock = openGCLock();
|
auto fdGCLock = openGCLock();
|
||||||
FdLock gcLock(fdGCLock.get(), ltRead, true, "waiting for the big garbage collector lock...");
|
FdLock gcLock(fdGCLock.get(), ltRead, true, "waiting for the big garbage collector lock...");
|
||||||
|
|
||||||
StorePathSet store;
|
|
||||||
for (auto & i : readDirectory(realStoreDir)) {
|
|
||||||
try {
|
|
||||||
store.insert({i.name});
|
|
||||||
} catch (BadStorePath &) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check whether all valid paths actually exist. */
|
|
||||||
printInfo("checking path existence...");
|
|
||||||
|
|
||||||
StorePathSet validPaths;
|
StorePathSet validPaths;
|
||||||
StorePathSet done;
|
|
||||||
|
|
||||||
for (auto & i : queryAllValidPaths())
|
{
|
||||||
verifyPath(i, store, done, validPaths, repair, errors);
|
StorePathSet store;
|
||||||
|
for (auto & i : readDirectory(realStoreDir)) {
|
||||||
|
try {
|
||||||
|
store.insert({i.name});
|
||||||
|
} catch (BadStorePath &) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check whether all valid paths actually exist. */
|
||||||
|
printInfo("checking path existence...");
|
||||||
|
|
||||||
|
StorePathSet done;
|
||||||
|
|
||||||
|
for (auto & i : queryAllValidPaths())
|
||||||
|
verifyPath(i, store, done, validPaths, repair, errors);
|
||||||
|
}
|
||||||
|
|
||||||
/* Optionally, check the content hashes (slow). */
|
/* Optionally, check the content hashes (slow). */
|
||||||
if (checkContents) {
|
if (checkContents) {
|
||||||
|
|
Loading…
Reference in a new issue