diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
commit | 974640d66e61e81cb197ad96fdff7b08343e4c5a (patch) | |
tree | 2e1f75f32f312b7f24ba82b4590ae230bcd6f399 /Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua | |
parent | b4fa72e61230aca75f7f6fbf988821f71edfb6b2 (diff) |
context
git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua index 2bac3201d28..5b8390df2a1 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua @@ -13,10 +13,10 @@ if not modules then modules = { } end modules ['libs-ini'] = { -- is doing. local type, unpack = type, unpack +local find = string.find -- here we implement the resolver -local type = type local nameonly = file.nameonly local joinfile = file.join @@ -30,8 +30,10 @@ local expandpaths = resolvers.expandedpathlistfromvariable local report = logs.reporter("resolvers","libraries") local trace = false +local silent = false -trackers.register("resolvers.lib", function(v) trace = v end) +trackers.register("resolvers.lib", function(v) trace = v end) +trackers.register("resolvers.lib.silent", function(v) silent = v end) local function findlib(required) -- todo: cache local suffix = os.libsuffix or "so" @@ -143,10 +145,10 @@ function libraries.optionalloaded(name,libnames) end end local initialized = thelib_initialize(unpack(libnames)) - if initialized then - report("using library '% + t'",libnames) - else + if not initialized then report("unable to initialize library '% + t'",libnames) + elseif not silent then + report("using library '% + t'",libnames) end return initialized end @@ -154,6 +156,9 @@ function libraries.optionalloaded(name,libnames) end end +-- For the moment the next blob is needed when we run \MTXRUN\ on top of \LUATEX\ and +-- \LUAJITTEX\ but at some point we will {\em always} assume \LUAMETATEX\ as runner. + if FFISUPPORTED and ffi and ffi.load then local ffiload = ffi.load @@ -194,3 +199,19 @@ end -- } -- end -- } + +local dofile = dofile +local savedrequire = require + +function require(name,version) + if find(name,"%.lua$") or find(name,"%.lmt$") then + local m = dofile(findfile(name)) + if m then + package.loaded[name] = m + return m + end + else + return savedrequire(name) + end +end + |