[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Better handling of non-writable cache directory (ff56872)

Marcel Fabian Krüger tex at 2krueger.de
Fri Aug 21 14:19:57 CEST 2020


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

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

commit ff56872dba73d7ae5a6827c4c98468ad64efb84f
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Thu Aug 20 14:55:28 2020 +0200

    Better handling of non-writable cache directory


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

ff56872dba73d7ae5a6827c4c98468ad64efb84f
 src/luaotfload-init.lua | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua
index 1cc5823..1c86abd 100644
--- a/src/luaotfload-init.lua
+++ b/src/luaotfload-init.lua
@@ -292,7 +292,21 @@ local function init_main(early_hook)
   local load_fontloader_module = luaotfload.loaders.fontloader
   local ignore_module          = luaotfload.loaders.ignore
 
-  load_fontloader_module "basics-gen"
+  do
+    local saved_reporter = texio.reporter
+    local saved_exit = os.exit
+    local errmsg
+    function texio.reporter(msg, ...)
+      print(...)
+      errmsg = msg
+    end
+    function os.exit()
+      error(errmsg)
+    end
+    load_fontloader_module "basics-gen"
+    texio.reporter = saved_reporter
+    os.exit = saved_exit
+  end
 
   if early_hook then early_hook() end
 





More information about the latex3-commits mailing list.