From e2ef5e07fdc142670f7f3161d3133ff04e99d342 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Nov 2006 17:43:04 +0000 Subject: * 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. --- src/libstore/misc.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/libstore/misc.cc') 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); } } } -- cgit 1.4.1