[latex3-commits] [git/LaTeX3-latex3-l3build] master: Load variables only once (see #50) (f636f03)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Mar 6 19:38:53 CET 2018


Repository : https://github.com/latex3/l3build
On branch  : master
Link       : https://github.com/latex3/l3build/commit/f636f03506fe8c34d8353b068efb40879606ae5e

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

commit f636f03506fe8c34d8353b068efb40879606ae5e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Mar 6 07:25:30 2018 +0000

    Load variables only once (see #50)
    
    This should allow both forms of usage, for the present,
    but without having to reload files.


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

f636f03506fe8c34d8353b068efb40879606ae5e
 l3build.lua |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/l3build.lua b/l3build.lua
index 054043d..4918e7e 100644
--- a/l3build.lua
+++ b/l3build.lua
@@ -41,6 +41,7 @@ local tonumber         = tonumber
 local exit             = os.exit
 
 -- l3build setup and functions
+-- Note that global (config) variables are done a little later
 
 kpse.set_program_name("kpsewhich")
 build_kpse_path = string.match(lookup("l3build.lua"),"(.*[/])")
@@ -48,7 +49,6 @@ local function build_require(s)
   require(lookup("l3build-"..s..".lua", { path = build_kpse_path } ) )
 end
 
-build_require("variables")
 build_require("arguments")
 build_require("file-functions")
 build_require("typesetting")
@@ -78,15 +78,16 @@ if match(arg[0], "l3build(%.lua)$") then
   elseif fileexists("build.lua") then
     -- Force these to be undefined: needed for the reloading step
     dofile("build.lua")
-    -- Reload the variables to set things up correctly
-    -- Has to be dofile() as require() doesn't reload
-    dofile(lookup("l3build-variables.lua", { path = build_kpse_path } ))
   else
     print("Error: Cannot find configuration build.lua")
     exit(1)
   end
 end
 
+-- Load standard settings for variables:
+-- comes after any user versions
+build_require("variables")
+
 -- Tidy up the epoch setting
 -- Force an epoch if set at the command line
 -- Must be done after loading variables, etc.





More information about the latex3-commits mailing list