Software /
code /
prosody
Changeset
12436:9014d5011741
Merge 0.12->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 27 Mar 2022 18:45:19 +0200 |
parents | 12434:cf922f34e264 (current diff) 12435:1ee72c0013f3 (diff) |
children | 12439:f0064191f885 |
files | |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/prosodyctl Thu Mar 24 22:30:14 2022 +0000 +++ b/prosodyctl Sun Mar 27 18:45:19 2022 +0200 @@ -484,6 +484,7 @@ local library_versions = {}; dependencies.softreq"ssl"; dependencies.softreq"DBI"; + dependencies.softreq"readline"; local friendly_names = { DBI = "LuaDBI"; lfs = "LuaFileSystem"; @@ -492,17 +493,22 @@ socket = "LuaSocket"; ssl = "LuaSec"; }; + local alternate_version_fields = { + -- These diverge from the module._VERSION convention + readline = "Version"; + } local lunbound = dependencies.softreq"lunbound"; local lxp = dependencies.softreq"lxp"; local hashes = dependencies.softreq"util.hashes"; for name, module in pairs(package.loaded) do - if type(module) == "table" and rawget(module, "_VERSION") + local version_field = alternate_version_fields[name] or "_VERSION"; + if type(module) == "table" and rawget(module, version_field) and name ~= "_G" and not name:match("%.") then name = friendly_names[name] or name; if #name > longest_name then longest_name = #name; end - local mod_version = module._VERSION; + local mod_version = module[version_field]; if tostring(mod_version):sub(1, #name+1) == name .. " " then mod_version = mod_version:sub(#name+2); end