Comparison

core/moduleapi.lua @ 4707:d8fc9a1aabeb

moduleapi: module:depends(): Don't load shared modules onto the current host if the current host is '*'...
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Apr 2012 07:04:59 +0100
parent 4695:838ad61c6b2c
child 4708:0e324923ff95
comparison
equal deleted inserted replaced
4706:845393c76d17 4707:d8fc9a1aabeb
122 modulemanager.unload(self.host, self.name); 122 modulemanager.unload(self.host, self.name);
123 end 123 end
124 end); 124 end);
125 end 125 end
126 local mod = modulemanager.get_module(self.host, name) or modulemanager.get_module("*", name); 126 local mod = modulemanager.get_module(self.host, name) or modulemanager.get_module("*", name);
127 if mod and mod.module.host == "*" and modulemanager.module_has_method(mod, "add_host") then 127 if mod and mod.module.host == "*" and self.host ~= "*"
128 and modulemanager.module_has_method(mod, "add_host") then
128 mod = nil; -- This is a shared module, so we still want to load it on our host 129 mod = nil; -- This is a shared module, so we still want to load it on our host
129 end 130 end
130 if not mod then 131 if not mod then
131 local err; 132 local err;
132 mod, err = modulemanager.load(self.host, name); 133 mod, err = modulemanager.load(self.host, name);