summaryrefslogtreecommitdiff
path: root/lualibs.lua
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 /lualibs.lua
parent74502160056d9c1df64f653bf2364efbb2e7a56b (diff)
downloadlualibs-11cc58366d0e7ae42e6779e26ad460b1ac182dc5.tar.gz
add opt-out for merged packages
Diffstat (limited to 'lualibs.lua')
-rw-r--r--lualibs.lua42
1 files changed, 17 insertions, 25 deletions
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'.