# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1685128707 -7200
# Node ID 025c38ee885d39b7425bf19de6cde713bb355631
# Parent  191fe4866e3e9d5c3929cd559fb0026de340f6ea
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

diff -r 191fe4866e3e -r 025c38ee885d util/dependencies.lua
--- a/util/dependencies.lua	Fri May 26 20:45:10 2023 +0200
+++ b/util/dependencies.lua	Fri May 26 21:18:27 2023 +0200
@@ -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 @@
 	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."));