summaryrefslogtreecommitdiff
path: root/luaotfload-tool.lua
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2013-05-12 01:48:25 -0700
committerElie Roux <elie.roux@telecom-bretagne.eu>2013-05-12 01:48:25 -0700
commitf3c5f3f498afae003d3981a2c1c67dd90ddc0375 (patch)
tree31ffb7c42a1f79562cb3272c4a29f3dfe86e6111 /luaotfload-tool.lua
parent3548b2bd61510b5688bcf8aaad64662edd92f860 (diff)
parentd8a8649ca9e2f25b028141e7d49e38a2840eb086 (diff)
downloadluaotfload-f3c5f3f498afae003d3981a2c1c67dd90ddc0375.tar.gz
Merge pull request #64 from phi-gamma/master
brute force compatibility with older Luatex
Diffstat (limited to 'luaotfload-tool.lua')
-rwxr-xr-xluaotfload-tool.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua
index 882a296..352697c 100755
--- a/luaotfload-tool.lua
+++ b/luaotfload-tool.lua
@@ -26,8 +26,23 @@ see the luaotfload documentation for more info. Report bugs to
--doc]]--
+--[[doc--
+
+ We test for Lua 5.1 by means of capability detection to see if
+ we’re running an outdated Luatex. If so, we hand over control to
+ the legacy db runner.
+
+ \url{http://lua-users.org/wiki/LuaVersionCompatibility}
+
+--doc]]--
+
kpse.set_program_name"luatex"
+if _G.getfenv then
+ local oldscript = kpse.find_file"luaotfload-legacy-tool.lua"
+ return require(oldscript)
+end
+
local stringformat = string.format
local texiowrite_nl = texio.write_nl
local stringlower = string.lower