about summary refs log tree commit diff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-11-30T17·43+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-11-30T17·43+0000
commite2ef5e07fdc142670f7f3161d3133ff04e99d342 (patch)
treebf724d6af6f7fbe3b388fdfdd40f190da9a8378e /src/libstore/misc.cc
parent5f0b9de6d837daf43c6ab26d41c829621c3ca727 (diff)
* Refactoring. There is now an abstract interface class StoreAPI
  containing functions that operate on the Nix store.  One
  implementation is LocalStore, which operates on the Nix store
  directly.  The next step, to enable secure multi-user Nix, is to
  create a different implementation RemoteStore that talks to a
  privileged daemon process that uses LocalStore to perform the actual
  operations.

Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index bcede901c5ae..b442bd4c2157 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -1,5 +1,5 @@
 #include "misc.hh"
-#include "store.hh"
+#include "store-api.hh"
 #include "build.hh"
 #include "db.hh"
 
@@ -27,9 +27,9 @@ void computeFSClosure(const Path & storePath,
 
     PathSet references;
     if (flipDirection)
-        queryReferrers(noTxn, storePath, references);
+        store->queryReferrers(storePath, references);
     else
-        queryReferences(noTxn, storePath, references);
+        store->queryReferences(storePath, references);
 
     for (PathSet::iterator i = references.begin();
          i != references.end(); ++i)
@@ -58,14 +58,14 @@ void queryMissing(const PathSet & targets,
         done.insert(p);
 
         if (isDerivation(p)) {
-            if (!isValidPath(p)) continue;
+            if (!store->isValidPath(p)) continue;
             Derivation drv = derivationFromPath(p);
 
             bool mustBuild = false;
             for (DerivationOutputs::iterator i = drv.outputs.begin();
                  i != drv.outputs.end(); ++i)
-                if (!isValidPath(i->second.path) &&
-                    querySubstitutes(noTxn, i->second.path).size() == 0)
+                if (!store->isValidPath(i->second.path) &&
+                    store->querySubstitutes(i->second.path).size() == 0)
                     mustBuild = true;
 
             if (mustBuild) {
@@ -81,11 +81,11 @@ void queryMissing(const PathSet & targets,
         }
 
         else {
-            if (isValidPath(p)) continue;
-            if (querySubstitutes(noTxn, p).size() > 0)
+            if (store->isValidPath(p)) continue;
+            if (store->querySubstitutes(p).size() > 0)
                 willSubstitute.insert(p);
             PathSet refs;
-            queryReferences(noTxn, p, todo);
+            store->queryReferences(p, todo);
         }
     }
 }