summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/context/lua/mtxrun.lua87
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua87
-rw-r--r--scripts/context/stubs/unix/mtxrun87
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua87
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4432 -> 4436 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/data-env.lua15
-rw-r--r--tex/context/base/data-exp.lua49
-rw-r--r--tex/context/base/data-res.lua11
-rw-r--r--tex/context/base/data-tre.lua2
-rw-r--r--tex/context/base/file-job.lua12
-rw-r--r--tex/context/base/file-lib.lua89
-rw-r--r--tex/context/base/luat-cod.lua2
-rw-r--r--tex/context/base/status-files.pdfbin24924 -> 24913 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin326283 -> 326320 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
17 files changed, 348 insertions, 186 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index a6353dc67..81d47d1f2 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -12851,7 +12851,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 16463, stripped down to: 10113
+-- original size: 17039, stripped down to: 10493
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -12865,6 +12865,7 @@ local concat,sort=table.concat,table.sort
local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
+local isdir=lfs.isdir
local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
@@ -12969,7 +12970,7 @@ local doslashes=(P("\\")/"/"+1)^0
local function expandedhome()
if not usedhomedir then
usedhomedir=lpegmatch(Cs(donegation*doslashes),environment.homedir or "")
- if usedhomedir=="~" or usedhomedir=="" or not lfs.isdir(usedhomedir) then
+ if usedhomedir=="~" or usedhomedir=="" or not isdir(usedhomedir) then
if trace_expansions then
report_expansions("no home dir set, ignoring dependent path using current path")
end
@@ -13125,19 +13126,36 @@ function resolvers.scanfiles(path,branch,usecache,onlyonce)
if trace_locating then
report_expansions("scanning path %a, branch %a",path,branch or path)
end
- local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
- local content={
- metadata={
- path=path,
- files=n,
- directories=m,
- remappings=r,
- },
- files=files,
- remap=remap,
- }
- if trace_locating then
- report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ local content
+ if isdir(realpath) then
+ local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
+ content={
+ metadata={
+ path=path,
+ files=n,
+ directories=m,
+ remappings=r,
+ },
+ files=files,
+ remap=remap,
+ }
+ if trace_locating then
+ report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ end
+ else
+ content={
+ metadata={
+ path=path,
+ files=0,
+ directories=0,
+ remappings=0,
+ },
+ files={},
+ remap={},
+ }
+ if trace_locating then
+ report_expansions("invalid path %a",realpath)
+ end
end
if usecache then
scanned[#scanned+1]=realpath
@@ -13160,6 +13178,9 @@ function resolvers.scandata()
}
end
function resolvers.get_from_content(content,path,name)
+ if not content then
+ return
+ end
local files=content.files
if not files then
return
@@ -13210,7 +13231,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-env"] = package.loaded["data-env"] or true
--- original size: 8898, stripped down to: 6564
+-- original size: 9216, stripped down to: 6798
if not modules then modules={} end modules ['data-env']={
version=1.001,
@@ -13228,10 +13249,12 @@ local formats=allocate()
local suffixes=allocate()
local dangerous=allocate()
local suffixmap=allocate()
+local usertypes=allocate()
resolvers.formats=formats
resolvers.suffixes=suffixes
resolvers.dangerous=dangerous
resolvers.suffixmap=suffixmap
+resolvers.usertypes=usertypes
local luasuffixes=utilities.lua.suffixes
local relations=allocate {
core={
@@ -13299,11 +13322,13 @@ local relations=allocate {
names={ "mp" },
variable='MPINPUTS',
suffixes={ 'mp','mpvi','mpiv','mpii' },
+ usertype=true,
},
tex={
names={ "tex" },
variable='TEXINPUTS',
suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" },
+ usertype=true,
},
icc={
names={ "icc","icc profile","icc profiles" },
@@ -13319,6 +13344,7 @@ local relations=allocate {
names={ "lua" },
variable='LUAINPUTS',
suffixes={ luasuffixes.lua,luasuffixes.luc,luasuffixes.tma,luasuffixes.tmc },
+ usertype=true,
},
lib={
names={ "lib" },
@@ -13329,11 +13355,13 @@ local relations=allocate {
names={ 'bib' },
variable='BIBINPUTS',
suffixes={ 'bib' },
+ usertype=true,
},
bst={
names={ 'bst' },
variable='BSTINPUTS',
suffixes={ 'bst' },
+ usertype=true,
},
fontconfig={
names={ 'fontconfig','fontconfig file','fontconfig files' },
@@ -13415,8 +13443,9 @@ function resolvers.updaterelations()
for name,relation in next,categories do
local rn=relation.names
local rv=relation.variable
- local rs=relation.suffixes
if rn and rv then
+ local rs=relation.suffixes
+ local ru=relation.usertype
for i=1,#rn do
local rni=lower(gsub(rn[i]," ",""))
formats[rni]=rv
@@ -13428,8 +13457,9 @@ function resolvers.updaterelations()
end
end
end
- end
- if rs then
+ if ru then
+ usertypes[name]=true
+ end
end
end
end
@@ -13979,7 +14009,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61614, stripped down to: 42970
+-- original size: 61840, stripped down to: 43162
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -14047,6 +14077,7 @@ end
local unset_variable="unset"
local formats=resolvers.formats
local suffixes=resolvers.suffixes
+local usertypes=resolvers.usertypes
local dangerous=resolvers.dangerous
local suffixmap=resolvers.suffixmap
resolvers.defaultsuffixes={ "tex" }
@@ -14886,7 +14917,7 @@ local function check_subpath(fname)
end
local function find_intree(filename,filetype,wantedfiles,allresults)
local typespec=resolvers.variableofformat(filetype)
- local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex")
+ local pathlist=resolvers.expandedpathlist(typespec,filetype and usertypes[filetype])
local method="intree"
if pathlist and #pathlist>0 then
local filelist=collect_files(wantedfiles)
@@ -15079,7 +15110,11 @@ collect_instance_files=function(filename,askedformat,allresults)
else
local method,result,stamp,filetype,wantedfiles
if instance.remember then
- stamp=formatters["%s--%s"](filename,askedformat)
+ if askedformat=="" then
+ stamp=formatters["%s::%s"](suffixonly(filename),filename)
+ else
+ stamp=formatters["%s::%s"](askedformat,filename)
+ end
result=stamp and instance.found[stamp]
if result then
if trace_locating then
@@ -15114,7 +15149,7 @@ collect_instance_files=function(filename,askedformat,allresults)
end
if stamp then
if trace_locating then
- report_resolving("remembering file %a",filename)
+ report_resolving("remembering file %a using hash %a",filename,stamp)
end
instance.found[stamp]=result
end
@@ -16134,7 +16169,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-tre"] = package.loaded["data-tre"] or true
--- original size: 7874, stripped down to: 5289
+-- original size: 7832, stripped down to: 5289
if not modules then modules={} end modules ['data-tre']={
version=1.001,
@@ -17224,8 +17259,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 709027
--- stripped bytes : 251779
+-- original bytes : 710105
+-- stripped bytes : 252051
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index a6353dc67..81d47d1f2 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -12851,7 +12851,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 16463, stripped down to: 10113
+-- original size: 17039, stripped down to: 10493
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -12865,6 +12865,7 @@ local concat,sort=table.concat,table.sort
local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
+local isdir=lfs.isdir
local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
@@ -12969,7 +12970,7 @@ local doslashes=(P("\\")/"/"+1)^0
local function expandedhome()
if not usedhomedir then
usedhomedir=lpegmatch(Cs(donegation*doslashes),environment.homedir or "")
- if usedhomedir=="~" or usedhomedir=="" or not lfs.isdir(usedhomedir) then
+ if usedhomedir=="~" or usedhomedir=="" or not isdir(usedhomedir) then
if trace_expansions then
report_expansions("no home dir set, ignoring dependent path using current path")
end
@@ -13125,19 +13126,36 @@ function resolvers.scanfiles(path,branch,usecache,onlyonce)
if trace_locating then
report_expansions("scanning path %a, branch %a",path,branch or path)
end
- local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
- local content={
- metadata={
- path=path,
- files=n,
- directories=m,
- remappings=r,
- },
- files=files,
- remap=remap,
- }
- if trace_locating then
- report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ local content
+ if isdir(realpath) then
+ local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
+ content={
+ metadata={
+ path=path,
+ files=n,
+ directories=m,
+ remappings=r,
+ },
+ files=files,
+ remap=remap,
+ }
+ if trace_locating then
+ report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ end
+ else
+ content={
+ metadata={
+ path=path,
+ files=0,
+ directories=0,
+ remappings=0,
+ },
+ files={},
+ remap={},
+ }
+ if trace_locating then
+ report_expansions("invalid path %a",realpath)
+ end
end
if usecache then
scanned[#scanned+1]=realpath
@@ -13160,6 +13178,9 @@ function resolvers.scandata()
}
end
function resolvers.get_from_content(content,path,name)
+ if not content then
+ return
+ end
local files=content.files
if not files then
return
@@ -13210,7 +13231,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-env"] = package.loaded["data-env"] or true
--- original size: 8898, stripped down to: 6564
+-- original size: 9216, stripped down to: 6798
if not modules then modules={} end modules ['data-env']={
version=1.001,
@@ -13228,10 +13249,12 @@ local formats=allocate()
local suffixes=allocate()
local dangerous=allocate()
local suffixmap=allocate()
+local usertypes=allocate()
resolvers.formats=formats
resolvers.suffixes=suffixes
resolvers.dangerous=dangerous
resolvers.suffixmap=suffixmap
+resolvers.usertypes=usertypes
local luasuffixes=utilities.lua.suffixes
local relations=allocate {
core={
@@ -13299,11 +13322,13 @@ local relations=allocate {
names={ "mp" },
variable='MPINPUTS',
suffixes={ 'mp','mpvi','mpiv','mpii' },
+ usertype=true,
},
tex={
names={ "tex" },
variable='TEXINPUTS',
suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" },
+ usertype=true,
},
icc={
names={ "icc","icc profile","icc profiles" },
@@ -13319,6 +13344,7 @@ local relations=allocate {
names={ "lua" },
variable='LUAINPUTS',
suffixes={ luasuffixes.lua,luasuffixes.luc,luasuffixes.tma,luasuffixes.tmc },
+ usertype=true,
},
lib={
names={ "lib" },
@@ -13329,11 +13355,13 @@ local relations=allocate {
names={ 'bib' },
variable='BIBINPUTS',
suffixes={ 'bib' },
+ usertype=true,
},
bst={
names={ 'bst' },
variable='BSTINPUTS',
suffixes={ 'bst' },
+ usertype=true,
},
fontconfig={
names={ 'fontconfig','fontconfig file','fontconfig files' },
@@ -13415,8 +13443,9 @@ function resolvers.updaterelations()
for name,relation in next,categories do
local rn=relation.names
local rv=relation.variable
- local rs=relation.suffixes
if rn and rv then
+ local rs=relation.suffixes
+ local ru=relation.usertype
for i=1,#rn do
local rni=lower(gsub(rn[i]," ",""))
formats[rni]=rv
@@ -13428,8 +13457,9 @@ function resolvers.updaterelations()
end
end
end
- end
- if rs then
+ if ru then
+ usertypes[name]=true
+ end
end
end
end
@@ -13979,7 +14009,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61614, stripped down to: 42970
+-- original size: 61840, stripped down to: 43162
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -14047,6 +14077,7 @@ end
local unset_variable="unset"
local formats=resolvers.formats
local suffixes=resolvers.suffixes
+local usertypes=resolvers.usertypes
local dangerous=resolvers.dangerous
local suffixmap=resolvers.suffixmap
resolvers.defaultsuffixes={ "tex" }
@@ -14886,7 +14917,7 @@ local function check_subpath(fname)
end
local function find_intree(filename,filetype,wantedfiles,allresults)
local typespec=resolvers.variableofformat(filetype)
- local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex")
+ local pathlist=resolvers.expandedpathlist(typespec,filetype and usertypes[filetype])
local method="intree"
if pathlist and #pathlist>0 then
local filelist=collect_files(wantedfiles)
@@ -15079,7 +15110,11 @@ collect_instance_files=function(filename,askedformat,allresults)
else
local method,result,stamp,filetype,wantedfiles
if instance.remember then
- stamp=formatters["%s--%s"](filename,askedformat)
+ if askedformat=="" then
+ stamp=formatters["%s::%s"](suffixonly(filename),filename)
+ else
+ stamp=formatters["%s::%s"](askedformat,filename)
+ end
result=stamp and instance.found[stamp]
if result then
if trace_locating then
@@ -15114,7 +15149,7 @@ collect_instance_files=function(filename,askedformat,allresults)
end
if stamp then
if trace_locating then
- report_resolving("remembering file %a",filename)
+ report_resolving("remembering file %a using hash %a",filename,stamp)
end
instance.found[stamp]=result
end
@@ -16134,7 +16169,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-tre"] = package.loaded["data-tre"] or true
--- original size: 7874, stripped down to: 5289
+-- original size: 7832, stripped down to: 5289
if not modules then modules={} end modules ['data-tre']={
version=1.001,
@@ -17224,8 +17259,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 709027
--- stripped bytes : 251779
+-- original bytes : 710105
+-- stripped bytes : 252051
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index a6353dc67..81d47d1f2 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -12851,7 +12851,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 16463, stripped down to: 10113
+-- original size: 17039, stripped down to: 10493
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -12865,6 +12865,7 @@ local concat,sort=table.concat,table.sort
local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
+local isdir=lfs.isdir
local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
@@ -12969,7 +12970,7 @@ local doslashes=(P("\\")/"/"+1)^0
local function expandedhome()
if not usedhomedir then
usedhomedir=lpegmatch(Cs(donegation*doslashes),environment.homedir or "")
- if usedhomedir=="~" or usedhomedir=="" or not lfs.isdir(usedhomedir) then
+ if usedhomedir=="~" or usedhomedir=="" or not isdir(usedhomedir) then
if trace_expansions then
report_expansions("no home dir set, ignoring dependent path using current path")
end
@@ -13125,19 +13126,36 @@ function resolvers.scanfiles(path,branch,usecache,onlyonce)
if trace_locating then
report_expansions("scanning path %a, branch %a",path,branch or path)
end
- local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
- local content={
- metadata={
- path=path,
- files=n,
- directories=m,
- remappings=r,
- },
- files=files,
- remap=remap,
- }
- if trace_locating then
- report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ local content
+ if isdir(realpath) then
+ local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
+ content={
+ metadata={
+ path=path,
+ files=n,
+ directories=m,
+ remappings=r,
+ },
+ files=files,
+ remap=remap,
+ }
+ if trace_locating then
+ report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ end
+ else
+ content={
+ metadata={
+ path=path,
+ files=0,
+ directories=0,
+ remappings=0,
+ },
+ files={},
+ remap={},
+ }
+ if trace_locating then
+ report_expansions("invalid path %a",realpath)
+ end
end
if usecache then
scanned[#scanned+1]=realpath
@@ -13160,6 +13178,9 @@ function resolvers.scandata()
}
end
function resolvers.get_from_content(content,path,name)
+ if not content then
+ return
+ end
local files=content.files
if not files then
return
@@ -13210,7 +13231,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-env"] = package.loaded["data-env"] or true
--- original size: 8898, stripped down to: 6564
+-- original size: 9216, stripped down to: 6798
if not modules then modules={} end modules ['data-env']={
version=1.001,
@@ -13228,10 +13249,12 @@ local formats=allocate()
local suffixes=allocate()
local dangerous=allocate()
local suffixmap=allocate()
+local usertypes=allocate()
resolvers.formats=formats
resolvers.suffixes=suffixes
resolvers.dangerous=dangerous
resolvers.suffixmap=suffixmap
+resolvers.usertypes=usertypes
local luasuffixes=utilities.lua.suffixes
local relations=allocate {
core={
@@ -13299,11 +13322,13 @@ local relations=allocate {
names={ "mp" },
variable='MPINPUTS',
suffixes={ 'mp','mpvi','mpiv','mpii' },
+ usertype=true,
},
tex={
names={ "tex" },
variable='TEXINPUTS',
suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" },
+ usertype=true,
},
icc={
names={ "icc","icc profile","icc profiles" },
@@ -13319,6 +13344,7 @@ local relations=allocate {
names={ "lua" },
variable='LUAINPUTS',
suffixes={ luasuffixes.lua,luasuffixes.luc,luasuffixes.tma,luasuffixes.tmc },
+ usertype=true,
},
lib={
names={ "lib" },
@@ -13329,11 +13355,13 @@ local relations=allocate {
names={ 'bib' },
variable='BIBINPUTS',
suffixes={ 'bib' },
+ usertype=true,
},
bst={
names={ 'bst' },
variable='BSTINPUTS',
suffixes={ 'bst' },
+ usertype=true,
},
fontconfig={
names={ 'fontconfig','fontconfig file','fontconfig files' },
@@ -13415,8 +13443,9 @@ function resolvers.updaterelations()
for name,relation in next,categories do
local rn=relation.names
local rv=relation.variable
- local rs=relation.suffixes
if rn and rv then
+ local rs=relation.suffixes
+ local ru=relation.usertype
for i=1,#rn do
local rni=lower(gsub(rn[i]," ",""))
formats[rni]=rv
@@ -13428,8 +13457,9 @@ function resolvers.updaterelations()
end
end
end
- end
- if rs then
+ if ru then
+ usertypes[name]=true
+ end
end
end
end
@@ -13979,7 +14009,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61614, stripped down to: 42970
+-- original size: 61840, stripped down to: 43162
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -14047,6 +14077,7 @@ end
local unset_variable="unset"
local formats=resolvers.formats
local suffixes=resolvers.suffixes
+local usertypes=resolvers.usertypes
local dangerous=resolvers.dangerous
local suffixmap=resolvers.suffixmap
resolvers.defaultsuffixes={ "tex" }
@@ -14886,7 +14917,7 @@ local function check_subpath(fname)
end
local function find_intree(filename,filetype,wantedfiles,allresults)
local typespec=resolvers.variableofformat(filetype)
- local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex")
+ local pathlist=resolvers.expandedpathlist(typespec,filetype and usertypes[filetype])
local method="intree"
if pathlist and #pathlist>0 then
local filelist=collect_files(wantedfiles)
@@ -15079,7 +15110,11 @@ collect_instance_files=function(filename,askedformat,allresults)
else
local method,result,stamp,filetype,wantedfiles
if instance.remember then
- stamp=formatters["%s--%s"](filename,askedformat)
+ if askedformat=="" then
+ stamp=formatters["%s::%s"](suffixonly(filename),filename)
+ else
+ stamp=formatters["%s::%s"](askedformat,filename)
+ end
result=stamp and instance.found[stamp]
if result then
if trace_locating then
@@ -15114,7 +15149,7 @@ collect_instance_files=function(filename,askedformat,allresults)
end
if stamp then
if trace_locating then
- report_resolving("remembering file %a",filename)
+ report_resolving("remembering file %a using hash %a",filename,stamp)
end
instance.found[stamp]=result
end
@@ -16134,7 +16169,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-tre"] = package.loaded["data-tre"] or true
--- original size: 7874, stripped down to: 5289
+-- original size: 7832, stripped down to: 5289
if not modules then modules={} end modules ['data-tre']={
version=1.001,
@@ -17224,8 +17259,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 709027
--- stripped bytes : 251779
+-- original bytes : 710105
+-- stripped bytes : 252051
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index a6353dc67..81d47d1f2 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -12851,7 +12851,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 16463, stripped down to: 10113
+-- original size: 17039, stripped down to: 10493
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -12865,6 +12865,7 @@ local concat,sort=table.concat,table.sort
local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
+local isdir=lfs.isdir
local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
@@ -12969,7 +12970,7 @@ local doslashes=(P("\\")/"/"+1)^0
local function expandedhome()
if not usedhomedir then
usedhomedir=lpegmatch(Cs(donegation*doslashes),environment.homedir or "")
- if usedhomedir=="~" or usedhomedir=="" or not lfs.isdir(usedhomedir) then
+ if usedhomedir=="~" or usedhomedir=="" or not isdir(usedhomedir) then
if trace_expansions then
report_expansions("no home dir set, ignoring dependent path using current path")
end
@@ -13125,19 +13126,36 @@ function resolvers.scanfiles(path,branch,usecache,onlyonce)
if trace_locating then
report_expansions("scanning path %a, branch %a",path,branch or path)
end
- local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
- local content={
- metadata={
- path=path,
- files=n,
- directories=m,
- remappings=r,
- },
- files=files,
- remap=remap,
- }
- if trace_locating then
- report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ local content
+ if isdir(realpath) then
+ local files,remap,n,m,r=scan({},{},realpath..'/',"",0,0,0,onlyonce)
+ content={
+ metadata={
+ path=path,
+ files=n,
+ directories=m,
+ remappings=r,
+ },
+ files=files,
+ remap=remap,
+ }
+ if trace_locating then
+ report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ end
+ else
+ content={
+ metadata={
+ path=path,
+ files=0,
+ directories=0,
+ remappings=0,
+ },
+ files={},
+ remap={},
+ }
+ if trace_locating then
+ report_expansions("invalid path %a",realpath)
+ end
end
if usecache then
scanned[#scanned+1]=realpath
@@ -13160,6 +13178,9 @@ function resolvers.scandata()
}
end
function resolvers.get_from_content(content,path,name)
+ if not content then
+ return
+ end
local files=content.files
if not files then
return
@@ -13210,7 +13231,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-env"] = package.loaded["data-env"] or true
--- original size: 8898, stripped down to: 6564
+-- original size: 9216, stripped down to: 6798
if not modules then modules={} end modules ['data-env']={
version=1.001,
@@ -13228,10 +13249,12 @@ local formats=allocate()
local suffixes=allocate()
local dangerous=allocate()
local suffixmap=allocate()
+local usertypes=allocate()
resolvers.formats=formats
resolvers.suffixes=suffixes
resolvers.dangerous=dangerous
resolvers.suffixmap=suffixmap
+resolvers.usertypes=usertypes
local luasuffixes=utilities.lua.suffixes
local relations=allocate {
core={
@@ -13299,11 +13322,13 @@ local relations=allocate {
names={ "mp" },
variable='MPINPUTS',
suffixes={ 'mp','mpvi','mpiv','mpii' },
+ usertype=true,
},
tex={
names={ "tex" },
variable='TEXINPUTS',
suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" },
+ usertype=true,
},
icc={
names={ "icc","icc profile","icc profiles" },
@@ -13319,6 +13344,7 @@ local relations=allocate {
names={ "lua" },
variable='LUAINPUTS',
suffixes={ luasuffixes.lua,luasuffixes.luc,luasuffixes.tma,luasuffixes.tmc },
+ usertype=true,
},
lib={
names={ "lib" },
@@ -13329,11 +13355,13 @@ local relations=allocate {
names={ 'bib' },
variable='BIBINPUTS',
suffixes={ 'bib' },
+ usertype=true,
},
bst={
names={ 'bst' },
variable='BSTINPUTS',
suffixes={ 'bst' },
+ usertype=true,
},
fontconfig={
names={ 'fontconfig','fontconfig file','fontconfig files' },
@@ -13415,8 +13443,9 @@ function resolvers.updaterelations()
for name,relation in next,categories do
local rn=relation.names
local rv=relation.variable
- local rs=relation.suffixes
if rn and rv then
+ local rs=relation.suffixes
+ local ru=relation.usertype
for i=1,#rn do
local rni=lower(gsub(rn[i]," ",""))
formats[rni]=rv
@@ -13428,8 +13457,9 @@ function resolvers.updaterelations()
end
end
end
- end
- if rs then
+ if ru then
+ usertypes[name]=true
+ end
end
end
end
@@ -13979,7 +14009,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61614, stripped down to: 42970
+-- original size: 61840, stripped down to: 43162
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -14047,6 +14077,7 @@ end
local unset_variable="unset"
local formats=resolvers.formats
local suffixes=resolvers.suffixes
+local usertypes=resolvers.usertypes
local dangerous=resolvers.dangerous
local suffixmap=resolvers.suffixmap
resolvers.defaultsuffixes={ "tex" }
@@ -14886,7 +14917,7 @@ local function check_subpath(fname)
end
local function find_intree(filename,filetype,wantedfiles,allresults)
local typespec=resolvers.variableofformat(filetype)
- local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex")
+ local pathlist=resolvers.expandedpathlist(typespec,filetype and usertypes[filetype])
local method="intree"
if pathlist and #pathlist>0 then
local filelist=collect_files(wantedfiles)
@@ -15079,7 +15110,11 @@ collect_instance_files=function(filename,askedformat,allresults)
else
local method,result,stamp,filetype,wantedfiles
if instance.remember then
- stamp=formatters["%s--%s"](filename,askedformat)
+ if askedformat=="" then
+ stamp=formatters["%s::%s"](suffixonly(filename),filename)
+ else
+ stamp=formatters["%s::%s"](askedformat,filename)
+ end
result=stamp and instance.found[stamp]
if result then
if trace_locating then
@@ -15114,7 +15149,7 @@ collect_instance_files=function(filename,askedformat,allresults)
end
if stamp then
if trace_locating then
- report_resolving("remembering file %a",filename)
+ report_resolving("remembering file %a using hash %a",filename,stamp)
end
instance.found[stamp]=result
end
@@ -16134,7 +16169,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-tre"] = package.loaded["data-tre"] or true
--- original size: 7874, stripped down to: 5289
+-- original size: 7832, stripped down to: 5289
if not modules then modules={} end modules ['data-tre']={
version=1.001,
@@ -17224,8 +17259,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 709027
--- stripped bytes : 251779
+-- original bytes : 710105
+-- stripped bytes : 252051
-- end library merge
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index b87b4d5cd..59be62f4b 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2014.07.09 10:26}
+\newcontextversion{2014.07.10 13:14}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 73fc6286d..93b4e9264 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 24c3c8244..168658a29 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2014.07.09 10:26}
+\edef\contextversion{2014.07.10 13:14}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/data-env.lua b/tex/context/base/data-env.lua
index 03a382e7b..1d7728c22 100644
--- a/tex/context/base/data-env.lua
+++ b/tex/context/base/data-env.lua
@@ -18,11 +18,13 @@ local formats = allocate()
local suffixes = allocate()
local dangerous = allocate()
local suffixmap = allocate()
+local usertypes = allocate()
resolvers.formats = formats
resolvers.suffixes = suffixes
resolvers.dangerous = dangerous
resolvers.suffixmap = suffixmap
+resolvers.usertypes = usertypes
local luasuffixes = utilities.lua.suffixes
@@ -92,11 +94,13 @@ local relations = allocate { -- todo: handlers also here
names = { "mp" },
variable = 'MPINPUTS',
suffixes = { 'mp', 'mpvi', 'mpiv', 'mpii' },
+ usertype = true,
},
tex = {
names = { "tex" },
variable = 'TEXINPUTS',
suffixes = { "tex", "mkvi", "mkiv", "mkii", "cld", "lfg", "xml" }, -- known suffixes have less lookups
+ usertype = true,
},
icc = {
names = { "icc", "icc profile", "icc profiles" },
@@ -112,6 +116,7 @@ local relations = allocate { -- todo: handlers also here
names = { "lua" },
variable = 'LUAINPUTS',
suffixes = { luasuffixes.lua, luasuffixes.luc, luasuffixes.tma, luasuffixes.tmc },
+ usertype = true,
},
lib = {
names = { "lib" },
@@ -122,11 +127,13 @@ local relations = allocate { -- todo: handlers also here
names = { 'bib' },
variable = 'BIBINPUTS',
suffixes = { 'bib' },
+ usertype = true,
},
bst = {
names = { 'bst' },
variable = 'BSTINPUTS',
suffixes = { 'bst' },
+ usertype = true,
},
fontconfig = {
names = { 'fontconfig', 'fontconfig file', 'fontconfig files' },
@@ -212,8 +219,9 @@ function resolvers.updaterelations()
for name, relation in next, categories do
local rn = relation.names
local rv = relation.variable
- local rs = relation.suffixes
if rn and rv then
+ local rs = relation.suffixes
+ local ru = relation.usertype
for i=1,#rn do
local rni = lower(gsub(rn[i]," ",""))
formats[rni] = rv
@@ -225,8 +233,9 @@ function resolvers.updaterelations()
end
end
end
- end
- if rs then
+ if ru then
+ usertypes[name] = true
+ end
end
end
end
diff --git a/tex/context/base/data-exp.lua b/tex/context/base/data-exp.lua
index 6edaa8c6a..b8c66909e 100644
--- a/tex/context/base/data-exp.lua
+++ b/tex/context/base/data-exp.lua
@@ -11,6 +11,7 @@ local concat, sort = table.concat, table.sort
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local Ct, Cs, Cc, Carg, P, C, S = lpeg.Ct, lpeg.Cs, lpeg.Cc, lpeg.Carg, lpeg.P, lpeg.C, lpeg.S
local type, next = type, next
+local isdir = lfs.isdir
local ostype = os.type
local collapsepath, joinpath, basename = file.collapsepath, file.join, file.basename
@@ -187,7 +188,7 @@ local doslashes = (P("\\")/"/" + 1)^0
local function expandedhome()
if not usedhomedir then
usedhomedir = lpegmatch(Cs(donegation * doslashes),environment.homedir or "")
- if usedhomedir == "~" or usedhomedir == "" or not lfs.isdir(usedhomedir) then
+ if usedhomedir == "~" or usedhomedir == "" or not isdir(usedhomedir) then
if trace_expansions then
report_expansions("no home dir set, ignoring dependent path using current path")
end
@@ -415,19 +416,36 @@ function resolvers.scanfiles(path,branch,usecache,onlyonce)
if trace_locating then
report_expansions("scanning path %a, branch %a",path,branch or path)
end
- local files, remap, n, m, r = scan({ },{ },realpath .. '/',"",0,0,0,onlyonce)
- local content = {
- metadata = {
- path = path, -- can be selfautoparent:texmf-whatever
- files = n,
- directories = m,
- remappings = r,
- },
- files = files,
- remap = remap,
- }
- if trace_locating then
- report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ local content
+ if isdir(realpath) then
+ local files, remap, n, m, r = scan({ },{ },realpath .. '/',"",0,0,0,onlyonce)
+ content = {
+ metadata = {
+ path = path, -- can be selfautoparent:texmf-whatever
+ files = n,
+ directories = m,
+ remappings = r,
+ },
+ files = files,
+ remap = remap,
+ }
+ if trace_locating then
+ report_expansions("%s files found on %s directories with %s uppercase remappings",n,m,r)
+ end
+ else
+ content = {
+ metadata = {
+ path = path, -- can be selfautoparent:texmf-whatever
+ files = 0,
+ directories = 0,
+ remappings = 0,
+ },
+ files = { },
+ remap = { },
+ }
+ if trace_locating then
+ report_expansions("invalid path %a",realpath)
+ end
end
if usecache then
scanned[#scanned+1] = realpath
@@ -453,6 +471,9 @@ function resolvers.scandata()
end
function resolvers.get_from_content(content,path,name) -- or (content,name)
+ if not content then
+ return
+ end
local files = content.files
if not files then
return
diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua
index a22aea27f..dfb50413f 100644
--- a/tex/context/base/data-res.lua
+++ b/tex/context/base/data-res.lua
@@ -146,6 +146,7 @@ local unset_variable = "unset"
local formats = resolvers.formats
local suffixes = resolvers.suffixes
+local usertypes = resolvers.usertypes
local dangerous = resolvers.dangerous
local suffixmap = resolvers.suffixmap
@@ -1140,7 +1141,7 @@ end
local function find_intree(filename,filetype,wantedfiles,allresults)
local typespec = resolvers.variableofformat(filetype)
- local pathlist = resolvers.expandedpathlist(typespec,filetype=="tex") -- only extra path with user files
+ local pathlist = resolvers.expandedpathlist(typespec,filetype and usertypes[filetype]) -- only extra path with user files
local method = "intree"
if pathlist and #pathlist > 0 then
-- list search
@@ -1358,7 +1359,11 @@ collect_instance_files = function(filename,askedformat,allresults) -- uses neste
else
local method, result, stamp, filetype, wantedfiles
if instance.remember then
- stamp = formatters["%s--%s"](filename,askedformat)
+ if askedformat == "" then
+ stamp = formatters["%s::%s"](suffixonly(filename),filename)
+ else
+ stamp = formatters["%s::%s"](askedformat,filename)
+ end
result = stamp and instance.found[stamp]
if result then
if trace_locating then
@@ -1394,7 +1399,7 @@ collect_instance_files = function(filename,askedformat,allresults) -- uses neste
end
if stamp then
if trace_locating then
- report_resolving("remembering file %a",filename)
+ report_resolving("remembering file %a using hash %a",filename,stamp)
end
instance.found[stamp] = result
end
diff --git a/tex/context/base/data-tre.lua b/tex/context/base/data-tre.lua
index 58e44c23b..dc9440deb 100644
--- a/tex/context/base/data-tre.lua
+++ b/tex/context/base/data-tre.lua
@@ -137,7 +137,7 @@ end
local function resolve(specification) -- can be called directly too
local filename = specification.filename
- -- print(filename) -- in case we want to check for unwanted lookups
+ -- inspect(specification)
if filename ~= "" then
local root, rest = lpegmatch(splitter,filename)
if root and rest then
diff --git a/tex/context/base/file-job.lua b/tex/context/base/file-job.lua
index ca0de2696..bbc7abcd0 100644
--- a/tex/context/base/file-job.lua
+++ b/tex/context/base/file-job.lua
@@ -234,21 +234,23 @@ local suffixes = {
}
local function useanyfile(name,onlyonce)
- local s = suffixes[file.suffix(name)]
+ local s = suffixes[suffixonly(name)]
if s then
- s(removesuffix(name),onlyonce)
+ -- s(removesuffix(name),onlyonce)
+ s(name,onlyonce) -- so, first with suffix, then without
else
usetexfile(name,onlyonce) -- e.g. ctx file
---~ resolvers.readfilename(name)
+ -- resolvers.readfilename(name)
end
end
commands.useanyfile = useanyfile
function resolvers.jobs.usefile(name,onlyonce,notext)
- local s = suffixes[file.suffix(name)]
+ local s = suffixes[suffixonly(name)]
if s then
- s(removesuffix(name),onlyonce,notext)
+ -- s(removesuffix(name),onlyonce,notext)
+ s(name,onlyonce,notext) -- so, first with suffix, then without
end
end
diff --git a/tex/context/base/file-lib.lua b/tex/context/base/file-lib.lua
index 409559cd3..7489a317b 100644
--- a/tex/context/base/file-lib.lua
+++ b/tex/context/base/file-lib.lua
@@ -11,8 +11,16 @@ if not modules then modules = { } end modules ['file-lib'] = {
local format = string.format
-local trace_files = false trackers.register("resolvers.readfile", function(v) trace_files = v end)
-local report_files = logs.reporter("files","readfile")
+local trace_libraries = false trackers.register("resolvers.libraries", function(v) trace_libraries = v end)
+----- trace_files = false trackers.register("resolvers.readfile", function(v) trace_files = v end)
+
+local report_library = logs.reporter("files","library")
+----- report_files = logs.reporter("files","readfile")
+
+local suffixonly = file.suffix
+local removesuffix = file.removesuffix
+
+local getreadfilename = resolvers.getreadfilename
local loaded = { }
local defaultpatterns = { "%s" }
@@ -25,45 +33,6 @@ local function defaultfailure(name)
report_files("asked name %a, not found",name)
end
--- function commands.uselibrary(specification) -- todo; reporter
--- local name = specification.name
--- if name and name ~= "" then
--- local patterns = specification.patterns or defaultpatterns
--- local action = specification.action or defaultaction
--- local failure = specification.failure or defaultfailure
--- local onlyonce = specification.onlyonce
--- local files = utilities.parsers.settings_to_array(name)
--- local truename = environment.truefilename
--- local done = false
--- for i=1,#files do
--- local filename = files[i]
--- if not loaded[filename] then
--- if onlyonce then
--- loaded[filename] = true -- todo: base this on return value
--- end
--- for i=1,#patterns do
--- local somename = format(patterns[i],filename)
--- if truename then
--- somename = truename(somename)
--- end
--- local foundname = resolvers.getreadfilename("any",".",somename) or ""
--- if foundname ~= "" then
--- action(name,foundname)
--- done = true
--- break
--- end
--- end
--- if done then
--- break
--- end
--- end
--- end
--- if failure and not done then
--- failure(name)
--- end
--- end
--- end
-
function commands.uselibrary(specification) -- todo: reporter
local name = specification.name
if name and name ~= "" then
@@ -73,6 +42,11 @@ function commands.uselibrary(specification) -- todo: reporter
local onlyonce = specification.onlyonce
local files = utilities.parsers.settings_to_array(name)
local truename = environment.truefilename
+ local function found(filename)
+ local somename = truename and truename(filename) or filename
+ local foundname = getreadfilename("any",".",somename)
+ return foundname ~= "" and foundname
+ end
for i=1,#files do
local filename = files[i]
if loaded[filename] then
@@ -81,20 +55,31 @@ function commands.uselibrary(specification) -- todo: reporter
if onlyonce then
loaded[filename] = true -- todo: base this on return value
end
- local done = false
- for i=1,#patterns do
- local somename = format(patterns[i],filename)
- if truename then
- somename = truename(somename)
+ local foundname = nil
+ local barename = removesuffix(filename)
+ -- direct search (we have an explicit suffix)
+ if barename ~= filename then
+ foundname = found(filename)
+ if trace_libraries then
+ report_library("checking %a: %s",filename,foundname or "not found")
end
- local foundname = resolvers.getreadfilename("any",".",somename) or ""
- if foundname ~= "" then
- action(name,foundname)
- done = true
- break
+ end
+ if not foundname then
+ -- pattern based search
+ for i=1,#patterns do
+ local wanted = format(patterns[i],barename)
+ foundname = found(wanted)
+ if trace_libraries then
+ report_library("checking %a as %a: %s",filename,wanted,foundname or "not found")
+ end
+ if foundname then
+ break
+ end
end
end
- if failure and not done then
+ if foundname then
+ action(name,foundname)
+ elseif failure then
failure(name)
end
end
diff --git a/tex/context/base/luat-cod.lua b/tex/context/base/luat-cod.lua
index c16a3b110..c436ee6d7 100644
--- a/tex/context/base/luat-cod.lua
+++ b/tex/context/base/luat-cod.lua
@@ -162,7 +162,7 @@ local function target_file(name)
return targetpath .. "/" .. name
end
-local function find_read_file (id,name)
+local function find_read_file(id,name)
return source_file(name)
end
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 8541081c8..469b8c6dd 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 5160a3765..92da8bdc0 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index a7b7b83d0..d82d95d6b 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/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 : 07/09/14 10:26:17
+-- merge date : 07/10/14 13:14:58
do -- begin closure to overcome local limits and interference