[latex3-commits] [git/LaTeX3-latex3-latex3] master: Complain if there's an error building the format (5c1156375)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Jan 14 19:27:31 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/5c11563759d39e283c48c9385cd7c935b8c2d695

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

commit 5c11563759d39e283c48c9385cd7c935b8c2d695
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu Jan 14 15:27:31 2021 -0300

    Complain if there's an error building the format


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

5c11563759d39e283c48c9385cd7c935b8c2d695
 build-config.lua | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/build-config.lua b/build-config.lua
index c74d059e7..241171709 100644
--- a/build-config.lua
+++ b/build-config.lua
@@ -108,7 +108,20 @@ local function fmt(engines,dest)
       .. os_pathsep .. texmfdir .. "//"
       .. os_concat .. cmd .. " -etex -ini -output-directory=" .. unpackdir
       .. " " .. src .. " > " .. os_null)
-    if errorlevel ~= 0 then return errorlevel end
+    if errorlevel ~= 0 then
+      -- Remove file extension: https://stackoverflow.com/a/34326069/6015190
+      local basename = src:match("(.+)%..+$")
+      local f = io.open(unpackdir .. "/" .. basename .. '.log',"r")
+      local content = f:read("*all")
+      io.close(f)
+      print("-------------------------------------------------------------------------------")
+      print(content)
+      print("-------------------------------------------------------------------------------")
+      print("Failed building LaTeX format for " .. engine)
+      print("  Look for errors in the transcript above")
+      print("-------------------------------------------------------------------------------")
+      return errorlevel
+    end
 
     local engname = string.match(src,"^[^.]*") .. ".fmt"
     local fmtname = string.gsub(engine,"tex$","") .. "latex.fmt"





More information about the latex3-commits mailing list.