summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-09-28 12:09:13 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-09-28 12:09:17 +0200
commitb1e9655b7fe9d827c051b977ce31a4a4da5aec6d (patch)
tree71de38a0256b04a07a484b403e428e8b61dd4a94
parent7ca84d412dde2a7a67cca513ba668687e3e34260 (diff)
downloadluaotfload-b1e9655b7fe9d827c051b977ce31a4a4da5aec6d.tar.gz
[main,tool] fix version check
Fixes #382 Luaotfload will fail with an up to date Luatex on account on a buggy minimum version check. Many thanks to @davidcarlisle for the report.
-rw-r--r--src/luaotfload-main.lua12
-rwxr-xr-xsrc/luaotfload-tool.lua9
2 files changed, 12 insertions, 9 deletions
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index 271e4cc..83ce5e7 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------
-- FILE: luaotfload-main.lua
-- DESCRIPTION: Luaotfload entry point
--- REQUIREMENTS: luatex v.0.95 or later; packages lualibs
+-- REQUIREMENTS: luatex v.0.95.0 or later; package lualibs
-- AUTHOR: √Člie Roux, Khaled Hosny, Philipp Gesang
-----------------------------------------------------------------------
--
@@ -11,9 +11,9 @@ config = config or { }
luaotfload = luaotfload or { }
local luaotfload = luaotfload
luaotfload.log = luaotfload.log or { }
-luaotfload.version = "2.7"
+luaotfload.version = "2.8"
luaotfload.loaders = { }
-luaotfload.min_luatex_version = { 0, 95, 0 } --- i. e. 0.95.0
+luaotfload.min_luatex_version = { 0, 95, 0 }
luaotfload.fontloader_package = "reference" --- default: from current Context
if not tex or not tex.luatexversion then
@@ -25,8 +25,10 @@ else
local revision = tex.luatexrevision --[[ : string ]]
local revno = tonumber (revision)
local minimum = luaotfload.min_luatex_version
- if major < minimum [1] or minor < minimum [2]
- or revno and revno < minimum [3]
+ local actual = { major, minor, revno or 0 }
+ if actual [1] < minimum [1]
+ or actual == minimum and actual [2] < minimum [2]
+ or actual == minimum and actual [2] == minimum [2] and actual [3] < minimum [3]
then
texio.write_nl ("term and log",
string.format ("\tFATAL ERROR\n\z
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index fee5980..45d5e63 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -2,7 +2,7 @@
-----------------------------------------------------------------------
-- FILE: luaotfload-tool.lua
-- DESCRIPTION: database functionality
--- REQUIREMENTS: luaotfload 2.7
+-- REQUIREMENTS: luaotfload 2.8
-- AUTHOR: Khaled Hosny, √Člie Roux, Philipp Gesang
-- LICENSE: GPL v2.0
-----------------------------------------------------------------------
@@ -10,7 +10,7 @@
luaotfload = luaotfload or { }
local version = "2.8"
luaotfload.version = version
-luaotfload.min_luatex_version = { 0, 95, 0 } --- i. e. 0.95.0
+luaotfload.min_luatex_version = { 0, 95, 0 }
luaotfload.self = "luaotfload-tool"
--[[doc--
@@ -64,8 +64,9 @@ do
actual = { major, minor, revno or 0 }
end
- if actual [1] < minimum [1] or actual [2] < minimum [2]
- or actual [3] < minimum [3]
+ if actual [1] < minimum [1]
+ or actual == minimum and actual [2] < minimum [2]
+ or actual == minimum and actual [2] == minimum [2] and actual [3] < minimum [3]
then
texio.write_nl ("term and log",
string.format ("\tFATAL ERROR\n\z