# HG changeset patch # User Kim Alvefur # Date 1410958129 -7200 # Node ID 010b141e91ed9d411e692f321cc3e56d1cf9e5c1 # Parent 31c15004bfb07b3cdf08bd77b038a49e8417bbc2 core.modulemanager, core.moduleapi: Hack around dependency loop diff -r 31c15004bfb0 -r 010b141e91ed core/moduleapi.lua --- a/core/moduleapi.lua Wed Sep 17 14:47:52 2014 +0200 +++ b/core/moduleapi.lua Wed Sep 17 14:48:49 2014 +0200 @@ -7,7 +7,7 @@ -- local config = require "core.configmanager"; -local modulemanager = require "modulemanager"; -- This is necessary to avoid require loops +local modulemanager; -- This gets set from modulemanager local array = require "util.array"; local set = require "util.set"; local logger = require "util.logger"; @@ -370,4 +370,7 @@ return require"core.storagemanager".open(self.host, name or self.name, type); end -return api; +return function (mm) + modulemanager = mm; + return api; +end diff -r 31c15004bfb0 -r 010b141e91ed core/modulemanager.lua --- a/core/modulemanager.lua Wed Sep 17 14:47:52 2014 +0200 +++ b/core/modulemanager.lua Wed Sep 17 14:48:49 2014 +0200 @@ -37,7 +37,7 @@ module "modulemanager" -local api = _G.require "core.moduleapi"; -- Module API container +local api = _G.require "core.moduleapi"(_M); -- Module API container -- [host] = { [module] = module_env } local modulemap = { ["*"] = {} };