about summary refs log tree commit diff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index dbb9273f7955..802e576512f1 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -12,17 +12,20 @@ Derivation derivationFromPath(const Path & drvPath)
 
 
 void computeFSClosure(const Path & storePath,
-    PathSet & paths)
+    PathSet & paths, bool flipDirection)
 {
     if (paths.find(storePath) != paths.end()) return;
     paths.insert(storePath);
 
     PathSet references;
-    queryReferences(storePath, references);
+    if (flipDirection)
+        queryReferers(storePath, references);
+    else
+        queryReferences(storePath, references);
 
     for (PathSet::iterator i = references.begin();
          i != references.end(); ++i)
-        computeFSClosure(*i, paths);
+        computeFSClosure(*i, paths, flipDirection);
 }