From 4bfa9bd8a45f244272910772b147d7caa50b4bc1 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 5 Jul 2013 11:17:04 +0200 Subject: bring back Lua 5.1 parser compat in luaotfload-tool --- luaotfload-tool.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index a353b37..83fb3e0 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -39,7 +39,7 @@ see the luaotfload documentation for more info. Report bugs to kpse.set_program_name"luatex" if _G.getfenv then - local oldscript = kpse.find_file"luaotfload-legacy-tool.lua" + local oldscript = kpse.find_file "luaotfload-legacy-tool.lua" return require(oldscript) end @@ -136,8 +136,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,8 +234,8 @@ 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 ( ) -- cgit v1.2.3 From 566c10a7197c4977cc698ed230ac2ac09260f329 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 5 Jul 2013 11:32:49 +0200 Subject: add detection for luajittex interpreter --- luaotfload-tool.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 83fb3e0..4d3b411 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 -- cgit v1.2.3 From 68c63252eb0da3d1d67bf7534032d020edfc70ef Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 5 Jul 2013 11:39:36 +0200 Subject: include interpreter facts in -V info --- luaotfload-tool.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 4d3b411..4d25d53 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -248,8 +248,14 @@ 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 -- cgit v1.2.3