forked from lix-project/lix
More GC fixes
This commit is contained in:
parent
538a64e8c3
commit
c6a21aed07
|
@ -265,7 +265,7 @@ void LocalStore::findRoots(const Path & path, unsigned char type, Roots & roots)
|
||||||
{
|
{
|
||||||
auto foundRoot = [&](const Path & path, const Path & target) {
|
auto foundRoot = [&](const Path & path, const Path & target) {
|
||||||
Path storePath = toStorePath(target);
|
Path storePath = toStorePath(target);
|
||||||
if (isValidPath(storePath))
|
if (isStorePath(storePath) && isValidPath(storePath))
|
||||||
roots[path] = storePath;
|
roots[path] = storePath;
|
||||||
else
|
else
|
||||||
printMsg(lvlInfo, format("skipping invalid root from ‘%1%’ to ‘%2%’") % path % storePath);
|
printMsg(lvlInfo, format("skipping invalid root from ‘%1%’ to ‘%2%’") % path % storePath);
|
||||||
|
@ -351,7 +351,7 @@ void LocalStore::findRuntimeRoots(PathSet & roots)
|
||||||
for (auto & i : paths)
|
for (auto & i : paths)
|
||||||
if (isInStore(i)) {
|
if (isInStore(i)) {
|
||||||
Path path = toStorePath(i);
|
Path path = toStorePath(i);
|
||||||
if (roots.find(path) == roots.end() && isValidPath(path)) {
|
if (roots.find(path) == roots.end() && isStorePath(path) && isValidPath(path)) {
|
||||||
debug(format("got additional root ‘%1%’") % path);
|
debug(format("got additional root ‘%1%’") % path);
|
||||||
roots.insert(path);
|
roots.insert(path);
|
||||||
}
|
}
|
||||||
|
@ -402,7 +402,7 @@ void LocalStore::deletePathRecursive(GCState & state, const Path & path)
|
||||||
|
|
||||||
unsigned long long size = 0;
|
unsigned long long size = 0;
|
||||||
|
|
||||||
if (isValidPath(path)) {
|
if (isStorePath(path) && isValidPath(path)) {
|
||||||
PathSet referrers;
|
PathSet referrers;
|
||||||
queryReferrers(path, referrers);
|
queryReferrers(path, referrers);
|
||||||
for (auto & i : referrers)
|
for (auto & i : referrers)
|
||||||
|
@ -473,7 +473,7 @@ bool LocalStore::canReachRoot(GCState & state, PathSet & visited, const Path & p
|
||||||
|
|
||||||
visited.insert(path);
|
visited.insert(path);
|
||||||
|
|
||||||
if (!isValidPath(path)) return false;
|
if (!isStorePath(path) || !isValidPath(path)) return false;
|
||||||
|
|
||||||
PathSet incoming;
|
PathSet incoming;
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ void LocalStore::tryToDelete(GCState & state, const Path & path)
|
||||||
|
|
||||||
Activity act(*logger, lvlDebug, format("considering whether to delete ‘%1%’") % path);
|
Activity act(*logger, lvlDebug, format("considering whether to delete ‘%1%’") % path);
|
||||||
|
|
||||||
if (!isValidPath(path)) {
|
if (!isStorePath(path) || !isValidPath(path)) {
|
||||||
/* A lock file belonging to a path that we're building right
|
/* A lock file belonging to a path that we're building right
|
||||||
now isn't garbage. */
|
now isn't garbage. */
|
||||||
if (isActiveTempFile(state, path, ".lock")) return;
|
if (isActiveTempFile(state, path, ".lock")) return;
|
||||||
|
|
Loading…
Reference in a new issue