From 33ffda321d20938d4a28b15716d4f85871b4e6a7 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 23 Apr 2012 14:15:07 +0100 Subject: moduleapi: module:depends(): Load shared modules onto the current host even if they are loaded globally already --- core/moduleapi.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core') diff --git a/core/moduleapi.lua b/core/moduleapi.lua index 2223f4d0..e680f615 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -120,6 +120,9 @@ function api:depends(name) end); end local mod = modulemanager.get_module(self.host, name) or modulemanager.get_module("*", name); + if mod and mod.module.host == "*" and modulemanager.module_has_method(mod, "add_host") then + mod = nil; -- This is a shared module, so we still want to load it on our host + end if not mod then local err; mod, err = modulemanager.load(self.host, name); -- cgit v1.2.3