about summary refs log tree commit diff
path: root/src/nix-env/main.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/nix-env/main.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/nix-env/main.cc')
-rw-r--r--src/nix-env/main.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc
index f2a9957306c9..997c45da3073 100644
--- a/src/nix-env/main.cc
+++ b/src/nix-env/main.cc
@@ -13,7 +13,7 @@
 #include "attr-path.hh"
 #include "pathlocks.hh"
 #include "xml-writer.hh"
-#include "store.hh"
+#include "store-api.hh"
 #include "db.hh"
 #include "util.hh"
 
@@ -192,7 +192,7 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
 
     /* Also write a copy of the list of inputs to the store; we need
        it for future modifications of the environment. */
-    Path manifestFile = addTextToStore("env-manifest",
+    Path manifestFile = store->addTextToStore("env-manifest",
         atPrint(makeList(ATreverse(manifest))), references);
 
     Expr topLevel = makeCall(envBuilder, makeAttrs(ATmakeList3(
@@ -833,9 +833,9 @@ static void opQuery(Globals & globals,
             XMLAttrs attrs;
         
             if (printStatus) {
-                Substitutes subs = querySubstitutes(noTxn, i->queryOutPath(globals.state));
+                Substitutes subs = store->querySubstitutes(i->queryOutPath(globals.state));
                 bool isInstalled = installed.find(i->queryOutPath(globals.state)) != installed.end();
-                bool isValid = isValidPath(i->queryOutPath(globals.state));
+                bool isValid = store->isValidPath(i->queryOutPath(globals.state));
                 if (xmlOutput) {
                     attrs["installed"] = isInstalled ? "1" : "0";
                     attrs["valid"] = isValid ? "1" : "0";
@@ -1204,7 +1204,7 @@ void run(Strings args)
             : canonPath(nixStateDir + "/profiles/default");
     }
     
-    openDB();
+    store = openStore();
 
     op(globals, opFlags, opArgs);