diff options
author | Justin Clark-Casey (justincc) | 2014-01-28 00:04:55 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-01-28 00:04:55 +0000 |
commit | f7172095e09bf76bd85e17f3be24280b49348168 (patch) | |
tree | d2e76c0b9e18fe774a445880318d5a966daeb028 /OpenSim/Region/Application | |
parent | Make inidirectory files supercede distro files (diff) | |
download | opensim-SC-f7172095e09bf76bd85e17f3be24280b49348168.zip opensim-SC-f7172095e09bf76bd85e17f3be24280b49348168.tar.gz opensim-SC-f7172095e09bf76bd85e17f3be24280b49348168.tar.bz2 opensim-SC-f7172095e09bf76bd85e17f3be24280b49348168.tar.xz |
Convert tabs to spaces from previous commit 8c2b41b01
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/ConfigurationLoader.cs | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 9634dab..52e520c 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -124,7 +124,7 @@ namespace OpenSim | |||
124 | else | 124 | else |
125 | { | 125 | { |
126 | Application.iniFilePath = Path.GetFullPath( | 126 | Application.iniFilePath = Path.GetFullPath( |
127 | Path.Combine(Util.configDir(), iniFileName)); | 127 | Path.Combine(Util.configDir(), iniFileName)); |
128 | 128 | ||
129 | if (!File.Exists(Application.iniFilePath)) | 129 | if (!File.Exists(Application.iniFilePath)) |
130 | { | 130 | { |
@@ -154,14 +154,14 @@ namespace OpenSim | |||
154 | } | 154 | } |
155 | } | 155 | } |
156 | 156 | ||
157 | // Override distro settings with contents of inidirectory | 157 | // Override distro settings with contents of inidirectory |
158 | string iniDirName = startupConfig.GetString("inidirectory", "config"); | 158 | string iniDirName = startupConfig.GetString("inidirectory", "config"); |
159 | string iniDirPath = Path.Combine(Util.configDir(), iniDirName); | 159 | string iniDirPath = Path.Combine(Util.configDir(), iniDirName); |
160 | 160 | ||
161 | if (Directory.Exists(iniDirPath)) | 161 | if (Directory.Exists(iniDirPath)) |
162 | { | 162 | { |
163 | m_log.InfoFormat("[CONFIG]: Searching folder {0} for config ini files", iniDirPath); | 163 | m_log.InfoFormat("[CONFIG]: Searching folder {0} for config ini files", iniDirPath); |
164 | List<string> overrideSources = new List<string>(); | 164 | List<string> overrideSources = new List<string>(); |
165 | 165 | ||
166 | string[] fileEntries = Directory.GetFiles(iniDirName); | 166 | string[] fileEntries = Directory.GetFiles(iniDirName); |
167 | foreach (string filePath in fileEntries) | 167 | foreach (string filePath in fileEntries) |
@@ -169,45 +169,45 @@ namespace OpenSim | |||
169 | if (Path.GetExtension(filePath).ToLower() == ".ini") | 169 | if (Path.GetExtension(filePath).ToLower() == ".ini") |
170 | { | 170 | { |
171 | if (!sources.Contains(Path.GetFullPath(filePath))) | 171 | if (!sources.Contains(Path.GetFullPath(filePath))) |
172 | { | 172 | { |
173 | overrideSources.Add(Path.GetFullPath(filePath)); | 173 | overrideSources.Add(Path.GetFullPath(filePath)); |
174 | // put it in sources too, to avoid circularity | 174 | // put it in sources too, to avoid circularity |
175 | sources.Add(Path.GetFullPath(filePath)); | 175 | sources.Add(Path.GetFullPath(filePath)); |
176 | } | 176 | } |
177 | } | 177 | } |
178 | } | 178 | } |
179 | 179 | ||
180 | 180 | ||
181 | if (overrideSources.Count > 0) | 181 | if (overrideSources.Count > 0) |
182 | { | 182 | { |
183 | OpenSimConfigSource overrideConfig = new OpenSimConfigSource(); | 183 | OpenSimConfigSource overrideConfig = new OpenSimConfigSource(); |
184 | overrideConfig.Source = new IniConfigSource(); | 184 | overrideConfig.Source = new IniConfigSource(); |
185 | 185 | ||
186 | for (int i = 0 ; i < overrideSources.Count ; i++) | 186 | for (int i = 0 ; i < overrideSources.Count ; i++) |
187 | { | 187 | { |
188 | if (ReadConfig(overrideConfig, overrideSources[i])) | 188 | if (ReadConfig(overrideConfig, overrideSources[i])) |
189 | { | 189 | { |
190 | iniFileExists = true; | 190 | iniFileExists = true; |
191 | AddIncludes(overrideConfig, overrideSources); | 191 | AddIncludes(overrideConfig, overrideSources); |
192 | } | 192 | } |
193 | } | 193 | } |
194 | m_config.Source.Merge(overrideConfig.Source); | 194 | m_config.Source.Merge(overrideConfig.Source); |
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | if (sources.Count == 0) | 198 | if (sources.Count == 0) |
199 | { | 199 | { |
200 | m_log.FatalFormat("[CONFIG]: Could not load any configuration"); | 200 | m_log.FatalFormat("[CONFIG]: Could not load any configuration"); |
201 | Environment.Exit(1); | 201 | Environment.Exit(1); |
202 | } | 202 | } |
203 | else if (!iniFileExists) | 203 | else if (!iniFileExists) |
204 | { | 204 | { |
205 | m_log.FatalFormat("[CONFIG]: Could not load any configuration"); | 205 | m_log.FatalFormat("[CONFIG]: Could not load any configuration"); |
206 | m_log.FatalFormat("[CONFIG]: Configuration exists, but there was an error loading it!"); | 206 | m_log.FatalFormat("[CONFIG]: Configuration exists, but there was an error loading it!"); |
207 | Environment.Exit(1); | 207 | Environment.Exit(1); |
208 | } | 208 | } |
209 | 209 | ||
210 | // Make sure command line options take precedence | 210 | // Make sure command line options take precedence |
211 | m_config.Source.Merge(argvSource); | 211 | m_config.Source.Merge(argvSource); |
212 | 212 | ||
213 | IConfig enVars = m_config.Source.Configs["Environment"]; | 213 | IConfig enVars = m_config.Source.Configs["Environment"]; |