[latex3-commits] [git/LaTeX3-latex3-l3build] main: Move creating localtexmf to a function (0b07c7c)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Dec 9 10:40:08 CET 2021


Repository : https://github.com/latex3/l3build
On branch  : main
Link       : https://github.com/latex3/l3build/commit/0b07c7c84024f1d96bd6646e06d654140622a40a

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

commit 0b07c7c84024f1d96bd6646e06d654140622a40a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Dec 8 10:44:10 2021 +0000

    Move creating localtexmf to a function
    
    This allows it to also cover tdsdirs.


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

0b07c7c84024f1d96bd6646e06d654140622a40a
 l3build-aux.lua         | 13 +++++++++++++
 l3build-check.lua       |  8 ++------
 l3build-typesetting.lua |  6 +-----
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/l3build-aux.lua b/l3build-aux.lua
index 42e7f6a..2f6902a 100644
--- a/l3build-aux.lua
+++ b/l3build-aux.lua
@@ -166,3 +166,16 @@ function dep_install(deps)
   end
   return 0
 end
+
+-- Construct a localtexmf including any tdsdirs
+-- Needed for checking and typesetting, hence global
+function localtexmf()
+  local paths = ""
+  for src,_ in pairs(tdsdirs) do
+    paths = paths .. os_pathsep .. abspath(src) .. "//"
+  end
+  if texmfdir and texmfdir ~= "" and direxists(texmfdir) then
+    paths = paths .. os_pathsep .. abspath(texmfdir) .. "//"
+  end
+  return paths
+end
diff --git a/l3build-check.lua b/l3build-check.lua
index 249b221..03ce635 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -764,19 +764,15 @@ function runtest(name, engine, hide, ext, test_type, breakout)
   -- Ensure there is no stray .log file
   rmfile(testdir,name .. logext)
   local errlevels = {}
-  local localtexmf = ""
-  if texmfdir and texmfdir ~= "" and direxists(texmfdir) then
-    localtexmf = os_pathsep .. abspath(texmfdir) .. "//"
-  end
   for i = 1, checkruns do
     errlevels[i] = run(
       testdir,
       -- No use of localdir here as the files get copied to testdir:
       -- avoids any paths in the logs
-      os_setenv .. " TEXINPUTS=." .. localtexmf
+      os_setenv .. " TEXINPUTS=." .. localtexmf()
         .. (checksearch and os_pathsep or "")
         .. os_concat ..
-      os_setenv .. " LUAINPUTS=." .. localtexmf
+      os_setenv .. " LUAINPUTS=." .. localtexmf()
         .. (checksearch and os_pathsep or "")
         .. os_concat ..
       -- Avoid spurious output from (u)pTeX
diff --git a/l3build-typesetting.lua b/l3build-typesetting.lua
index cc04ac1..c173b25 100644
--- a/l3build-typesetting.lua
+++ b/l3build-typesetting.lua
@@ -54,11 +54,7 @@ function runcmd(cmd,dir,vars)
   vars = vars or {}
   -- Allow for local texmf files
   local env = os_setenv .. " TEXMFCNF=." .. os_pathsep
-  local localtexmf = ""
-  if texmfdir and texmfdir ~= "" and direxists(texmfdir) then
-    localtexmf = os_pathsep .. abspath(texmfdir) .. "//"
-  end
-  local envpaths = "." .. localtexmf .. os_pathsep
+  local envpaths = "." .. localtexmf() .. os_pathsep
     .. abspath(localdir) .. os_pathsep
     .. dir .. (typesetsearch and os_pathsep or "")
   -- Deal with spaces in paths





More information about the latex3-commits mailing list.