about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-07-06T15·30+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-07-06T15·30+0000
commitd51aede4afeb49182879f257b56394b70938028f (patch)
treecea0470eb2f38eb1c1d0adcbecc59cf78b25516e /src
parenta945fb7905597ff67f285b39004f607f737b14e9 (diff)
* Allow the canonical system name to be specified at runtime in the
  Nix config file.

Diffstat (limited to 'src')
-rw-r--r--src/libmain/shared.cc2
-rw-r--r--src/libstore/globals.cc3
-rw-r--r--src/libstore/globals.hh3
-rw-r--r--src/libutil/util.cc3
-rw-r--r--src/libutil/util.hh4
5 files changed, 7 insertions, 8 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 97528f123e4a..fb24e832980c 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -93,6 +93,8 @@ static void initAndRun(int argc, char * * argv)
     nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db");
     nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR));
 
+    thisSystem = querySetting("system", SYSTEM);
+
     /* Catch SIGINT. */
     struct sigaction act, oact;
     act.sa_handler = sigintHandler;
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 194e1165face..ac8e19b7d46b 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -17,6 +17,7 @@ bool tryFallback = false;
 Verbosity buildVerbosity = lvlInfo;
 unsigned int maxBuildJobs = 1;
 bool readOnlyMode = false;
+string thisSystem = "unset";
 
 
 static bool settingsRead = false;
@@ -26,7 +27,7 @@ static map<string, Strings> settings;
 
 string & at(Strings & ss, unsigned int n)
 {
-    Strings::iterator i =ss.begin();
+    Strings::iterator i = ss.begin();
     advance(i, n);
     return *i;
 }
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index b5de709f7b54..408076b751e7 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -53,6 +53,9 @@ extern unsigned int maxBuildJobs;
    database. */
 extern bool readOnlyMode;
 
+/* The canonical system name, as returned by config.guess. */ 
+extern string thisSystem;
+
 
 Strings querySetting(const string & name, const Strings & def);
 
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 973443cf1380..9e3e0bae20df 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -16,9 +16,6 @@
 #include "util.hh"
 
 
-string thisSystem = SYSTEM;
-
-
 Error::Error(const format & f)
 {
     err = f.str();
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 05cf777f1eb6..92bdf50d31f7 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -55,10 +55,6 @@ typedef list<Path> Paths;
 typedef set<Path> PathSet;
 
 
-/* The canonical system name, as returned by config.guess. */ 
-extern string thisSystem;
-
-
 /* Return an environment variable. */
 string getEnv(const string & key, const string & def = "");