summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-11 14:31:26 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-11 14:31:26 +0200
commit11cc58366d0e7ae42e6779e26ad460b1ac182dc5 (patch)
tree94a46f2c3dfb6c7d88bea21a8673175f08b553ea
parent74502160056d9c1df64f653bf2364efbb2e7a56b (diff)
downloadlualibs-11cc58366d0e7ae42e6779e26ad460b1ac182dc5.tar.gz
add opt-out for merged packages
-rw-r--r--lualibs-basic.lua39
-rw-r--r--lualibs.lua42
2 files changed, 31 insertions, 50 deletions
diff --git a/lualibs-basic.lua b/lualibs-basic.lua
index d12eb93..7957d90 100644
--- a/lualibs-basic.lua
+++ b/lualibs-basic.lua
@@ -1,31 +1,20 @@
---
--- This is file `lualibs.lua',
--- generated with the docstrip utility.
---
--- The original source files were:
---
--- lualibs.dtx (with options: `lua')
--- This is a generated file.
---
--- Copyright (C) 2009 by PRAGMA ADE / ConTeXt Development Team
---
--- See ConTeXt's mreadme.pdf for the license.
---
--- This work consists of the main source file lualibs.dtx
--- and the derived file lualibs.lua.
---
+-- This is file `lualibs-basic.lua',
module('lualibs-basic', package.seeall)
-local lualibs_module = {
- name = "lualibs-basic",
- version = 1.01,
- date = "2013/04/10",
- description = "Basic Lua extensions, meta package.",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "See ConTeXt's mreadme.pdf for the license",
+local lualibs_basic_module = {
+ name = "lualibs-basic",
+ version = 1.01,
+ date = "2013/04/10",
+ description = "Basic Lua extensions, meta package.",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "See ConTeXt's mreadme.pdf for the license",
}
+if luatexbase and luatexbase.provides_module then
+ local _,_,_ = luatexbase.provides_module(lualibs_module)
+end
+
local loadmodule = lualibs.loadmodule
loadmodule("lualibs-lua.lua")
@@ -50,5 +39,5 @@ loadmodule("lualibs-set.lua")
--l-xml.lua
-
+-- vim:tw=71:sw=2:ts=2:expandtab
-- End of File `lualibs.lua'.
diff --git a/lualibs.lua b/lualibs.lua
index 79e17fd..a38f974 100644
--- a/lualibs.lua
+++ b/lualibs.lua
@@ -1,31 +1,18 @@
---
-- This is file `lualibs.lua',
--- generated with the docstrip utility.
---
--- The original source files were:
---
--- lualibs.dtx (with options: `lua')
--- This is a generated file.
---
--- Copyright (C) 2009 by PRAGMA ADE / ConTeXt Development Team
---
--- See ConTeXt's mreadme.pdf for the license.
---
--- This work consists of the main source file lualibs.dtx
--- and the derived file lualibs.lua.
---
module('lualibs', package.seeall)
local lualibs_module = {
- name = "lualibs",
- version = 1.01,
- date = "2013/04/10",
- description = "Lua additional functions.",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "See ConTeXt's mreadme.pdf for the license",
+ name = "lualibs",
+ version = 1.01,
+ date = "2013/04/10",
+ description = "Lua additional functions.",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "See ConTeXt's mreadme.pdf for the license",
}
+local prefer_merged = true -- | false --- TODO should be set in some global config
+
local lpeg, kpse = lpeg, kpse
local dofile = dofile
@@ -68,8 +55,13 @@ local loadmerged = function (basename)
if not lpegmatch(p_hassuffix, basename) then -- force .lua suffix
basename = basename .. ".lua"
end
- local mergedname = lpegmatch(p_stripsuffix, basename) .. merged_suffix
- local res = loadmodule(mergedname, "merged package")
+ local res
+ if prefer_merged then
+ local mergedname = lpegmatch(p_stripsuffix, basename) .. merged_suffix
+ res = loadmodule(mergedname, "merged package")
+ else
+ info"Ignoring merged packages."
+ end
if not res then -- package not present, load individual libs
info(stringformat("Falling back to ā€œ%sā€.", basename))
res = loadmodule(basename, "metapackage")
@@ -87,4 +79,4 @@ loadmerged"extended.lua"
io.write"\n"
--
-- vim:tw=71:sw=2:ts=2:expandtab
--- End of File `lualibs.lua'.
+-- End of File `lualibs-basic.lua'.