summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/gc.cc4
-rw-r--r--src/libstore/store-api.hh5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index fa3b84b7af..2c75b16f61 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -417,7 +417,7 @@ static void dfsVisit(const PathSet & paths, const Path & path,
 }
 
 
-static Paths topoSort(const PathSet & paths)
+Paths topoSortPaths(const PathSet & paths)
 {
     Paths sorted;
     PathSet visited;
@@ -550,7 +550,7 @@ void LocalStore::collectGarbage(GCAction action, const PathSet & pathsToDelete,
        which things can be deleted safely. */
     /* !!! when we have multiple output paths per derivation, this
        will not work anymore because we get cycles. */
-    Paths storePaths = topoSort(storePathSet);
+    Paths storePaths = topoSortPaths(storePathSet);
 
     /* Try to delete store paths in the topologically sorted order. */
     for (Paths::iterator i = storePaths.begin(); i != storePaths.end(); ++i) {
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 1f2d60f11c..8531eb0404 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -242,6 +242,11 @@ Path addPermRoot(const Path & storePath, const Path & gcRoot,
     bool indirect, bool allowOutsideRootsDir = false);
 
 
+/* Sort a set of paths topologically under the references relation.
+   If p refers to q, then p follows q in this list. */
+Paths topoSortPaths(const PathSet & paths);
+
+
 /* For now, there is a single global store API object, but we'll
    purify that in the future. */
 extern boost::shared_ptr<StoreAPI> store;