about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-11-19T16·27+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-11-19T16·27+0000
commite13da525a7c16200f451fafb832993b47d407418 (patch)
tree9fc4ca4e3df2c0505b68d7cbae7b438009aef5af /src/libstore
parent5d250ad1eae704106c7030ab984c929d7aef8f8f (diff)
* Files in the info directory starting with "." are temporary files
  and don't indicate path validity.

Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/local-store.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index d8ac9820ff70..9dcd13471124 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -408,6 +408,9 @@ ValidPathInfo LocalStore::queryPathInfo(const Path & path)
 
 bool LocalStore::isValidPath(const Path & path)
 {
+    /* Files in the info directory starting with a `.' are temporary
+       files. */
+    if (baseNameOf(path).at(0) == '.') return false;
     return pathExists(infoFileFor(path));
 }
 
@@ -416,8 +419,8 @@ PathSet LocalStore::queryValidPaths()
 {
     PathSet paths;
     Strings entries = readDirectory(nixDBPath + "/info");
-    for (Strings::iterator i = entries.begin(); i != entries.end(); ++i) 
-        paths.insert(nixStore + "/" + *i);
+    for (Strings::iterator i = entries.begin(); i != entries.end(); ++i)
+        if (i->at(0) != '.') paths.insert(nixStore + "/" + *i);
     return paths;
 }