Comparison

prosodyctl @ 3904:f93163081b3c

prosody, prosodyctl, util.dependencies: Split checking and logging of dependencies so we can check hard deps before the config and logging is loaded
author Matthew Wild <mwild1@gmail.com>
date Mon, 20 Dec 2010 14:06:16 +0000
parent 3777:5ecbcef42ffb
child 3998:009d1ad84b49
comparison
equal deleted inserted replaced
3903:5924197aa163 3904:f93163081b3c
38 platform = "posix"; 38 platform = "posix";
39 lock_globals = function () end; 39 lock_globals = function () end;
40 unlock_globals = function () end; 40 unlock_globals = function () end;
41 }; 41 };
42 local prosody = prosody; 42 local prosody = prosody;
43
44 local dependencies = require "util.dependencies";
45 if not dependencies.check_dependencies() then
46 os.exit(1);
47 end
43 48
44 config = require "core.configmanager" 49 config = require "core.configmanager"
45 50
46 do 51 do
47 local filenames = {}; 52 local filenames = {};
92 local original_logging_config = config.get("*", "core", "log"); 97 local original_logging_config = config.get("*", "core", "log");
93 config.set("*", "core", "log", { { levels = { min="info" }, to = "console" } }); 98 config.set("*", "core", "log", { { levels = { min="info" }, to = "console" } });
94 99
95 require "core.loggingmanager" 100 require "core.loggingmanager"
96 101
97 if not require "util.dependencies".check_dependencies() then 102 dependencies.log_warnings();
98 os.exit(1);
99 end
100 103
101 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; 104 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data";
102 require "util.datamanager".set_data_path(data_path); 105 require "util.datamanager".set_data_path(data_path);
103 106
104 -- Switch away from root and into the prosody user -- 107 -- Switch away from root and into the prosody user --