summaryrefslogtreecommitdiff
path: root/lualibs-basic.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-14 02:19:52 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-14 02:19:52 +0200
commit120ce3327618dea784a0482f1db6295b4168062c (patch)
tree0d6be55744f10da7361ad55d381cafc32a8eb2c9 /lualibs-basic.lua
parent419e509d1b2760c0f84bd825ed6a0cb107cee45f (diff)
downloadlualibs-120ce3327618dea784a0482f1db6295b4168062c.tar.gz
work around merging restrictions
Diffstat (limited to 'lualibs-basic.lua')
-rw-r--r--lualibs-basic.lua51
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'.