summaryrefslogtreecommitdiff
path: root/luaotfload-tool.lua
diff options
context:
space:
mode:
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