diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-01-03 14:53:03 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-01-03 14:53:03 +0100 |
commit | 53334dd6e9e296e17110ebcd2b1f93f117ffe36a (patch) | |
tree | 2653db2eab9a204dab892ea8b6812cadf7209e84 /nix/libstore/store-api.cc | |
parent | 1575dcd134f4fae7255787293f4988bbd043de95 (diff) | |
parent | 51385362f76e2f823ac8d8cf720d06c386504069 (diff) | |
download | guix-53334dd6e9e296e17110ebcd2b1f93f117ffe36a.tar guix-53334dd6e9e296e17110ebcd2b1f93f117ffe36a.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'nix/libstore/store-api.cc')
-rw-r--r-- | nix/libstore/store-api.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/nix/libstore/store-api.cc b/nix/libstore/store-api.cc index 0238e5b0b6..30af5f5fed 100644 --- a/nix/libstore/store-api.cc +++ b/nix/libstore/store-api.cc @@ -304,13 +304,28 @@ void exportPaths(StoreAPI & store, const Paths & paths, writeInt(0, sink); } +Path readStorePath(Source & from) +{ + Path path = readString(from); + assertStorePath(path); + return path; +} + + +template<class T> T readStorePaths(Source & from) +{ + T paths = readStrings<T>(from); + foreach (typename T::iterator, i, paths) assertStorePath(*i); + return paths; +} + +template PathSet readStorePaths(Source & from); } #include "local-store.hh" #include "serialise.hh" -#include "remote-store.hh" namespace nix { @@ -321,10 +336,7 @@ std::shared_ptr<StoreAPI> store; std::shared_ptr<StoreAPI> openStore(bool reserveSpace) { - if (getEnv("NIX_REMOTE") == "") - return std::shared_ptr<StoreAPI>(new LocalStore(reserveSpace)); - else - return std::shared_ptr<StoreAPI>(new RemoteStore()); + return std::shared_ptr<StoreAPI>(new LocalStore(reserveSpace)); } |