aboutsummaryrefslogtreecommitdiffstats
path: root/util/dependencies.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/dependencies.lua')
-rw-r--r--util/dependencies.lua23
1 files changed, 11 insertions, 12 deletions
diff --git a/util/dependencies.lua b/util/dependencies.lua
index d7836404..30b53970 100644
--- a/util/dependencies.lua
+++ b/util/dependencies.lua
@@ -7,7 +7,6 @@
--
local function softreq(...) local ok, lib = pcall(require, ...); if ok then return lib; else return nil, lib; end end
-local platform_table = require "util.human.io".table({ { width = 15, align = "right" }, { width = "100%" } });
-- Required to be able to find packages installed with luarocks
if not softreq "luarocks.loader" then -- LuaRocks 2.x
@@ -22,7 +21,7 @@ local function missingdep(name, sources, msg, err) -- luacheck: ignore err
print("This package can be obtained in the following ways:");
print("");
for _, row in ipairs(sources) do
- print(platform_table(row));
+ print(string.format("%15s | %s", table.unpack(row)));
end
print("");
print(msg or (name.." is required for Prosody to run, so we will now exit."));
@@ -32,10 +31,10 @@ local function missingdep(name, sources, msg, err) -- luacheck: ignore err
end
local function check_dependencies()
- if _VERSION < "Lua 5.1" then
+ if _VERSION < "Lua 5.2" then
print "***********************************"
print("Unsupported Lua version: ".._VERSION);
- print("At least Lua 5.1 is required.");
+ print("At least Lua 5.2 is required.");
print "***********************************"
return false;
end
@@ -88,7 +87,7 @@ local function check_dependencies()
}, nil, err);
end
- local bit, err = softreq"util.bitcompat";
+ local bit, err = softreq"prosody.util.bitcompat";
if not bit then
missingdep("lua-bitops", {
@@ -106,16 +105,16 @@ local function check_dependencies()
{ "Source", "https://www.zash.se/luaunbound.html" };
}, "Old DNS resolver library will be used", err);
else
- package.preload["net.adns"] = function ()
- local ub = require "net.unbound";
+ package.preload["prosody.net.adns"] = function ()
+ local ub = require "prosody.net.unbound";
return ub;
end
end
- local encodings, err = softreq "util.encodings"
+ local encodings, err = softreq "prosody.util.encodings"
if not encodings then
if err:match("module '[^']*' not found") then
- missingdep("util.encodings", {
+ missingdep("prosody.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" };
});
@@ -130,10 +129,10 @@ local function check_dependencies()
fatal = true;
end
- local hashes, err = softreq "util.hashes"
+ local hashes, err = softreq "prosody.util.hashes"
if not hashes then
if err:match("module '[^']*' not found") then
- missingdep("util.hashes", {
+ missingdep("prosody.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" };
});
@@ -155,7 +154,7 @@ local function log_warnings()
if _VERSION > "Lua 5.4" then
prosody.log("warn", "Support for %s is experimental, please report any issues", _VERSION);
elseif _VERSION < "Lua 5.2" then
- prosody.log("warn", "%s has several issues and support is being phased out, consider upgrading", _VERSION);
+ prosody.log("warn", "%s support is deprecated, upgrade as soon as possible", _VERSION);
end
local ssl = softreq"ssl";
if ssl then