Skip to content

Commit 0f606d6

Browse files
committed
Allow restoring old submodule handling
Can be enabled with the environment variable LUAOTFLOAD_TRACE_SUBMODULES=1
1 parent 91a2a1e commit 0f606d6

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

src/luaotfload.lua

+22-17
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,28 @@ if luaotfload_module == nil then
3737
return texio.write_nl("%s WARNING: %s", module, text)
3838
end
3939
local saved_version = ProvidesLuaModule.version
40-
function luaotfload_module(module)
41-
local module_version = module.version
42-
if module_version ~= saved_version then
43-
local filenames
44-
if debug then
45-
filenames = string.format("luaotfload.lua is found at\n%q\n%s.lua is found at\n%q\n",
46-
debug.getinfo(1, "S").source:sub(2),
47-
module.name,
48-
debug.getinfo(2, "S").source:sub(2))
49-
else
50-
filenames = ""
51-
end
52-
print_warning("luaotfload", string.format("Version inconsistency detected.\n\z
53-
luaotfload is loaded in version %s, while %q is loaded \z
54-
in version %s.\n%sI will try to continue anyway.\nHIC SUNT DRACONES",
55-
saved_version, module.name, module_version, filenames))
56-
end
40+
local trace_submodules = tonumber(os.getenv'LUAOTFLOAD_TRACE_SUBMODULES')
41+
if luatexbase and luatexbase.provides_module and trace_submodules and trace_submodules ~= 0 then
42+
luaotfload_module = luatexbase.provides_module
43+
else
44+
function luaotfload_module(module)
45+
local module_version = module.version
46+
if module_version ~= saved_version then
47+
local filenames
48+
if debug then
49+
filenames = string.format("luaotfload.lua is found at\n%q\n%s.lua is found at\n%q\n",
50+
debug.getinfo(1, "S").source:sub(2),
51+
module.name,
52+
debug.getinfo(2, "S").source:sub(2))
53+
else
54+
filenames = ""
55+
end
56+
print_warning("luaotfload", string.format("Version inconsistency detected.\n\z
57+
luaotfload is loaded in version %s, while %q is loaded \z
58+
in version %s.\n%sI will try to continue anyway.\nHIC SUNT DRACONES",
59+
saved_version, module.name, module_version, filenames))
60+
end
61+
end
5762
end
5863
else
5964
error[[luaotfload is reloading itself nested. This can't happen.]]

0 commit comments

Comments
 (0)