diff options
author | Mojca Miklavec <mojca.miklavec@gmail.com> | 2014-05-05 20:29:55 +0000 |
---|---|---|
committer | Mojca Miklavec <mojca.miklavec@gmail.com> | 2014-05-05 20:29:55 +0000 |
commit | ba9a57343987f1c2c72396e7c38f1fa30352c24c (patch) | |
tree | 66a8b12cdf67427ce96770fd0e9e581759aade1c /Master/texmf-dist/tex/context/base/util-lib.lua | |
parent | 15242121b8ddf7d4a041fb3998d295dd8232e1eb (diff) |
ConTeXt 2014.04.28 23:24
git-svn-id: svn://tug.org/texlive/trunk@33856 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/util-lib.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/util-lib.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/context/base/util-lib.lua b/Master/texmf-dist/tex/context/base/util-lib.lua index c5c99911363..2601b2e5781 100644 --- a/Master/texmf-dist/tex/context/base/util-lib.lua +++ b/Master/texmf-dist/tex/context/base/util-lib.lua @@ -93,6 +93,9 @@ local function requireswiglib(required,version) local trace_swiglib = trace_swiglib or package.helpers.trace local library = loaded[required] if library == nil then + if trace_swiglib then + report_swiglib("requiring library %a with version %a",required,version or "any") + end -- initialize a few variables local required_full = gsub(required,"%.","/") -- package.helpers.lualibfile local required_path = pathpart(required_full) @@ -209,7 +212,7 @@ local function requireswiglib(required,version) if libtype == "function" then library = library() else - report_swiglib("load error: %a returns %a, message %a",opener,libtype,message or "no message") + report_swiglib("load error: %a returns %a, message %a, library %a",opener,libtype,(string.gsub(message or "no message","[%s]+$","")),found_library or "no library") library = false end dir.pop() @@ -252,7 +255,8 @@ recommended loader. ]]-- -local swiglibs = { } +local swiglibs = { } +local initializer = "core" function swiglib(name,version) local library = swiglibs[name] @@ -261,7 +265,12 @@ function swiglib(name,version) if trace_swiglib then report_swiglib("loading %a",name) end - library = requireswiglib("swiglib." .. name,version) + if not find(name,"%." .. initializer .. "$") then + fullname = "swiglib." .. name .. "." .. initializer + else + fullname = "swiglib." .. name + end + library = requireswiglib(fullname,version) swiglibs[name] = library statistics.stoptiming(swiglibs) end |