Software /
code /
prosody
Changeset
12589:39ae08180c81
compat: Remove handling of Lua 5.1 location of 'unpack' function
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 11 Jul 2022 19:07:38 +0200 |
parents | 12588:b15d3cf98ba6 |
children | 12590:5eaf77114fdb |
files | core/moduleapi.lua net/resolvers/manual.lua plugins/mod_admin_shell.lua plugins/mod_pep_simple.lua plugins/mod_pubsub/pubsub.lib.lua plugins/mod_storage_sql.lua plugins/mod_storage_xep0227.lua prosodyctl spec/core_storagemanager_spec.lua tools/modtrace.lua util/format.lua util/human/units.lua util/import.lua util/iterators.lua util/multitable.lua util/openmetrics.lua util/promise.lua |
diffstat | 17 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/core/moduleapi.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/core/moduleapi.lua Mon Jul 11 19:07:38 2022 +0200 @@ -27,7 +27,7 @@ local tonumber, tostring = tonumber, tostring; local require = require; local pack = table.pack or require "util.table".pack; -- table.pack is only in 5.2 -local unpack = table.unpack or unpack; --luacheck: ignore 113 -- renamed in 5.2 +local unpack = table.unpack; local prosody = prosody; local hosts = prosody.hosts;
--- a/net/resolvers/manual.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/net/resolvers/manual.lua Mon Jul 11 19:07:38 2022 +0200 @@ -1,6 +1,6 @@ local methods = {}; local resolver_mt = { __index = methods }; -local unpack = table.unpack or unpack; -- luacheck: ignore 113 +local unpack = table.unpack; -- Find the next target to connect to, and -- pass it to cb()
--- a/plugins/mod_admin_shell.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/plugins/mod_admin_shell.lua Mon Jul 11 19:07:38 2022 +0200 @@ -22,7 +22,7 @@ local prosody = _G.prosody; -local unpack = table.unpack or unpack; -- luacheck: ignore 113 +local unpack = table.unpack; local iterators = require "util.iterators"; local keys, values = iterators.keys, iterators.values; local jid_bare, jid_split, jid_join = import("util.jid", "bare", "prepped_split", "join");
--- a/plugins/mod_pep_simple.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/plugins/mod_pep_simple.lua Mon Jul 11 19:07:38 2022 +0200 @@ -14,7 +14,7 @@ local pairs = pairs; local next = next; local type = type; -local unpack = table.unpack or unpack; -- luacheck: ignore 113 +local unpack = table.unpack; local calculate_hash = require "util.caps".calculate_hash; local core_post_stanza = prosody.core_post_stanza; local bare_sessions = prosody.bare_sessions;
--- a/plugins/mod_pubsub/pubsub.lib.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Mon Jul 11 19:07:38 2022 +0200 @@ -1,4 +1,4 @@ -local t_unpack = table.unpack or unpack; -- luacheck: ignore 113 +local t_unpack = table.unpack; local time_now = os.time; local jid_prep = require "util.jid".prep;
--- a/plugins/mod_storage_sql.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/plugins/mod_storage_sql.lua Mon Jul 11 19:07:38 2022 +0200 @@ -13,7 +13,7 @@ local t_concat = table.concat; local noop = function() end -local unpack = table.unpack or unpack; -- luacheck: ignore 113 +local unpack = table.unpack; local function iterator(result) return function(result_) local row = result_();
--- a/plugins/mod_storage_xep0227.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/plugins/mod_storage_xep0227.lua Mon Jul 11 19:07:38 2022 +0200 @@ -2,7 +2,7 @@ local ipairs, pairs = ipairs, pairs; local setmetatable = setmetatable; local tostring = tostring; -local next, unpack = next, table.unpack or unpack; --luacheck: ignore 113/unpack +local next, unpack = next, table.unpack; local os_remove = os.remove; local io_open = io.open; local jid_bare = require "util.jid".bare;
--- a/prosodyctl Mon Jul 11 17:32:13 2022 +0200 +++ b/prosodyctl Mon Jul 11 19:07:38 2022 +0200 @@ -580,7 +580,7 @@ end -- ejabberdctl compatibility -local unpack = table.unpack or unpack; -- luacheck: ignore 113 +local unpack = table.unpack; function commands.register(arg) local user, host, password = unpack(arg);
--- a/spec/core_storagemanager_spec.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/spec/core_storagemanager_spec.lua Mon Jul 11 19:07:38 2022 +0200 @@ -1,4 +1,4 @@ -local unpack = table.unpack or unpack; -- luacheck: ignore 113 +local unpack = table.unpack; local server = require "net.server_select"; package.loaded["net.server"] = server;
--- a/tools/modtrace.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/tools/modtrace.lua Mon Jul 11 19:07:38 2022 +0200 @@ -10,7 +10,7 @@ local t_pack = require "util.table".pack; local serialize = require "util.serialization".serialize; -local unpack = table.unpack or unpack; --luacheck: ignore 113 +local unpack = table.unpack; local set = require "util.set"; local serialize_cfg = {
--- a/util/format.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/util/format.lua Mon Jul 11 19:07:38 2022 +0200 @@ -6,7 +6,7 @@ -- Provides some protection from e.g. CAPEC-135, CWE-117, CWE-134, CWE-93 local tostring = tostring; -local unpack = table.unpack or unpack; -- luacheck: ignore 113/unpack +local unpack = table.unpack; local pack = require "util.table".pack; -- TODO table.pack in 5.2+ local valid_utf8 = require "util.encodings".utf8.valid; local type = type;
--- a/util/human/units.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/util/human/units.lua Mon Jul 11 19:07:38 2022 +0200 @@ -4,7 +4,7 @@ local math_log = math.log; local math_max = math.max; local math_min = math.min; -local unpack = table.unpack or unpack; --luacheck: ignore 113 +local unpack = table.unpack; local large = { "k", 1000,
--- a/util/import.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/util/import.lua Mon Jul 11 19:07:38 2022 +0200 @@ -8,7 +8,7 @@ -local unpack = table.unpack or unpack; --luacheck: ignore 113 +local unpack = table.unpack; local t_insert = table.insert; function _G.import(module, ...) local m = package.loaded[module] or require(module);
--- a/util/iterators.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/util/iterators.lua Mon Jul 11 19:07:38 2022 +0200 @@ -12,7 +12,7 @@ local t_insert = table.insert; local next = next; -local unpack = table.unpack or unpack; --luacheck: ignore 113 +local unpack = table.unpack; local pack = table.pack or require "util.table".pack; local type = type; local table, setmetatable = table, setmetatable;
--- a/util/multitable.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/util/multitable.lua Mon Jul 11 19:07:38 2022 +0200 @@ -9,7 +9,7 @@ local select = select; local t_insert = table.insert; local pairs, next, type = pairs, next, type; -local unpack = table.unpack or unpack; --luacheck: ignore 113 +local unpack = table.unpack; local _ENV = nil; -- luacheck: std none
--- a/util/openmetrics.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/util/openmetrics.lua Mon Jul 11 19:07:38 2022 +0200 @@ -26,7 +26,7 @@ local new_multitable = require "util.multitable".new; local iter_multitable = require "util.multitable".iter; local t_concat, t_insert = table.concat, table.insert; -local t_pack, t_unpack = require "util.table".pack, table.unpack or unpack; --luacheck: ignore 113/unpack +local t_pack, t_unpack = require "util.table".pack, table.unpack; -- BEGIN of Utility: "metric proxy" -- This allows to wrap a MetricFamily in a proxy which only provides the
--- a/util/promise.lua Mon Jul 11 17:32:13 2022 +0200 +++ b/util/promise.lua Mon Jul 11 19:07:38 2022 +0200 @@ -2,7 +2,7 @@ local promise_mt = { __name = "promise", __index = promise_methods }; local xpcall = require "util.xpcall".xpcall; -local unpack = table.unpack or unpack; --luacheck: ignore 113 +local unpack = table.unpack; function promise_mt:__tostring() return "promise (" .. (self._state or "invalid") .. ")";