From 9cf1948993659cc394eccea5890e14df82eff8bb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Nov 2006 18:35:36 +0000 Subject: * Skeleton of remote store implementation. --- src/libstore/Makefile.am | 8 ++++---- src/libstore/local-store.cc | 1 + src/libstore/store-api.cc | 9 ++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am index 4d25c2d68961..1f294fde6609 100644 --- a/src/libstore/Makefile.am +++ b/src/libstore/Makefile.am @@ -1,12 +1,12 @@ pkglib_LTLIBRARIES = libstore.la libstore_la_SOURCES = \ - store-api.cc local-store.cc derivations.cc build.cc misc.cc globals.cc \ - db.cc references.cc pathlocks.cc gc.cc + store-api.cc local-store.cc remote-store.cc derivations.cc build.cc misc.cc \ + globals.cc db.cc references.cc pathlocks.cc gc.cc pkginclude_HEADERS = \ - store-api.hh local-store.cc derivations.hh misc.hh globals.hh \ - db.hh references.hh pathlocks.hh gc.hh + store-api.hh local-store.cc remote-store.cc derivations.hh misc.hh \ + globals.hh db.hh references.hh pathlocks.hh gc.hh libstore_la_LIBADD = ../libutil/libutil.la ../boost/format/libformat.la diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index c8bb60bce6b0..2ae4437623a6 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -16,6 +16,7 @@ #include #include + namespace nix { diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 3a07d1c73ca2..092d7f1e9405 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1,5 +1,6 @@ #include "store-api.hh" #include "globals.hh" +#include "util.hh" namespace nix { @@ -90,6 +91,7 @@ Path makeFixedOutputPath(bool recursive, #include "local-store.hh" +#include "remote-store.hh" namespace nix { @@ -100,7 +102,12 @@ boost::shared_ptr store; boost::shared_ptr openStore(bool reserveSpace) { - return boost::shared_ptr(new LocalStore(reserveSpace)); + string mode = getEnv("NIX_REMOTE"); + if (mode == "") + return boost::shared_ptr(new LocalStore(reserveSpace)); + else if (mode == "slave") + return boost::shared_ptr(new RemoteStore()); + else throw Error(format("invalid setting for NIX_REMOTE, `%1%'") % mode); } -- cgit 1.4.1