1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

* 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.
This commit is contained in:
Eelco Dolstra 2006-11-30 17:43:04 +00:00
parent 5f0b9de6d8
commit e2ef5e07fd
17 changed files with 458 additions and 338 deletions

View file

@ -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);