From 1fcb919798f8ff132353d447e6dfb81bedd3bc44 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 Jan 2011 22:46:29 +0000 Subject: If a non-globbed included file from config cannot be found then warn the user --- OpenSim/Region/Application/ConfigurationLoader.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 6e3d6af..d246181 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -180,6 +180,7 @@ namespace OpenSim { if (ReadConfig(sources[i])) iniFileExists = true; + AddIncludes(sources); } @@ -235,10 +236,19 @@ namespace OpenSim string path = Path.Combine(basepath, chunkWithoutWildcards); path = Path.GetFullPath(path) + chunkWithWildcards; string[] paths = Util.Glob(path); - foreach (string p in paths) + + // If the include path contains no wildcards, then warn the user that it wasn't found. + if (wildcardIndex == -1 && paths.Length == 0) { - if (!sources.Contains(p)) - sources.Add(p); + m_log.WarnFormat("[CONFIG]: Could not find include file {0}", path); + } + else + { + foreach (string p in paths) + { + if (!sources.Contains(p)) + sources.Add(p); + } } } } -- cgit v1.1 From a4acf485d7332ff6c22a2e0dffdbd1409e4b2dcb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 28 Jan 2011 22:50:49 +0000 Subject: minor: don't bother reparsing the sources for includes if ReadConfig() was unsuccessful --- OpenSim/Region/Application/ConfigurationLoader.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index d246181..40ab765 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -179,9 +179,10 @@ namespace OpenSim for (int i = 0 ; i < sources.Count ; i++) { if (ReadConfig(sources[i])) + { iniFileExists = true; - - AddIncludes(sources); + AddIncludes(sources); + } } if (!iniFileExists) -- cgit v1.1