diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-07-05 02:44:59 -0700 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-07-05 02:44:59 -0700 |
commit | 9bb68613ca57d6486906317f0b5f832ea4deceea (patch) | |
tree | 9e5dc95d6909c848083ddb367a77237974c188d7 | |
parent | 47138047e4b2f7500c627034f83c6343d61bf257 (diff) | |
parent | 68c63252eb0da3d1d67bf7534032d020edfc70ef (diff) | |
download | luaotfload-9bb68613ca57d6486906317f0b5f832ea4deceea.tar.gz |
Merge pull request #105 from phi-gamma/master
improve handling of interpreters other than stock Lua 5.2
-rwxr-xr-x | luaotfload-tool.lua | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index a353b37..4d25d53 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -36,11 +36,19 @@ see the luaotfload documentation for more info. Report bugs to --doc]]-- -kpse.set_program_name"luatex" +kpse.set_program_name "luatex" -if _G.getfenv then - local oldscript = kpse.find_file"luaotfload-legacy-tool.lua" - return require(oldscript) +local runtime +if _G.getfenv ~= nil then -- 5.1 or LJ + if _G.jit ~= nil then + runtime = { "jit", jit.version } + else + runtime = { "stock", _VERSION } + local oldscript = kpse.find_file "luaotfload-legacy-tool.lua" + return require (oldscript) + end +else -- 5.2 + runtime = { "stock", _VERSION } end local stringexplode = string.explode @@ -136,8 +144,8 @@ local names = fonts.names local sanitize_string = names.sanitize_string --local db_src_out = names.path.dir.."/"..names.path.basename -local names_plain = file.join - (caches.getwritablepath (config.luaotfload.names_dir), +local names_plain = file.join ( + caches.getwritablepath (config.luaotfload.names_dir), config.luaotfload.names_file) local names_bin = file.replacesuffix (names_plain, "luc") @@ -234,14 +242,20 @@ local help_msg = function ( ) config.luaotfload.self, names_plain, names_bin, - caches.getwritablepath - (config.luaotfload.cache_dir))) + caches.getwritablepath ( + config.luaotfload.cache_dir))) end local version_msg = function ( ) texiowrite_nl(stringformat( - "%s version %s, database version %s.\n", - config.luaotfload.self, version, names.version)) + "%s version “%s”\n" .. -- no \z due to 5.1 compatibility + "database version “%s”\n" .. + "Lua interpreter: %s; version “%s”\n", + config.luaotfload.self, + version, + names.version, + runtime[1], + runtime[2])) end |