From 87f325ecd730e6ac3e9e88a767762ba026a32c57 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 28 Jan 2017 21:43:38 +0100 Subject: util.dependencies: Normalize whitespace --- util/dependencies.lua | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/util/dependencies.lua b/util/dependencies.lua index 5d8446da..8c8e731c 100644 --- a/util/dependencies.lua +++ b/util/dependencies.lua @@ -82,10 +82,10 @@ local function check_dependencies() local lfs, err = softreq "lfs" if not lfs then missingdep("luafilesystem", { - ["luarocks"] = "luarocks install luafilesystem"; - ["Debian/Ubuntu"] = "sudo apt-get install lua-filesystem"; - ["Source"] = "http://www.keplerproject.org/luafilesystem/"; - }); + ["luarocks"] = "luarocks install luafilesystem"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-filesystem"; + ["Source"] = "http://www.keplerproject.org/luafilesystem/"; + }); fatal = true; end @@ -112,9 +112,10 @@ local function check_dependencies() local encodings, err = softreq "util.encodings" if not encodings then if err:match("module '[^']*' not found") then - missingdep("util.encodings", { ["Windows"] = "Make sure you have encodings.dll from the Prosody distribution in util/"; - ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/encodings.so"; - }); + missingdep("util.encodings", { + ["Windows"] = "Make sure you have encodings.dll from the Prosody distribution in util/"; + ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/encodings.so"; + }); else print "***********************************" print("util/encodings couldn't be loaded. Check that you have a recent version of libidn"); @@ -129,10 +130,11 @@ local function check_dependencies() local hashes, err = softreq "util.hashes" if not hashes then if err:match("module '[^']*' not found") then - missingdep("util.hashes", { ["Windows"] = "Make sure you have hashes.dll from the Prosody distribution in util/"; - ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/hashes.so"; - }); - else + missingdep("util.hashes", { + ["Windows"] = "Make sure you have hashes.dll from the Prosody distribution in util/"; + ["GNU/Linux"] = "Run './configure' and 'make' in the Prosody source directory to build util/hashes.so"; + }); + else print "***********************************" print("util/hashes couldn't be loaded. Check that you have a recent version of OpenSSL (libcrypto in particular)"); print "" -- cgit v1.2.3 From 18e2d68459db286d0031186945a729d389daa272 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 29 Jan 2017 22:26:38 +0100 Subject: prosody: Trim trailing whitespace --- prosody | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/prosody b/prosody index 209991e0..a922ea81 100755 --- a/prosody +++ b/prosody @@ -2,7 +2,7 @@ -- Prosody IM -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -60,13 +60,13 @@ local dependencies = require "util.dependencies"; config = require "core.configmanager" -- -- -- -- --- Define the functions we call during startup, the +-- Define the functions we call during startup, the -- actual startup happens right at the end, where these -- functions get called function read_config() local filenames = {}; - + local filename; if arg[1] == "--config" and arg[2] then table.insert(filenames, arg[2]); @@ -131,7 +131,7 @@ function load_libraries() -- Load socket framework socket = require "socket"; server = require "net.server" -end +end -- The global log() gets defined by loggingmanager -- luacheck: ignore 113/log @@ -227,7 +227,7 @@ function init_global_state() bare_sessions = prosody.bare_sessions; full_sessions = prosody.full_sessions; hosts = prosody.hosts; - + local data_path = config.get("*", "data_path") or CFG_DATADIR or "data"; local custom_plugin_paths = config.get("*", "plugin_paths"); if custom_plugin_paths then @@ -235,7 +235,7 @@ function init_global_state() -- path1;path2;path3;defaultpath... CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins"); end - prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR or ".", + prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR or ".", plugins = CFG_PLUGINDIR or "plugins", data = data_path }; prosody.arg = _G.arg; @@ -246,12 +246,12 @@ function init_global_state() elseif package.config:sub(1,1) == "/" then prosody.platform = "posix"; end - + prosody.installed = nil; if CFG_SOURCEDIR and (prosody.platform == "windows" or CFG_SOURCEDIR:match("^/")) then prosody.installed = true; end - + if prosody.installed then -- Change working directory to data path. require "lfs".chdir(data_path); @@ -323,18 +323,18 @@ function load_secondary_libraries() end}); require "net.http" - + require "util.array" require "util.datetime" require "util.iterators" require "util.timer" require "util.helpers" - + pcall(require, "util.signal") -- Not on Windows - - -- Commented to protect us from + + -- Commented to protect us from -- the second kind of people - --[[ + --[[ pcall(require, "remdebug.engine"); if remdebug then remdebug.engine.start() end ]] @@ -352,7 +352,7 @@ function prepare_to_start() -- Signal to modules that we are ready to start prosody.events.fire_event("server-starting"); prosody.start_time = os.time(); -end +end function init_global_protection() -- Catch global accesses @@ -361,11 +361,11 @@ function init_global_protection() __index = function (t, k) log("warn", "%s", debug.traceback("Attempt to read a non-existent global '"..tostring(k).."'", 2)); end; __newindex = function (t, k, v) error("Attempt to set a global: "..tostring(k).." = "..tostring(v), 2); end; }; - + function prosody.unlock_globals() setmetatable(_G, nil); end - + function prosody.lock_globals() setmetatable(_G, locked_globals_mt); end @@ -380,16 +380,16 @@ function loop() if type(err) == "string" and err:match("interrupted!$") then return "quitting"; end - + log("error", "Top-level error, please report:\n%s", tostring(err)); local traceback = debug.traceback("", 2); if traceback then log("error", "%s", traceback); end - + prosody.events.fire_event("very-bad-error", {error = err, traceback = traceback}); end - + local sleep = require"socket".sleep; while select(2, xpcall(server.loop, catch_uncaught_error)) ~= "quitting" do -- cgit v1.2.3 From ebd348e104a7678ed2a82fdc1ecce420e7f2a8d7 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 29 Jan 2017 22:31:34 +0100 Subject: prosody: Silence warnings about setting the globals 'server' and 'socket' [luacheck] --- prosody | 1 + 1 file changed, 1 insertion(+) diff --git a/prosody b/prosody index a922ea81..0a48eba4 100755 --- a/prosody +++ b/prosody @@ -129,6 +129,7 @@ end function load_libraries() -- Load socket framework + -- luacheck: ignore 111/server 111/socket socket = require "socket"; server = require "net.server" end -- cgit v1.2.3