Changeset

4663:24524d70a50a

moduleapi: module:depends(): Load shared modules onto the current host even if they are loaded globally already
author Matthew Wild <mwild1@gmail.com>
date Mon, 23 Apr 2012 14:15:07 +0100
parents 4662:105423f77d46
children 4664:7438b3c68576
files core/moduleapi.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/moduleapi.lua	Mon Apr 23 14:11:10 2012 +0100
+++ b/core/moduleapi.lua	Mon Apr 23 14:15:07 2012 +0100
@@ -120,6 +120,9 @@
 		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);