From c54f51b46d82d7739231640fc5cea60593d1a5d4 Mon Sep 17 00:00:00 2001 From: Mojca Miklavec Date: Wed, 23 May 2012 23:07:14 +0000 Subject: ConTeXt 2012.05.23 23:31; should enable loading built-in TEXMFCNF git-svn-id: svn://tug.org/texlive/trunk@26606 c570f23f-e606-0410-a88d-b1316a301751 --- Master/bin/alpha-linux/mtxrun | 74 +++++++++++++++++---- Master/bin/amd64-freebsd/mtxrun | 74 +++++++++++++++++---- Master/bin/amd64-kfreebsd/mtxrun | 74 +++++++++++++++++---- Master/bin/armel-linux/mtxrun | 74 +++++++++++++++++---- Master/bin/i386-cygwin/mtxrun | 74 +++++++++++++++++---- Master/bin/i386-freebsd/mtxrun | 74 +++++++++++++++++---- Master/bin/i386-kfreebsd/mtxrun | 74 +++++++++++++++++---- Master/bin/i386-linux/mtxrun | 74 +++++++++++++++++---- Master/bin/i386-netbsd/mtxrun | 74 +++++++++++++++++---- Master/bin/i386-solaris/mtxrun | 74 +++++++++++++++++---- Master/bin/mips-irix/mtxrun | 74 +++++++++++++++++---- Master/bin/mipsel-linux/mtxrun | 74 +++++++++++++++++---- Master/bin/powerpc-aix/mtxrun | 74 +++++++++++++++++---- Master/bin/powerpc-linux/mtxrun | 74 +++++++++++++++++---- Master/bin/sparc-solaris/mtxrun | 74 +++++++++++++++++---- Master/bin/universal-darwin/mtxrun | 74 +++++++++++++++++---- Master/bin/win32/mtxrun.lua | 73 ++++++++++++++++---- Master/bin/x86_64-darwin/mtxrun | 74 +++++++++++++++++---- Master/bin/x86_64-linux/mtxrun | 74 +++++++++++++++++---- Master/bin/x86_64-solaris/mtxrun | 74 +++++++++++++++++---- Master/texmf-dist/scripts/context/lua/mtxrun.lua | 73 ++++++++++++++++---- .../scripts/context/stubs/mswin/mtxrun.lua | 73 ++++++++++++++++---- .../texmf-dist/scripts/context/stubs/unix/mtxrun | 73 ++++++++++++++++---- Master/texmf-dist/tex/context/base/cont-new.mkii | 2 +- Master/texmf-dist/tex/context/base/cont-new.mkiv | 2 +- .../tex/context/base/context-version.pdf | Bin 4072 -> 4111 bytes .../tex/context/base/context-version.png | Bin 105791 -> 106155 bytes Master/texmf-dist/tex/context/base/context.mkii | 2 +- Master/texmf-dist/tex/context/base/context.mkiv | 2 +- Master/texmf-dist/tex/context/base/data-exp.lua | 37 +++++++++-- Master/texmf-dist/tex/context/base/data-ini.lua | 11 +++ Master/texmf-dist/tex/context/base/data-lst.lua | 12 +++- Master/texmf-dist/tex/context/base/data-res.lua | 17 +++-- .../texmf-dist/tex/context/base/status-files.pdf | Bin 24291 -> 24381 bytes Master/texmf-dist/tex/context/base/status-lua.pdf | Bin 178937 -> 180184 bytes Master/texmf-dist/tex/context/base/strc-des.mkvi | 2 +- .../generic/context/luatex/luatex-fonts-merged.lua | 2 +- Master/texmf/web2c/texmfcnf.lua | 5 +- 38 files changed, 1454 insertions(+), 338 deletions(-) (limited to 'Master') diff --git a/Master/bin/alpha-linux/mtxrun b/Master/bin/alpha-linux/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/alpha-linux/mtxrun +++ b/Master/bin/alpha-linux/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/amd64-freebsd/mtxrun b/Master/bin/amd64-freebsd/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/amd64-freebsd/mtxrun +++ b/Master/bin/amd64-freebsd/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/amd64-kfreebsd/mtxrun b/Master/bin/amd64-kfreebsd/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/amd64-kfreebsd/mtxrun +++ b/Master/bin/amd64-kfreebsd/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/armel-linux/mtxrun b/Master/bin/armel-linux/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/armel-linux/mtxrun +++ b/Master/bin/armel-linux/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/i386-cygwin/mtxrun b/Master/bin/i386-cygwin/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/i386-cygwin/mtxrun +++ b/Master/bin/i386-cygwin/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/i386-freebsd/mtxrun b/Master/bin/i386-freebsd/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/i386-freebsd/mtxrun +++ b/Master/bin/i386-freebsd/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/i386-kfreebsd/mtxrun b/Master/bin/i386-kfreebsd/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/i386-kfreebsd/mtxrun +++ b/Master/bin/i386-kfreebsd/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/i386-linux/mtxrun b/Master/bin/i386-linux/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/i386-linux/mtxrun +++ b/Master/bin/i386-linux/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/i386-netbsd/mtxrun b/Master/bin/i386-netbsd/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/i386-netbsd/mtxrun +++ b/Master/bin/i386-netbsd/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/i386-solaris/mtxrun b/Master/bin/i386-solaris/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/i386-solaris/mtxrun +++ b/Master/bin/i386-solaris/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/mips-irix/mtxrun b/Master/bin/mips-irix/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/mips-irix/mtxrun +++ b/Master/bin/mips-irix/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/mipsel-linux/mtxrun b/Master/bin/mipsel-linux/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/mipsel-linux/mtxrun +++ b/Master/bin/mipsel-linux/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/powerpc-aix/mtxrun b/Master/bin/powerpc-aix/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/powerpc-aix/mtxrun +++ b/Master/bin/powerpc-aix/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/powerpc-linux/mtxrun b/Master/bin/powerpc-linux/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/powerpc-linux/mtxrun +++ b/Master/bin/powerpc-linux/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/sparc-solaris/mtxrun b/Master/bin/sparc-solaris/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/sparc-solaris/mtxrun +++ b/Master/bin/sparc-solaris/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/universal-darwin/mtxrun b/Master/bin/universal-darwin/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/universal-darwin/mtxrun +++ b/Master/bin/universal-darwin/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/win32/mtxrun.lua b/Master/bin/win32/mtxrun.lua index a8bbca88534..e8f229572cc 100755 --- a/Master/bin/win32/mtxrun.lua +++ b/Master/bin/win32/mtxrun.lua @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,15 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15273,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/x86_64-darwin/mtxrun b/Master/bin/x86_64-darwin/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/x86_64-darwin/mtxrun +++ b/Master/bin/x86_64-darwin/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/x86_64-linux/mtxrun b/Master/bin/x86_64-linux/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/x86_64-linux/mtxrun +++ b/Master/bin/x86_64-linux/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/bin/x86_64-solaris/mtxrun b/Master/bin/x86_64-solaris/mtxrun index e1783761afa..e8f229572cc 100755 --- a/Master/bin/x86_64-solaris/mtxrun +++ b/Master/bin/x86_64-solaris/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,16 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -this_is_texlive = true -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15274,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/texmf-dist/scripts/context/lua/mtxrun.lua b/Master/texmf-dist/scripts/context/lua/mtxrun.lua index a8bbca88534..e8f229572cc 100755 --- a/Master/texmf-dist/scripts/context/lua/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/lua/mtxrun.lua @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,15 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15273,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua index a8bbca88534..e8f229572cc 100644 --- a/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua +++ b/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,15 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15273,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun index a8bbca88534..e8f229572cc 100755 --- a/Master/texmf-dist/scripts/context/stubs/unix/mtxrun +++ b/Master/texmf-dist/scripts/context/stubs/unix/mtxrun @@ -10749,6 +10749,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { @@ -10993,6 +11004,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -11003,6 +11024,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -11017,6 +11039,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -11024,11 +11049,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then @@ -12271,7 +12309,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -12294,15 +12332,14 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' - resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' +if environment.default_texmfcnf then + resolvers.luacnfspec = environment.default_texmfcnf else - resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' + resolvers.luacnfspec = "{selfautoloc:,selfautodir:,selfautoparent:}{,/texmf{-local,}/web2c}" end +resolvers.luacnfspec = 'home:texmf/web2c;' .. resolvers.luacnfspec + -- which (as we want users to use the web2c path) be can be simplified to this: -- -- if environment and environment.ownpath and string.find(environment.ownpath,"[\\/]texlive[\\/]") then @@ -15273,7 +15310,17 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkii b/Master/texmf-dist/tex/context/base/cont-new.mkii index ecf53b1ee72..6fec69ba09d 100644 --- a/Master/texmf-dist/tex/context/base/cont-new.mkii +++ b/Master/texmf-dist/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.05.23 10:30} +\newcontextversion{2012.05.23 23:31} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkiv b/Master/texmf-dist/tex/context/base/cont-new.mkiv index 69e335d3881..a1b22eb78cb 100644 --- a/Master/texmf-dist/tex/context/base/cont-new.mkiv +++ b/Master/texmf-dist/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.05.23 10:30} +\newcontextversion{2012.05.23 23:31} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/Master/texmf-dist/tex/context/base/context-version.pdf b/Master/texmf-dist/tex/context/base/context-version.pdf index c21b5038712..e9e731e57a3 100644 Binary files a/Master/texmf-dist/tex/context/base/context-version.pdf and b/Master/texmf-dist/tex/context/base/context-version.pdf differ diff --git a/Master/texmf-dist/tex/context/base/context-version.png b/Master/texmf-dist/tex/context/base/context-version.png index f879950840a..11ae2e330e0 100644 Binary files a/Master/texmf-dist/tex/context/base/context-version.png and b/Master/texmf-dist/tex/context/base/context-version.png differ diff --git a/Master/texmf-dist/tex/context/base/context.mkii b/Master/texmf-dist/tex/context/base/context.mkii index 20b673e45d2..e38253f18fb 100644 --- a/Master/texmf-dist/tex/context/base/context.mkii +++ b/Master/texmf-dist/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2012.05.23 10:30} +\edef\contextversion{2012.05.23 23:31} %D For those who want to use this: diff --git a/Master/texmf-dist/tex/context/base/context.mkiv b/Master/texmf-dist/tex/context/base/context.mkiv index 75a21fd65c9..28d2507916a 100644 --- a/Master/texmf-dist/tex/context/base/context.mkiv +++ b/Master/texmf-dist/tex/context/base/context.mkiv @@ -23,7 +23,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2012.05.23 10:30} +\edef\contextversion{2012.05.23 23:31} %D For those who want to use this: diff --git a/Master/texmf-dist/tex/context/base/data-exp.lua b/Master/texmf-dist/tex/context/base/data-exp.lua index 52368f8a82e..1e323728c86 100644 --- a/Master/texmf-dist/tex/context/base/data-exp.lua +++ b/Master/texmf-dist/tex/context/base/data-exp.lua @@ -42,6 +42,16 @@ local function f_second(a,b) return concat(t,",") end +-- local function f_both(a,b) +-- local t, n = { }, 0 +-- for sb in gmatch(b,"[^,]+") do -- and not sa +-- for sa in gmatch(a,"[^,]+") do -- sb +-- n = n + 1 ; t[n] = sa .. sb +-- end +-- end +-- return concat(t,",") +-- end + local function f_both(a,b) local t, n = { }, 0 for sa in gmatch(a,"[^,]+") do @@ -52,6 +62,7 @@ local function f_both(a,b) return concat(t,",") end + local left = P("{") local right = P("}") local var = P((1 - S("{}" ))^0) @@ -66,6 +77,9 @@ local l_rest = Cs( ( left * var * (left/"") * var * (right/"") * var * right local stripper_1 = lpeg.stripper ("{}@") local replacer_1 = lpeg.replacer { { ",}", ",@}" }, { "{,", "{@," }, } +-- old {a,b}{c,d} => ac ad bc bd +-- new {a,b}{c,d} => ac bc ad bd + local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpegging it (nice exercise). if trace_expansions then report_expansions("expanding variable '%s'",str) @@ -73,11 +87,24 @@ local function splitpathexpr(str, newlist, validate) -- I couldn't resist lpeggi local t, ok, done = newlist or { }, false, false local n = #t str = lpegmatch(replacer_1,str) - repeat local old = str - repeat local old = str ; str = lpegmatch(l_first, str) until old == str - repeat local old = str ; str = lpegmatch(l_second,str) until old == str - repeat local old = str ; str = lpegmatch(l_both, str) until old == str - repeat local old = str ; str = lpegmatch(l_rest, str) until old == str + repeat + local old = str + repeat + local old = str + str = lpegmatch(l_first, str) + until old == str + repeat + local old = str + str = lpegmatch(l_second,str) + until old == str + repeat + local old = str + str = lpegmatch(l_both, str) + until old == str + repeat + local old = str + str = lpegmatch(l_rest, str) + until old == str until old == str -- or not find(str,"{") str = lpegmatch(stripper_1,str) if validate then diff --git a/Master/texmf-dist/tex/context/base/data-ini.lua b/Master/texmf-dist/tex/context/base/data-ini.lua index 16fbb8e25a4..2c263aada22 100644 --- a/Master/texmf-dist/tex/context/base/data-ini.lua +++ b/Master/texmf-dist/tex/context/base/data-ini.lua @@ -33,6 +33,17 @@ local resolvers = resolvers texconfig.kpse_init = false texconfig.shell_escape = 't' +if kpse and kpse.default_texmfcnf then + local default_texmfcnf = kpse.default_texmfcnf() + -- looks more like context: + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOLOC","selfautoloc:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTODIR","selfautodir:") + default_texmfcnf = gsub(default_texmfcnf,"$SELFAUTOPARENT","selfautoparent:") + default_texmfcnf = gsub(default_texmfcnf,"$HOME","home:") + -- + environment.default_texmfcnf = default_texmfcnf +end + kpse = { original = kpse } setmetatable(kpse, { diff --git a/Master/texmf-dist/tex/context/base/data-lst.lua b/Master/texmf-dist/tex/context/base/data-lst.lua index 048a26f0d1d..b1dedfae389 100644 --- a/Master/texmf-dist/tex/context/base/data-lst.lua +++ b/Master/texmf-dist/tex/context/base/data-lst.lua @@ -61,6 +61,16 @@ function resolvers.listers.configurations(report) local configurations = resolvers.instance.specification local report = report or texio.write_nl for i=1,#configurations do - report(resolvers.resolve(configurations[i])) + report(format("file : %s",resolvers.resolve(configurations[i]))) + end + report("") + local list = resolvers.expandedpathfromlist(resolvers.splitpath(resolvers.luacnfspec)) + for i=1,#list do + local li = resolvers.resolve(list[i]) + if lfs.isdir(li) then + report(format("path - %s",li)) + else + report(format("path + %s",li)) + end end end diff --git a/Master/texmf-dist/tex/context/base/data-res.lua b/Master/texmf-dist/tex/context/base/data-res.lua index 73f3cc337e7..335c44dc171 100644 --- a/Master/texmf-dist/tex/context/base/data-res.lua +++ b/Master/texmf-dist/tex/context/base/data-res.lua @@ -66,7 +66,7 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c}}' -- -- which does not make texlive happy as there is a texmf-local tree one level up --- (sigh), so we need this. (We can assume web2c as mkiv does not run on older +-- (sigh), so we need this. We can assume web2c as mkiv does not run on older -- texlives anyway. -- -- texlive: @@ -89,12 +89,19 @@ resolvers.luacnfstate = "unknown" -- selfautoparent:texmf-context/web2c -- selfautoparent:texmf/web2c -if this_is_texlive then - -- resolvers.luacnfspec = '{selfautodir:,selfautoparent:}{,{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = '{selfautodir:{/share,}/texmf-local/web2c,selfautoparent:{/share,}/texmf{-local,}/web2c}' - -- resolvers.luacnfspec = 'selfautodir:/texmf-local/web2c;selfautoparent:/texmf{-local,}/web2c' +if environment.default_texmfcnf then + -- unfortunately we now have quite some overkill in the spec (not so nice on a network) + local luacnfspec = environment.default_texmfcnf + -- we also want to use this in the minimals / standalone + -- bu tit's too tricky as it can be an expanded spec + -- luacnfspec = gsub(luacnfspec,"%-local","-local,-context") + -- and we also need to support the home dir (for taco) + resolvers.luacnfspec = 'home:texmf/web2c;' .. luacnfspec +elseif this_is_texlive then + -- old, in case default_texmfcnf is not supported yet resolvers.luacnfspec = 'selfautodir:;selfautoparent:;{selfautodir:,selfautoparent:}{/share,}/texmf{-local,}/web2c' else + -- the best for the minimals / standalone resolvers.luacnfspec = 'home:texmf/web2c;selfautoparent:texmf{-local,-context,}/web2c' end diff --git a/Master/texmf-dist/tex/context/base/status-files.pdf b/Master/texmf-dist/tex/context/base/status-files.pdf index a573b2ea563..2fbed7a151f 100644 Binary files a/Master/texmf-dist/tex/context/base/status-files.pdf and b/Master/texmf-dist/tex/context/base/status-files.pdf differ diff --git a/Master/texmf-dist/tex/context/base/status-lua.pdf b/Master/texmf-dist/tex/context/base/status-lua.pdf index 68f152ca3d3..3eee265ed68 100644 Binary files a/Master/texmf-dist/tex/context/base/status-lua.pdf and b/Master/texmf-dist/tex/context/base/status-lua.pdf differ diff --git a/Master/texmf-dist/tex/context/base/strc-des.mkvi b/Master/texmf-dist/tex/context/base/strc-des.mkvi index f2943d0f983..29072fbc61d 100644 --- a/Master/texmf-dist/tex/context/base/strc-des.mkvi +++ b/Master/texmf-dist/tex/context/base/strc-des.mkvi @@ -209,7 +209,7 @@ \unexpanded\def\strc_descriptions_nop_titled {\doifnextbgroupelse - {\strc_descriptions_nop_titled_yes_indeed}% + {\strc_descriptions_nop_titled_indeed}% {\setfalse\c_strc_constructions_title_state \strc_descriptions_nop_normal}} diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua index 94c92644085..b47e3299fa7 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/23/12 10:30:18 +-- merge date : 05/23/12 23:31:34 do -- begin closure to overcome local limits and interference diff --git a/Master/texmf/web2c/texmfcnf.lua b/Master/texmf/web2c/texmfcnf.lua index d3c5c0238c4..039426e9440 100644 --- a/Master/texmf/web2c/texmfcnf.lua +++ b/Master/texmf/web2c/texmfcnf.lua @@ -10,7 +10,7 @@ return { type = "configuration", version = "1.1.0", - date = "2012-05-14", -- or so + date = "2012-05-24", time = "12:12:12", comment = "ConTeXt MkIV configuration file", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", @@ -62,7 +62,6 @@ return { -- entry. This makes the tex root relocatable. TEXMFOS = "selfautodir:", - TEXMFSYSTEM = "selfautoparent:$SELFAUTOSYSTEM", TEXMFMAIN = "selfautoparent:texmf", TEXMFDIST = "selfautoparent:texmf-dist", @@ -77,7 +76,7 @@ return { -- We need texmfos for a few rare files but as I have a few more bin trees -- a hack is needed. Maybe other users also have texmf-platform-new trees. - TEXMF = "{$TEXMFCONFIG,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFPROJECT,!!$TEXMFFONTS,!!TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST,!!$TEXMFSYSTEM}", + TEXMF = "{$TEXMFCONFIG,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFPROJECT,!!$TEXMFFONTS,!!TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}", TEXFONTMAPS = ".;$TEXMF/fonts/data//;$TEXMF/fonts/map/{pdftex,dvips}//", ENCFONTS = ".;$TEXMF/fonts/data//;$TEXMF/fonts/enc/{dvips,pdftex}//", -- cgit v1.2.3