mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
* Refactoring.
This commit is contained in:
parent
052b6fb149
commit
f5f0cf423f
3 changed files with 33 additions and 17 deletions
|
@ -137,12 +137,10 @@ boost::shared_ptr<StoreAPI> store;
|
|||
|
||||
boost::shared_ptr<StoreAPI> openStore(bool reserveSpace)
|
||||
{
|
||||
string mode = getEnv("NIX_REMOTE");
|
||||
if (mode == "")
|
||||
if (getEnv("NIX_REMOTE") == "")
|
||||
return boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
|
||||
else if (mode == "slave")
|
||||
else
|
||||
return boost::shared_ptr<StoreAPI>(new RemoteStore());
|
||||
else throw Error(format("invalid setting for NIX_REMOTE, `%1%'") % mode);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue