From 09a2018e4011c00a7a3a33befc1d61dc8c4a3c6c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 26 May 2023 21:18:27 +0200 Subject: util.dependencies: Print tables itself to reduce number of imports Rationale: See diffstat When this module is imported, it ends up calling stty via term_width() in util.human.io.table(). When this happens outside of a terminal, the following message is sent to stdout: stty: 'standard input': Inappropriate ioctl for device Not importing this module avoids that. Furthermore three is value in this module having minimal dependencies as they might not be available when it does the checks. Ref a1fed82c44b9 --- util/dependencies.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'util') diff --git a/util/dependencies.lua b/util/dependencies.lua index 772ab130..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 "prosody.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.")); -- cgit v1.2.3