From 97421eb5ecde86b75441094fda017b12b5eca2a6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Jul 2012 19:55:41 -0400 Subject: Refactor settings processing Put all Nix configuration flags in a Settings object. --- src/libexpr/primops.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 5c011c43e31c..7258c4cc0fa9 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -623,7 +623,7 @@ static void prim_toFile(EvalState & state, Value * * args, Value & v) refs.insert(path); } - Path storePath = readOnlyMode + Path storePath = settings.readOnlyMode ? computeStorePathForText(name, contents, refs) : store->addTextToStore(name, contents, refs); @@ -687,7 +687,7 @@ static void prim_filterSource(EvalState & state, Value * * args, Value & v) FilterFromExpr filter(state, *args[0]); - Path dstPath = readOnlyMode + Path dstPath = settings.readOnlyMode ? computeStorePathForPath(path, true, htSHA256, filter).first : store->addToStore(path, true, htSHA256, filter); @@ -1079,7 +1079,7 @@ void EvalState::createBaseEnv() mkInt(v, time(0)); addConstant("__currentTime", v); - mkString(v, thisSystem.c_str()); + mkString(v, settings.thisSystem.c_str()); addConstant("__currentSystem", v); // Miscellaneous -- cgit 1.4.1