Diff

core/moduleapi.lua @ 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
parent 4661:76db5d0a2104
child 4666:fb522fbd495e
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);