[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Mostly suppress logging of submodules (7e53652)

Marcel Fabian Krüger tex at 2krueger.de
Sun Sep 6 00:05:54 CEST 2020


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/7e53652e55c76af2402a9b24e41a1beb5778609c

>---------------------------------------------------------------

commit 7e53652e55c76af2402a9b24e41a1beb5778609c
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sun Sep 6 00:05:54 2020 +0200

    Mostly suppress logging of submodules


>---------------------------------------------------------------

7e53652e55c76af2402a9b24e41a1beb5778609c
 src/luaotfload.lua | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/luaotfload.lua b/src/luaotfload.lua
index df4de47..9289544 100644
--- a/src/luaotfload.lua
+++ b/src/luaotfload.lua
@@ -33,11 +33,27 @@ if luatexbase and luatexbase.provides_module then
 end  
 
 if luaotfload_module == nil then
+    local print_warning = luatexbase and luatexbase.module_warning or function(module, text)
+        return texio.write_nl("%s WARNING: %s", module, text)
+    end
     local saved_version = ProvidesLuaModule.version
     function luaotfload_module(module)
-        if luatexbase and luatexbase.provides_module then
-            luatexbase.provides_module (module)
-        end  
+        local module_version = module.version
+        if module_version ~= saved_version then
+            local filenames
+            if debug then
+                filenames = string.format("luaotfload.lua is found at %q\n%s.lua is found at %q\n",
+                    debug.getinfo(1, "S").source:sub(2),
+                    module.name,
+                    debug.getinfo(2, "S").source:sub(2))
+            else
+                filenames = ""
+            end
+            print_warning("luaotfload", string.format("Version inconsistency detected.\n\z
+                    luaotfload is loaded in version %s, while %q is loaded \z
+                    in version %s.\n%sI will try to continue anyway.\nHIC SUNT DRACONES",
+                    saved_version, module.name, module_version, filenames))
+       end
     end
 else
     error[[luaotfload is reloading itself nested. This can't happen.]]





More information about the latex3-commits mailing list.