Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
[main,tool] fix version check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phi-gamma committed Sep 28, 2016
1 parent 7ca84d4 commit b1e9655
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/luaotfload-main.lua
Original file line number Diff line number Diff line change
@@ -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
-----------------------------------------------------------------------
--
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions src/luaotfload-tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
-----------------------------------------------------------------------
-- 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
-----------------------------------------------------------------------

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--
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b1e9655

Please sign in to comment.