mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +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:
parent
5f0b9de6d8
commit
e2ef5e07fd
17 changed files with 458 additions and 338 deletions
|
@ -2,7 +2,7 @@
|
|||
#include "parser.hh"
|
||||
#include "hash.hh"
|
||||
#include "util.hh"
|
||||
#include "store.hh"
|
||||
#include "store-api.hh"
|
||||
#include "derivations.hh"
|
||||
#include "nixexpr-ast.hh"
|
||||
|
||||
|
@ -251,7 +251,7 @@ string coerceToString(EvalState & state, Expr e, PathSet & context,
|
|||
if (state.srcToStore[path] != "")
|
||||
dstPath = state.srcToStore[path];
|
||||
else {
|
||||
dstPath = addToStore(path);
|
||||
dstPath = store->addToStore(path);
|
||||
state.srcToStore[path] = dstPath;
|
||||
printMsg(lvlChatty, format("copied source `%1%' -> `%2%'")
|
||||
% path % dstPath);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "misc.hh"
|
||||
#include "eval.hh"
|
||||
#include "globals.hh"
|
||||
#include "store.hh"
|
||||
#include "store-api.hh"
|
||||
#include "util.hh"
|
||||
#include "expr-to-xml.hh"
|
||||
#include "nixexpr-ast.hh"
|
||||
|
@ -46,7 +46,7 @@ static Expr primImport(EvalState & state, const ATermVector & args)
|
|||
|
||||
for (PathSet::iterator i = context.begin(); i != context.end(); ++i) {
|
||||
assert(isStorePath(*i));
|
||||
if (!isValidPath(*i))
|
||||
if (!store->isValidPath(*i))
|
||||
throw EvalError(format("cannot import `%1%', since path `%2%' is not valid")
|
||||
% path % *i);
|
||||
if (isDerivation(*i))
|
||||
|
@ -390,7 +390,7 @@ static Expr primToFile(EvalState & state, const ATermVector & args)
|
|||
refs.insert(*i);
|
||||
}
|
||||
|
||||
Path storePath = addTextToStore(name, contents, refs);
|
||||
Path storePath = store->addTextToStore(name, contents, refs);
|
||||
|
||||
/* Note: we don't need to add `context' to the context of the
|
||||
result, since `storePath' itself has references to the paths
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue