summaryrefslogtreecommitdiff
path: root/luatexbase-loader.dtx
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2013-04-07 19:28:51 +0200
committerElie Roux <elie.roux@telecom-bretagne.eu>2013-04-07 19:28:51 +0200
commitc554ada26ffc925e520a5fb026272065a3671ff7 (patch)
tree05556087c5d91a2988e775027891f86db11ab185 /luatexbase-loader.dtx
parent520f6b3ccb737a949ac73dcd1d8c152a044db0ba (diff)
downloadluatexbase-c554ada26ffc925e520a5fb026272065a3671ff7.tar.gz
Fixing package loading for LuaTeX > 0.74
Starting from LuaTeX 0.74, Lua 5.2 is used, and packages.loaders is renamed into packages.searchers, which makes luatexbase and thus almost all LuaLaTeX packages broken. This commit fixes it, keeping backward compatibility.
Diffstat (limited to 'luatexbase-loader.dtx')
-rw-r--r--luatexbase-loader.dtx16
1 files changed, 13 insertions, 3 deletions
diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx
index 3bf1b47..92e97b2 100644
--- a/luatexbase-loader.dtx
+++ b/luatexbase-loader.dtx
@@ -374,10 +374,16 @@ end
% \end{macrocode}
%
% Combined searcher, using primarily the new kpse searcher, and the
-% original as a fall-back.
+% original as a fall-back. Starting from \luatex 0.75, Lua 5.2 is used. Among
+% the changes, |package.loaders| is renamed as |package.searchers|.
%
% \begin{macrocode}
-local package_loader_two = package.loaders[2]
+local package_loader_two
+if package.searchers then
+ package_loader_two = package.searchers[2]
+else
+ package_loader_two = package.loaders[2]
+end
local function load_module(mod)
local file = find_module_file(mod)
if not file then
@@ -403,7 +409,11 @@ end
% Finally install this combined loader as loader 2.
%
% \begin{macrocode}
-package.loaders[2] = load_module
+if package.searchers then
+ package.searchers[2] = load_module
+else
+ package.loaders[2] = load_module
+end
%</luamodule>
% \end{macrocode}
%