about summary refs log tree commit diff
path: root/src/libstore/gc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-05-10T14·56+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-05-10T14·56+0000
commit109cde670629a0f022de1d875b55bb2f5243b271 (patch)
tree95541544a064907c12310e2cf28f2035542bd73c /src/libstore/gc.cc
parentc09e47c68f6d32d78df482929295ac0acaf6b387 (diff)
* Ignore (with a warning) invalid garbage collector roots.
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r--src/libstore/gc.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index a2be189cc1ab..634c610263b0 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -249,7 +249,12 @@ static void findRoots(const Path & path, bool recurseSymlinks,
         if (isInStore(target2)) {
             debug(format("found root `%1%' in `%2%'")
                 % target2 % path);
-            roots.insert(toStorePath(target2));
+            Path target3 = toStorePath(target2);
+            if (isValidPath(target3)) 
+                roots.insert(target3);
+            else
+                printMsg(lvlInfo, format("skipping invalid root from `%1%' to `%2%'")
+                    % path % target3);
         }
 
         else if (recurseSymlinks) {