@@ -37,23 +37,28 @@ if luaotfload_module == nil then
37
37
return texio .write_nl (" %s WARNING: %s" , module , text )
38
38
end
39
39
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.\n HIC 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.\n HIC SUNT DRACONES" ,
59
+ saved_version , module .name , module_version , filenames ))
60
+ end
61
+ end
57
62
end
58
63
else
59
64
error [[ luaotfload is reloading itself nested. This can't happen.]]
0 commit comments