mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-23 14:36:16 +02:00
* Skeleton of remote store implementation.
This commit is contained in:
parent
6ecb840fd1
commit
9cf1948993
4 changed files with 14 additions and 6 deletions
|
@ -1,12 +1,12 @@
|
||||||
pkglib_LTLIBRARIES = libstore.la
|
pkglib_LTLIBRARIES = libstore.la
|
||||||
|
|
||||||
libstore_la_SOURCES = \
|
libstore_la_SOURCES = \
|
||||||
store-api.cc local-store.cc derivations.cc build.cc misc.cc globals.cc \
|
store-api.cc local-store.cc remote-store.cc derivations.cc build.cc misc.cc \
|
||||||
db.cc references.cc pathlocks.cc gc.cc
|
globals.cc db.cc references.cc pathlocks.cc gc.cc
|
||||||
|
|
||||||
pkginclude_HEADERS = \
|
pkginclude_HEADERS = \
|
||||||
store-api.hh local-store.cc derivations.hh misc.hh globals.hh \
|
store-api.hh local-store.cc remote-store.cc derivations.hh misc.hh \
|
||||||
db.hh references.hh pathlocks.hh gc.hh
|
globals.hh db.hh references.hh pathlocks.hh gc.hh
|
||||||
|
|
||||||
libstore_la_LIBADD = ../libutil/libutil.la ../boost/format/libformat.la
|
libstore_la_LIBADD = ../libutil/libutil.la ../boost/format/libformat.la
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
|
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "globals.hh"
|
#include "globals.hh"
|
||||||
|
#include "util.hh"
|
||||||
|
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
@ -90,6 +91,7 @@ Path makeFixedOutputPath(bool recursive,
|
||||||
|
|
||||||
|
|
||||||
#include "local-store.hh"
|
#include "local-store.hh"
|
||||||
|
#include "remote-store.hh"
|
||||||
|
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
@ -100,7 +102,12 @@ boost::shared_ptr<StoreAPI> store;
|
||||||
|
|
||||||
boost::shared_ptr<StoreAPI> openStore(bool reserveSpace)
|
boost::shared_ptr<StoreAPI> openStore(bool reserveSpace)
|
||||||
{
|
{
|
||||||
|
string mode = getEnv("NIX_REMOTE");
|
||||||
|
if (mode == "")
|
||||||
return boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
|
return boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
|
||||||
|
else if (mode == "slave")
|
||||||
|
return boost::shared_ptr<StoreAPI>(new RemoteStore());
|
||||||
|
else throw Error(format("invalid setting for NIX_REMOTE, `%1%'") % mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ Path createGeneration(Path profile, Path outPath)
|
||||||
|
|
||||||
/* Create the new generation. Note that addPermRoot() blocks if
|
/* Create the new generation. Note that addPermRoot() blocks if
|
||||||
the garbage collector is running to prevent the stuff we've
|
the garbage collector is running to prevent the stuff we've
|
||||||
build from moving from the temporary roots (which the GC knows)
|
built from moving from the temporary roots (which the GC knows)
|
||||||
to the permanent roots (of which the GC would have a stale
|
to the permanent roots (of which the GC would have a stale
|
||||||
view). If we didn't do it this way, the GC might remove the
|
view). If we didn't do it this way, the GC might remove the
|
||||||
user environment etc. we've just built. */
|
user environment etc. we've just built. */
|
||||||
|
|
Loading…
Reference in a new issue