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/nix-env/main.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nix-env') 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); -- cgit 1.4.1