# HG changeset patch # User Kim Alvefur # Date 1678447982 -3600 # Node ID 918dfbb330fd495d85d0cc00d1c2facc952ef16b # Parent f9e474cb86acc91c3a1c04fe74c31bd35d2fdf41 mod_admin_shell: Limit module dependency listings to loaded on current host E.g. module:info("http") with many http modules loaded would show a lot of duplication, as each module would be listed for each host, even if not actually enabled on that host. diff -r f9e474cb86ac -r 918dfbb330fd plugins/mod_admin_shell.lua --- a/plugins/mod_admin_shell.lua Fri Mar 10 10:55:50 2023 +0100 +++ b/plugins/mod_admin_shell.lua Fri Mar 10 12:33:02 2023 +0100 @@ -572,13 +572,20 @@ if mod.module.dependencies and next(mod.module.dependencies) ~= nil then print(" dependencies:"); for dep in pairs(mod.module.dependencies) do - print(" - mod_" .. dep); + -- Dependencies are per module instance, not per host, so dependencies + -- of/on global modules may list modules not actually loaded on the + -- current host. + if modulemanager.is_loaded(host, dep) then + print(" - mod_" .. dep); + end end end if mod.module.reverse_dependencies and next(mod.module.reverse_dependencies) ~= nil then print(" reverse dependencies:"); for dep in pairs(mod.module.reverse_dependencies) do - print(" - mod_" .. dep); + if modulemanager.is_loaded(host, dep) then + print(" - mod_" .. dep); + end end end end