diff options
Diffstat (limited to 'lualibs-basic.lua')
-rw-r--r-- | lualibs-basic.lua | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/lualibs-basic.lua b/lualibs-basic.lua index 63a7cd0..4a17bdc 100644 --- a/lualibs-basic.lua +++ b/lualibs-basic.lua @@ -11,33 +11,46 @@ local lualibs_basic_module = { license = "See ConTeXt's mreadme.pdf for the license", } +local find_file, error, warn, info if luatexbase and luatexbase.provides_module then - local _,_,_ = luatexbase.provides_module(lualibs_basic_module) + error, warn, info = luatexbase.provides_module(lualibs_basic_module) +else + error, warn, info = texio.write_nl, texio.write_nl, texio.write_nl -- stub end -local loadmodule = lualibs.loadmodule +local loadmodule = lualibs.loadmodule +local stringformat = string.format -loadmodule("lualibs-lua.lua") -loadmodule("lualibs-lpeg.lua") -loadmodule("lualibs-function.lua") -loadmodule("lualibs-string.lua") -loadmodule("lualibs-table.lua") -loadmodule("lualibs-boolean.lua") -loadmodule("lualibs-number.lua") -loadmodule("lualibs-math.lua") -loadmodule("lualibs-io.lua") -loadmodule("lualibs-os.lua") -loadmodule("lualibs-file.lua") -loadmodule("lualibs-md5.lua") -loadmodule("lualibs-dir.lua") -loadmodule("lualibs-unicode.lua") -loadmodule("lualibs-url.lua") -loadmodule("lualibs-set.lua") +local res +if lualibs.prefer_merged then + res = loadmodule('lualibs-basic-merged.lua') +else + info"Ignoring merged packages." +end + +if not res then + info(stringformat("Falling back to “%s”.", basename)) + loadmodule("lualibs-lua.lua") + loadmodule("lualibs-lpeg.lua") + loadmodule("lualibs-function.lua") + loadmodule("lualibs-string.lua") + loadmodule("lualibs-table.lua") + loadmodule("lualibs-boolean.lua") + loadmodule("lualibs-number.lua") + loadmodule("lualibs-math.lua") + loadmodule("lualibs-io.lua") + loadmodule("lualibs-os.lua") + loadmodule("lualibs-file.lua") + loadmodule("lualibs-md5.lua") + loadmodule("lualibs-dir.lua") + loadmodule("lualibs-unicode.lua") + loadmodule("lualibs-url.lua") + loadmodule("lualibs-set.lua") +end -- these don’t look much basic to me: --l-pdfview.lua --l-xml.lua - -- vim:tw=71:sw=2:ts=2:expandtab -- End of File `lualibs.lua'. |