texlive[50573] trunk: context

commits+karl at tug.org commits+karl at tug.org
Sun Mar 24 22:21:33 CET 2019


Revision: 50573
          http://tug.org/svn/texlive?view=revision&revision=50573
Author:   karl
Date:     2019-03-24 22:21:32 +0100 (Sun, 24 Mar 2019)
Log Message:
-----------
context

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun
    trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl
    trunk/Master/bin/win32/mtxrun.lua
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-cs.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-de.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-en.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-fr.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-it.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-de.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-en.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-it.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-nl.pdf
    trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-ro.pdf
    trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
    trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-style.tex
    trunk/Master/texmf-dist/doc/man/man1/context.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/luatools.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-dvi.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-evohome.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-unicode.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/texexec.man1.pdf
    trunk/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf
    trunk/Master/texmf-dist/metapost/context/base/mpiv/mp-mlib.mpiv
    trunk/Master/texmf-dist/scripts/context/lua/mtx-bibtex.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtx-context.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtx-dvi.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtx-fcd.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtx-grep.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtx-install.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtx-tools.lua
    trunk/Master/texmf-dist/scripts/context/lua/mtxrun.lua
    trunk/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua
    trunk/Master/texmf-dist/scripts/context/stubs/unix/mtxrun
    trunk/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua
    trunk/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii
    trunk/Master/texmf-dist/tex/context/base/mkii/context.mkii
    trunk/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
    trunk/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
    trunk/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
    trunk/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
    trunk/Master/texmf-dist/tex/context/base/mkiv/font-one.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/l-file.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
    trunk/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/mtx-context-listing.tex
    trunk/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
    trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi
    trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi
    trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi
    trunk/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
    trunk/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
    trunk/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
    trunk/Master/texmf-dist/tex/context/base/mkiv/symb-ini.mkiv
    trunk/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-mime.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-socket.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
    trunk/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
    trunk/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf
    trunk/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf
    trunk/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua
    trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua
    trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/context/sample/third/aristotle-grc.tex
    trunk/Master/texmf-dist/tex/context/sample/third/capek-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/capek-vlnka-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/dequincey.tex
    trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-vlnka-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/kollar-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/kollar-vlnka-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/komensky-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/komensky-vlnka-cz.tex
    trunk/Master/texmf-dist/tex/context/sample/third/krdel-sk.tex
    trunk/Master/texmf-dist/tex/context/sample/third/kun-cz.tex

Modified: trunk/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Build/source/texk/texlive/linked_scripts/context/stubs/unix/mtxrun	2019-03-24 21:21:32 UTC (rev 50573)
@@ -194,7 +194,7 @@
 
 package.loaded["l-lua"] = package.loaded["l-lua"] or true
 
--- original size: 6281, stripped down to: 2863
+-- original size: 6330, stripped down to: 2831
 
 if not modules then modules={} end modules ['l-lua']={
  version=1.001,
@@ -312,7 +312,6 @@
  ffi.number=tonumber
 end
 if LUAVERSION>5.3 then
- collectgarbage("generational")
 end
 
 
@@ -3766,7 +3765,7 @@
 
 package.loaded["l-os"] = package.loaded["l-os"] or true
 
--- original size: 19347, stripped down to: 10258
+-- original size: 18916, stripped down to: 10126
 
 if not modules then modules={} end modules ['l-os']={
  version=1.001,
@@ -3933,16 +3932,6 @@
 function os.launch(str)
  execute(format(launchers[os.name] or launchers.unix,str))
 end
-if not os.times then
- function os.times()
-  return {
-   utime=os.gettimeofday(),
-   stime=0,
-   cutime=0,
-   cstime=0,
-  }
- end
-end
 local gettimeofday=os.gettimeofday or os.clock
 os.gettimeofday=gettimeofday
 local startuptime=gettimeofday()
@@ -4218,7 +4207,7 @@
 
 package.loaded["l-file"] = package.loaded["l-file"] or true
 
--- original size: 21804, stripped down to: 9980
+-- original size: 21984, stripped down to: 10148
 
 if not modules then modules={} end modules ['l-file']={
  version=1.001,
@@ -4398,41 +4387,46 @@
 function file.reslash(str)
  return str and lpegmatch(reslasher,str)
 end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
-  name=name.."/m_t_x_t_e_s_t.tmp"
-  local f=io.open(name,"wb")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+  if not name then
+  elseif lfs.isdir(name) then
+   name=name.."/m_t_x_t_e_s_t.tmp"
+   local f=io.open(name,"wb")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
+  elseif lfs.isfile(name) then
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    return true
+   end
+  else
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
   end
- elseif lfs.isfile(name) then
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   return true
+  return false
+ end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+  if name then
+   local a=attributes(name)
+   return a and lpegmatch(readable,a.permissions) or false
+  else
+   return false
   end
- else
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
-  end
  end
- return false
 end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
-  local a=attributes(name)
-  return a and lpegmatch(readable,a.permissions) or false
- else
-  return false
- end
-end
 file.isreadable=file.is_readable 
 file.iswritable=file.is_writable 
 function file.size(name)
@@ -5062,7 +5056,7 @@
 
 package.loaded["l-dir"] = package.loaded["l-dir"] or true
 
--- original size: 18002, stripped down to: 10681
+-- original size: 18253, stripped down to: 10816
 
 if not modules then modules={} end modules ['l-dir']={
  version=1.001,
@@ -5127,13 +5121,15 @@
   end
   local dirs
   local nofdirs=0
-  for name in walkdir(usedpath) do
+  for name,mode,size,time in walkdir(usedpath) do
    if name~="." and name~=".." then
     local full=path..name
-    local mode=attributes(full,'mode')
+    if mode==nil then
+     mode=attributes(full,'mode')
+    end
     if mode=='file' then
      if not patt or find(full,patt) then
-      action(full)
+      action(full,size,time)
      end
     elseif recurse and mode=="directory" then
      if dirs then
@@ -5169,10 +5165,12 @@
  local dirs
  local nofdirs=0
  local noffiles=#result
- for name,a in walkdir(usedpath) do
+ for name,mode in walkdir(usedpath) do
   if name~="." and name~=".." then
    local full=path..name
-   local mode=attributes(full,'mode')
+   if mode==nil then
+    mode=attributes(full,'mode')
+   end
    if mode=='file' then
     if not patt or find(full,patt) then
      noffiles=noffiles+1
@@ -5223,7 +5221,7 @@
   if not find(path,"/$") then
    path=path..'/'
   end
-  for name in scanner,first do
+  for name in scanner,first do 
    if name=="." then
    elseif name==".." then
    else
@@ -5314,10 +5312,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if recurse then
      globfiles(path.."/"..name,recurse,func,files)
@@ -5340,10 +5340,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if not func or func(name) then
      noffiles=noffiles+1
@@ -5524,8 +5526,7 @@
 function dir.push(newdir)
  local curdir=currentdir()
  insert(stack,curdir)
- if newdir and newdir~="" then
-  chdir(newdir)
+ if newdir and newdir~="" and chdir(newdir) then
   return newdir
  else
   return curdir
@@ -6466,7 +6467,7 @@
 
 package.loaded["util-str"] = package.loaded["util-str"] or true
 
--- original size: 43538, stripped down to: 21641
+-- original size: 43488, stripped down to: 21595
 
 if not modules then modules={} end modules ['util-str']={
  version=1.001,
@@ -6482,7 +6483,6 @@
 local load,dump=load,string.dump
 local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
 local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
 local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
 local patterns,lpegmatch=lpeg.patterns,lpeg.match
 local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -7307,7 +7307,7 @@
 
 package.loaded["util-tab"] = package.loaded["util-tab"] or true
 
--- original size: 28810, stripped down to: 16134
+-- original size: 28866, stripped down to: 16134
 
 if not modules then modules={} end modules ['util-tab']={
  version=1.001,
@@ -7971,7 +7971,7 @@
 
 package.loaded["util-fil"] = package.loaded["util-fil"] or true
 
--- original size: 8607, stripped down to: 6727
+-- original size: 11530, stripped down to: 9007
 
 if not modules then modules={} end modules ['util-fil']={
  version=1.001,
@@ -8180,6 +8180,32 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 else
  local floor=math.floor
  function files.writecardinal2(f,n)
@@ -8188,17 +8214,33 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
-end
 function files.writestring(f,s)
  f:write(char(byte(s,1,#s)))
 end
@@ -8210,10 +8252,18 @@
  files.readcardinal2=fio.readcardinal2
  files.readcardinal3=fio.readcardinal3
  files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
  files.readinteger1=fio.readinteger1
  files.readinteger2=fio.readinteger2
  files.readinteger3=fio.readinteger3
  files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
  files.readfixed2=fio.readfixed2
  files.readfixed4=fio.readfixed4
  files.read2dot14=fio.read2dot14
@@ -8234,6 +8284,24 @@
   skipposition(f,4*(n or 1))
  end
 end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
 if fio and fio.readcardinaltable then
  files.readcardinaltable=fio.readcardinaltable
  files.readintegertable=fio.readintegertable
@@ -8271,7 +8339,7 @@
 
 package.loaded["util-sac"] = package.loaded["util-sac"] or true
 
--- original size: 11065, stripped down to: 8209
+-- original size: 11332, stripped down to: 8420
 
 if not modules then modules={} end modules ['util-sac']={
  version=1.001,
@@ -8296,6 +8364,11 @@
   return { f,1,#f,zerobased or false }
  end
 end
+function streams.getstring(f)
+ if f then
+  return f[1]
+ end
+end
 function streams.close()
 end
 function streams.size(f)
@@ -8386,7 +8459,7 @@
  local a,b=byte(f[1],i,j)
  return 0x100*a+b
 end
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
  local i=f[2]
  local j=i+1
  f[2]=j+1
@@ -8458,6 +8531,13 @@
  local a,b,c,d=byte(f[1],i,j)
  return 0x1000000*a+0x10000*b+0x100*c+d
 end
+function streams.readcardinal4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
 function streams.readinteger4(f)
  local i=f[2]
  local j=i+3
@@ -9545,13 +9625,13 @@
 
 package.loaded["util-soc-imp-socket"] = package.loaded["util-soc-imp-socket"] or true
 
--- original size: 4870, stripped down to: 3527
+-- original size: 4905, stripped down to: 3562
 
 
 local type,tostring,setmetatable=type,tostring,setmetatable
 local min=math.min
 local format=string.format
-local socket=require("socket.core")
+local socket=socket or package.loaded.socket or require("socket.core")
 local connect=socket.connect
 local tcp4=socket.tcp4
 local tcp6=socket.tcp6
@@ -10734,12 +10814,12 @@
 
 package.loaded["util-soc-imp-mime"] = package.loaded["util-soc-imp-mime"] or true
 
--- original size: 2328, stripped down to: 1874
+-- original size: 2373, stripped down to: 1931
 
 
 local type,tostring=type,tostring
-local mime=require("mime.core")
-local ltn12=ltn12 or require("ltn12")
+local mime=mime  or package.loaded.mime  or require("mime.core")
+local ltn12=ltn12 or package.loaded.ltn12 or require("ltn12")
 local filtercycle=ltn12.filter.cycle
 local function report(fmt,first,...)
  if logs then
@@ -12691,7 +12771,7 @@
 
 package.loaded["trac-log"] = package.loaded["trac-log"] or true
 
--- original size: 32608, stripped down to: 20925
+-- original size: 32618, stripped down to: 20935
 
 if not modules then modules={} end modules ['trac-log']={
  version=1.001,
@@ -12736,7 +12816,7 @@
 setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
 local report,subreport,status,settarget,setformats,settranslations
 local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
-if runningtex then
+if runningtex and texio then
  if texio.setescape then
   texio.setescape(0) 
  end
@@ -15613,6 +15693,468 @@
 
 do -- create closure to overcome 200 locals limit
 
+package.loaded["util-zip"] = package.loaded["util-zip"] or true
+
+-- original size: 18645, stripped down to: 11291
+
+if not modules then modules={} end modules ['util-zip']={
+ version=1.001,
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local type,tostring,tonumber=type,tostring,tonumber
+local sort=table.sort
+local find,format,sub,gsub=string.find,string.format,string.sub,string.gsub
+local osdate,ostime=os.date,os.time
+local ioopen=io.open
+local loaddata,savedata=io.loaddata,io.savedata
+local filejoin,isdir,dirname,mkdirs=file.join,lfs.isdir,file.dirname,dir.mkdirs
+local files=utilities.files
+local openfile=files.open
+local closefile=files.close
+local readstring=files.readstring
+local readcardinal2=files.readcardinal2le
+local readcardinal4=files.readcardinal4le
+local setposition=files.setposition
+local getposition=files.getposition
+local band=bit32.band
+local rshift=bit32.rshift
+local lshift=bit32.lshift
+local decompress,calculatecrc
+if flate then
+ decompress=flate.flate_decompress
+ calculatecrc=flate.update_crc32
+else
+ local zlibdecompress=zlib.decompress
+ local zlibchecksum=zlib.crc32
+ decompress=function(source,targetsize)
+  local target=zlibdecompress(source,-15)
+  if target then
+   return target
+  else
+   return false,1
+  end
+ end
+ calculatecrc=function(buffer,initial)
+  return zlibchecksum(initial or 0,buffer)
+ end
+end
+local zipfiles={}
+utilities.zipfiles=zipfiles
+local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist  do
+ function openzipfile(name)
+  return {
+   name=name,
+   handle=openfile(name,0),
+  }
+ end
+ local function collect(z)
+  if not z.list then
+   local list={}
+   local hash={}
+   local position=0
+   local index=0
+   local handle=z.handle
+   while true do
+    setposition(handle,position)
+    local signature=readstring(handle,4)
+    if signature=="PK\3\4" then
+     local version=readcardinal2(handle)
+     local flag=readcardinal2(handle)
+     local method=readcardinal2(handle)
+     local filetime=readcardinal2(handle)
+     local filedate=readcardinal2(handle)
+     local crc32=readcardinal4(handle)
+     local compressed=readcardinal4(handle)
+     local uncompressed=readcardinal4(handle)
+     local namelength=readcardinal2(handle)
+     local extralength=readcardinal2(handle)
+     local filename=readstring(handle,namelength)
+     local descriptor=band(flag,8)~=0
+     local encrypted=band(flag,1)~=0
+     local acceptable=method==0 or method==8
+     local skipped=0
+     local size=0
+     if encrypted then
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      skipbytes(8)
+      skipped=skipped+8
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      size=readcardinal4(handle)
+      skipbytes(size)
+      skipped=skipped+size+4
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+     end
+     position=position+30+namelength+extralength+skipped
+     if descriptor then
+      setposition(handle,position+compressed)
+      crc32=readcardinal4(handle)
+      compressed=readcardinal4(handle)
+      uncompressed=readcardinal4(handle)
+     end
+     if acceptable then
+      index=index+1
+      local data={
+       filename=filename,
+       index=index,
+       position=position,
+       method=method,
+       compressed=compressed,
+       uncompressed=uncompressed,
+       crc32=crc32,
+       encrypted=encrypted,
+      }
+      hash[filename]=data
+      list[index]=data
+     else
+     end
+     position=position+compressed
+    else
+     break
+    end
+    z.list=list
+    z.hash=hash
+   end
+  end
+ end
+ function getziplist(z)
+  local list=z.list
+  if not list then
+   collect(z)
+  end
+  return z.list
+ end
+ function getziphash(z)
+  local hash=z.hash
+  if not hash then
+   collect(z)
+  end
+  return z.hash
+ end
+ function foundzipfile(z,name)
+  return getziphash(z)[name]
+ end
+ function closezipfile(z)
+  local f=z.handle
+  if f then
+   closefile(f)
+   z.handle=nil
+  end
+ end
+ function unzipfile(z,filename,check)
+  local hash=z.hash
+  if not hash then
+   hash=zipfiles.hash(z)
+  end
+  local data=hash[filename] 
+  if not data then
+  end
+  if data then
+   local handle=z.handle
+   local position=data.position
+   local compressed=data.compressed
+   if compressed>0 then
+    setposition(handle,position)
+    local result=readstring(handle,compressed)
+    if data.method==8 then
+     result=decompress(result,data.uncompressed)
+    end
+    if check and data.crc32~=calculatecrc(result) then
+     print("checksum mismatch")
+     return ""
+    end
+    return result
+   else
+    return ""
+   end
+  end
+ end
+ zipfiles.open=openzipfile
+ zipfiles.close=closezipfile
+ zipfiles.unzip=unzipfile
+ zipfiles.hash=getziphash
+ zipfiles.list=getziplist
+ zipfiles.found=foundzipfile
+end
+if flate then do
+ local writecardinal1=files.writebyte
+ local writecardinal2=files.writecardinal2le
+ local writecardinal4=files.writecardinal4le
+ local logwriter=logs.writer
+ local globpattern=dir.globpattern
+ local compress=flate.flate_compress
+ local checksum=flate.update_crc32
+ local function fromdostime(dostime,dosdate)
+  return ostime {
+   year=rshift(dosdate,9)+1980,
+   month=band(rshift(dosdate,5),0x0F),
+   day=band((dosdate   ),0x1F),
+   hour=band(rshift(dostime,11)    ),
+   min=band(rshift(dostime,5),0x3F),
+   sec=band((dostime   ),0x1F),
+  }
+ end
+ local function todostime(time)
+  local t=osdate("*t",time)
+  return
+   lshift(t.year-1980,9)+lshift(t.month,5)+t.day,
+   lshift(t.hour,11)+lshift(t.min,5)+rshift(t.sec,1)
+ end
+ local function openzip(filename,level,comment,verbose)
+  local f=ioopen(filename,"wb")
+  if f then
+   return {
+    filename=filename,
+    handle=f,
+    list={},
+    level=tonumber(level) or 3,
+    comment=tostring(comment),
+    verbose=verbose,
+    uncompressed=0,
+    compressed=0,
+   }
+  end
+ end
+ local function writezip(z,name,data,level,time)
+  local f=z.handle
+  local list=z.list
+  local level=tonumber(level) or z.level or 3
+  local method=8
+  local zipped=compress(data,level)
+  local checksum=checksum(data)
+  local verbose=z.verbose
+  if not zipped then
+   method=0
+   zipped=data
+  end
+  local start=f:seek()
+  local compressed=#zipped
+  local uncompressed=#data
+  z.compressed=z.compressed+compressed
+  z.uncompressed=z.uncompressed+uncompressed
+  if verbose then
+   local pct=100*compressed/uncompressed
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,name))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,name))
+   end
+  end
+  f:write("\x50\x4b\x03\x04")
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,method)    
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal4(f,checksum)  
+  writecardinal4(f,compressed)   
+  writecardinal4(f,uncompressed) 
+  writecardinal2(f,#name)  
+  writecardinal2(f,0)
+  f:write(name)      
+  f:write(zipped)
+  list[#list+1]={ #zipped,#data,name,checksum,start,time or 0 }
+ end
+ local function closezip(z)
+  local f=z.handle
+  local list=z.list
+  local comment=z.comment
+  local verbose=z.verbose
+  local count=#list
+  local start=f:seek()
+  for i=1,count do
+   local l=list[i]
+   local compressed=l[1]
+   local uncompressed=l[2]
+   local name=l[3]
+   local checksum=l[4]
+   local start=l[5]
+   local time=l[6]
+   local date,time=todostime(time)
+   f:write('\x50\x4b\x01\x02')
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,8)   
+   writecardinal2(f,time)   
+   writecardinal2(f,date)   
+   writecardinal4(f,checksum)  
+   writecardinal4(f,compressed)   
+   writecardinal4(f,uncompressed) 
+   writecardinal2(f,#name)  
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal4(f,0)   
+   writecardinal4(f,start)  
+   f:write(name)      
+  end
+  local stop=f:seek()
+  local size=stop-start
+  f:write('\x50\x4b\x05\x06')
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,count)  
+  writecardinal2(f,count)  
+  writecardinal4(f,size)   
+  writecardinal4(f,start)  
+  if type(comment)=="string" and comment~="" then
+   writecardinal2(f,#comment) 
+   f:write(comment)     
+  else
+   writecardinal2(f,0)
+  end
+  if verbose then
+   local compressed=z.compressed
+   local uncompressed=z.uncompressed
+   local filename=z.filename
+   local pct=100*compressed/uncompressed
+   logwriter("")
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,filename))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,filename))
+   end
+  end
+  f:close()
+ end
+ local function zipdir(zipname,path,level,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   level=zipname.level
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  if not isdir(path) then
+   return
+  end
+  path=gsub(path,"\\+","/")
+  path=gsub(path,"/+","/")
+  local list={}
+  local count=0
+  globpattern(path,"",true,function(name,size,time)
+   count=count+1
+   list[count]={ name,time }
+  end)
+  sort(list,function(a,b)
+   return a[1]<b[1]
+  end)
+  local zipf=openzip(zipname,level,comment,verbose)
+  if zipf then
+   local p=#path+2
+   for i=1,count do
+    local li=list[i]
+    local name=li[1]
+    local time=li[2]
+    local data=loaddata(name)
+    local name=sub(name,p,#name)
+    writezip(zipf,name,data,level,time,verbose)
+   end
+   closezip(zipf)
+  end
+ end
+ local function unzipdir(zipname,path,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  local z=openzipfile(zipname)
+  if z then
+   local list=getziplist(z)
+   if list then
+    local total=0
+    local count=#list
+    local step=number.idiv(count,10)
+    local done=0
+    for i=1,count do
+     local l=list[i]
+     local n=l.filename
+     local d=unzipfile(z,n) 
+     local p=filejoin(path,n)
+     if mkdirs(dirname(p)) then
+      if verbose=="steps" then
+       total=total+#d
+       done=done+1
+       if done>=step then
+        done=0
+        logwriter(format("%4i files of %4i done, %10i bytes",i,count,total))
+       end
+      elseif verbose then
+       logwriter(n)
+      end
+      savedata(p,d)
+     end
+    end
+    if verbose=="steps" then
+     logwriter(format("%4i files of %4i done, %10i bytes",count,count,total))
+    end
+    closezipfile(z)
+    return true
+   else
+    closezipfile(z)
+   end
+  end
+ end
+ zipfiles.zipdir=zipdir
+ zipfiles.unzipdir=unzipdir
+end end
+if flate then
+ local streams=utilities.streams
+ local openfile=streams.open
+ local closestream=streams.close
+ local setposition=streams.setposition
+ local getsize=streams.size
+ local readcardinal4=streams.readcardinal4le
+ local getstring=streams.getstring
+ local decompress=flate.gz_decompress
+ function zipfiles.gunzipfile(filename)
+  local strm=openfile(filename)
+  if strm then
+   setposition(strm,getsize(strm)-4+1)
+   local size=readcardinal4(strm)
+   local data=decompress(getstring(strm),size)
+   closestream(strm)
+   return data
+  end
+ end
+elseif gzip then
+ local openfile=gzip.open
+ function zipfiles.gunzipfile(filename)
+  local g=openfile(filename,"rb")
+  if g then
+   local d=g:read("*a")
+   d:close()
+   return d
+  end
+ end
+end
+
+
+end -- of closure
+
+do -- create closure to overcome 200 locals limit
+
 package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
 
 -- original size: 60383, stripped down to: 35698
@@ -20103,7 +20645,7 @@
 
 package.loaded["data-exp"] = package.loaded["data-exp"] or true
 
--- original size: 18105, stripped down to: 10389
+-- original size: 18154, stripped down to: 10416
 
 if not modules then modules={} end modules ['data-exp']={
  version=1.001,
@@ -20310,9 +20852,11 @@
  local pattern=tolerant and lessweird or weird
  local filelist={}
  local noffiles=0
- for name in directory(full) do
+ for name,mode in directory(full) do
   if not lpegmatch(pattern,name) then
-   local mode=attributes(full..name,"mode")
+   if not mode then
+    mode=attributes(full..name,"mode")
+   end
    if mode=="file" then
     n=n+1
     noffiles=noffiles+1
@@ -20793,7 +21337,7 @@
 
 package.loaded["data-tmp"] = package.loaded["data-tmp"] or true
 
--- original size: 16116, stripped down to: 10782
+-- original size: 16284, stripped down to: 10938
 
 if not modules then modules={} end modules ['data-tmp']={
  version=1.100,
@@ -20833,6 +21377,7 @@
 caches.ask=false
 caches.relocate=false
 caches.defaults={ "TMPDIR","TEMPDIR","TMP","TEMP","HOME","HOMEPATH" }
+directives.register("system.caches.fast",function(v) caches.fast=true end)
 local writable,readables,usedreadables=nil,{},{}
 local function identify()
  local texmfcaches=resolvers.cleanpathlist("TEXMFCACHE") 
@@ -21066,7 +21611,9 @@
 function caches.savedata(filepath,filename,data,raw)
  local tmaname,tmcname=caches.setluanames(filepath,filename)
  data.cache_uuid=os.uuid()
- if caches.direct then
+ if caches.fast then
+  file.savedata(tmaname,table.fastserialize(data,true))
+ elseif caches.direct then
   file.savedata(tmaname,table.serialize(data,true,saveoptions))
  else
   table.tofile(tmaname,data,true,saveoptions)
@@ -23400,7 +23947,7 @@
 
 package.loaded["data-zip"] = package.loaded["data-zip"] or true
 
--- original size: 8700, stripped down to: 6313
+-- original size: 10263, stripped down to: 7556
 
 if not modules then modules={} end modules ['data-zip']={
  version=1.001,
@@ -23419,6 +23966,65 @@
 zip.archives=archives
 local registeredfiles=zip.registeredfiles or {}
 zip.registeredfiles=registeredfiles
+local zipfiles=utilities.zipfiles
+local openzip,closezip,validfile,wholefile,filehandle,traversezip
+if zipfiles then
+ local ipairs=ipairs
+ openzip=zipfiles.open
+ closezip=zipfiles.close
+ validfile=zipfiles.found
+ wholefile=zipfiles.unzip
+ traversezip=function(zfile)
+  return ipairs(zipfiles.list(zfile))
+ end
+ local streams=utilities.streams
+ local openstream=streams.open
+ local readstring=streams.readstring
+ local streamsize=streams.size
+ local metatable={
+  close=streams.close,
+  read=function(stream,n)
+   readstring(stream,n=="*a" and streamsize(stream) or n)
+  end
+ }
+ filehandle=function(zfile,queryname)
+  local data=wholefile(zfile,queryname)
+  if data then
+   local stream=openstream(data)
+   if stream then
+    return setmetatableindex(stream,metatable)
+   end
+  end
+ end
+else
+ openzip=zip.open
+ closezip=zip.close
+ validfile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   dfile:close()
+   return true
+  end
+  return false
+ end
+ traversezip=function(zfile)
+  return z:files()
+ end
+ wholefile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   local s=dfile:read("*all")
+   dfile:close()
+   return s
+  end
+ end
+ filehandle=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   return dfile
+  end
+ end
+end
 local function validzip(str) 
  if not find(str,"^zip://") then
   return "zip:///"..str
@@ -23433,7 +24039,7 @@
   local arch=archives[name]
   if not arch then
      local full=resolvers.findfile(name) or ""
-     arch=full~="" and zip.open(full) or false
+     arch=full~="" and openzip(full) or false
      archives[name]=arch
   end
     return arch
@@ -23441,7 +24047,7 @@
 end
 function zip.closearchive(name)
  if not name or (name=="" and archives[name]) then
-  zip.close(archives[name])
+  closezip(archives[name])
   archives[name]=nil
  end
 end
@@ -23482,9 +24088,7 @@
     if trace_locating then
      report_zip("finder: archive %a found",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
-     dfile:close()
+    if validfile(zfile,queryname) then
      if trace_locating then
       report_zip("finder: file %a found",queryname)
      end
@@ -23514,12 +24118,12 @@
     if trace_locating then
      report_zip("opener; archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local handle=filehandle(zfile,queryname)
+    if handle then
      if trace_locating then
       report_zip("opener: file %a found",queryname)
      end
-     return resolvers.openers.helpers.textopener('zip',original,dfile)
+     return resolvers.openers.helpers.textopener('zip',original,handle)
     elseif trace_locating then
      report_zip("opener: file %a not found",queryname)
     end
@@ -23545,15 +24149,13 @@
     if trace_locating then
      report_zip("loader: archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local data=wholefile(zfile,queryname)
+    if data then
      logs.show_load(original)
      if trace_locating then
       report_zip("loader; file %a loaded",original)
      end
-     local s=dfile:read("*all")
-     dfile:close()
-     return true,s,#s
+     return true,data,#data
     elseif trace_locating then
      report_zip("loader: file %a not found",queryname)
     end
@@ -23600,7 +24202,7 @@
  if trace_locating then
   report_zip("registering: using filter %a",filter)
  end
- for i in z:files() do
+ for i in traversezip(z) do
   local filename=i.filename
   local path,name=match(filename,filter)
   if not path then
@@ -24734,7 +25336,7 @@
 
 package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true
 
--- original size: 9418, stripped down to: 7087
+-- original size: 9637, stripped down to: 7253
 
 if not modules then modules={} end modules ['luat-fmt']={
  version=1.001,
@@ -24804,6 +25406,13 @@
   checkers=checkers,
   reporter=report_format,
  },
+ luametatex=sandbox.registerrunner {
+  name="make luametatex format",
+  program="luametatex",
+  template=template,
+  checkers=checkers,
+  reporter=report_format,
+ },
  luajittex=sandbox.registerrunner {
   name="make luajittex format",
   program="luajittex",
@@ -24971,10 +25580,10 @@
 
 end -- of closure
 
--- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.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
+-- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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    : 995501
--- stripped bytes    : 395318
+-- original bytes    : 1019480
+-- stripped bytes    : 403728
 
 -- end library merge
 
@@ -25055,6 +25664,8 @@
     'util-env.lua',
     'luat-env.lua', -- can come before inf (as in mkiv)
 
+    'util-zip.lua',
+
     'lxml-tab.lua',
     'lxml-lpt.lua',
  -- 'lxml-ent.lua',

Modified: trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl	2019-03-24 21:21:32 UTC (rev 50573)
@@ -10,7 +10,8 @@
 # security: disable send
 catch {rename send {}}
 
-# make sure TL comes first on process searchpath
+# unix: make sure TL comes first on process searchpath
+# on windows, runscript takes care of this.
 if {$::tcl_platform(platform) ne "windows"} {
   set texbin [file dirname [file normalize [info script]]]
   set savedir [pwd]
@@ -26,6 +27,18 @@
   unset texbin
   unset savedir
   unset dirs
+} else {
+  # until we have a better wrapper, just hardcode stuff
+  set texbin [file dirname [file normalize [info script]]]
+  set texbin "$texbin\\..\\..\\..\\bin\\win32"
+  set texbin [file normalize $texbin]
+  set texbin [string map {/ \\} $texbin]
+  set dirs [split $::env(PATH) ";"]
+  if {[lindex $dirs 0] ne $texbin} {
+    set ::env(PATH) "${texbin};$::env(PATH)"
+  }
+  unset texbin
+  unset dirs
 }
 
 # declarations and utilities shared with install-tl-gui.tcl
@@ -354,9 +367,13 @@
 } ; # start_tlmgr
 
 proc close_tlmgr {} {
-  catch {chan close $::tlshl}
-  catch {chan close $::err}
-  set ::perlpid 0
+  if {[catch {chan close $::tlshl}] || [catch {chan close $::err}]} {
+    tk_messageBox -message [get_stacktrace]
+    return 0
+  } else {
+    set ::perlpid 0
+    return 1
+  }
 }; # close_tlmgr
 
 # read a line of tlmgr output
@@ -541,11 +558,11 @@
 
   # also update displayed status info
   if {$::have_remote && $::need_update_tlmgr} {
-    .topf.luptodate configure -text [__ "Needs updating"]
+    .topfl.luptodate configure -text [__ "Needs updating"]
   } elseif $::have_remote {
-    .topf.luptodate configure -text [__ "Up to date"]
+    .topfl.luptodate configure -text [__ "Up to date"]
   } else {
-    .topf.luptodate configure -text [__ "Unknown"]
+    .topfl.luptodate configure -text [__ "Unknown"]
   }
   # ... and status of update buttons
   selective_dis_enable
@@ -732,7 +749,7 @@
   }
   get_platforms
   set ::have_remote 1
-  .topf.loaded configure -text [__ "Loaded"] -foreground black
+  .topfl.loaded configure -text [__ "Loaded"] -foreground black
   update_globals
   return 1
 } ; # get_packages_info_remote
@@ -1079,7 +1096,7 @@
   }
   if $changes {
     set_repos_in_tlmgr
-    .topf.lrepos configure -text [print_repos]
+    .topfl.lrepos configure -text [print_repos]
     close_tlmgr
     start_tlmgr
     # reload remote package information
@@ -1506,22 +1523,26 @@
 
 ##### package-related #####
 
+proc update_self_q {} {
+  set ans [tk_messageBox -type okcancel -icon info -message \
+      [string cat [__ "If update fails, try on a command-line:"] \
+         "\ntlmgr update --self\n" \
+         [__ "Use an admininstrative command prompt for an admin install."]]]
+  return [$ans eq ok]
+}
+
 proc update_tlmgr {} {
   if {! $::need_update_tlmgr} {
     tk_messageBox -message [__ "Nothing to do!"]
     return
   }
-  if {$::tcl_platform(platform) eq "windows"} {
-    set ans [tk_messageBox -type okcancel -icon info -message \
-        [string cat [__ "If update fails, try on a command-line:"] \
-           "\ntlmgr update --self\n" \
-             [__ "Use an administrative command prompt for an admin install."]]]
-    if {$ans eq "cancel"} return
-  }
+  if {$::tcl_platform(platform) eq "windows" && ! [update_self_q]} return
   run_cmd "update --self" 1
   vwait ::done_waiting
   # tlmgr restarts itself automatically
   update_local_revnumbers
+  .topfr.linfra configure -text \
+      "tlmgr: r[dict get $::pkgs texlive.infra localrev]"
   collect_filtered
 } ; # update_tlmgr
 
@@ -2044,36 +2065,44 @@
       -in .endbuttons -side right
   ppack [ttk::button .r -text [__ "Restart self"] -command restart_self] \
       -in .endbuttons -side right
-  ppack [ttk::button .t -text [__ "Restart tlmgr"] \
-             -command {close_tlmgr; start_tlmgr}] \
-      -in .endbuttons -side right
+  # ppack [ttk::button .t -text [__ "Restart tlmgr"] \
+  #            -command {close_tlmgr; start_tlmgr}] \
+  #     -in .endbuttons -side right
   ttk::button .showlogs -text [__ "Show logs"] -command show_logs
   ppack .showlogs -in .endbuttons -side right
 
   # various info
-  # frame .topf -background white -borderwidth 2 -relief sunken
   ppack [ttk::frame .topf] -in .bg -side top -anchor w -fill x
-  pack [ttk::separator .sp -orient horizontal] \
-      -in .bg -side top -fill x -pady 6
 
-  ttk::label .topf.llrepo -text [__ "Default repositories"] -anchor w
-  pgrid .topf.llrepo -row 0 -column 0 -sticky nw
-  ttk::label .topf.lrepos -text "" -justify left -anchor w
-  pgrid .topf.lrepos -row 0 -column 1 -sticky nw
-  ttk::label .topf.loaded -text [__ "Not loaded"] -foreground red -anchor w
-  pgrid .topf.loaded -row 1 -column 1 -sticky w
+  # left frame
+  ppack [ttk::frame .topfl] -in .topf -side left -anchor nw
 
-  ttk::label .topf.lluptodate -text [__ "TL Manager up to date?"] -anchor w
-  pgrid .topf.lluptodate -row 2 -column 0 -sticky w
-  ttk::label .topf.luptodate -text [__ "Unknown"] -anchor w
-  pgrid .topf.luptodate -row 2 -column 1 -sticky w
+  ttk::label .topfl.llrepo -text [__ "Default repositories"] -anchor w
+  pgrid .topfl.llrepo -row 0 -column 0 -sticky nw
+  ttk::label .topfl.lrepos -text "" -justify left -anchor w
+  pgrid .topfl.lrepos -row 0 -column 1 -sticky nw
+  ttk::label .topfl.loaded -text [__ "Not loaded"] -foreground red -anchor w
+  pgrid .topfl.loaded -row 1 -column 1 -sticky w
 
-  ttk::label .topf.llcmd -anchor w -text [__ "Last tlmgr command:"] -anchor w \
+  ttk::label .topfl.lluptodate -text [__ "TL Manager up to date?"] -anchor w
+  pgrid .topfl.lluptodate -row 2 -column 0 -sticky w
+  ttk::label .topfl.luptodate -text [__ "Unknown"] -anchor w
+  pgrid .topfl.luptodate -row 2 -column 1 -sticky w
+
+  ttk::label .topfl.llcmd -text [__ "Last tlmgr command:"] -anchor w \
       -wraplength [expr {60*$::cw}] -justify left
-  pgrid .topf.llcmd -row 3 -column 0 -sticky w
-  ttk::label .topf.lcmd -anchor w -textvariable ::last_cmd -anchor w
-  pgrid .topf.lcmd -row 3 -column 1 -sticky w
+  pgrid .topfl.llcmd -row 3 -column 0 -sticky w
+  ttk::label .topfl.lcmd -textvariable ::last_cmd -anchor w
+  pgrid .topfl.lcmd -row 3 -column 1 -sticky w
 
+  # right frame
+  ppack [ttk::frame .topfr] -in .topf -side right -anchor ne
+  pack [ttk::label .topfr.linfra -text "some"] -side top -anchor e
+  pack [ttk::label .topfr.lshell -text "more"] -side top -anchor e
+
+  pack [ttk::separator .sp -orient horizontal] \
+      -in .bg -side top -fill x -pady 6
+
   # package list
   ttk::label .lpack -text [__ "Package list"] -font TkHeadingFont -anchor w
   pack .lpack -in .bg -side top -padx 3 -pady [list 15 3] -fill x
@@ -2263,8 +2292,13 @@
 
   start_tlmgr
   get_repos_from_tlmgr
-  .topf.lrepos configure -text [print_repos]
+  .topfl.lrepos configure -text [print_repos]
   get_packages_info_local
+  # svns for  tlmgr and tlshell
+  .topfr.linfra configure -text \
+      "tlmgr: r[dict get $::pkgs texlive.infra localrev]"
+  .topfr.lshell configure -text \
+      "tlshell: r[dict get $::pkgs tlshell localrev]"
   collect_filtered ; # invokes display_packages_info
   selective_dis_enable
 }; # initialize

Modified: trunk/Master/bin/win32/mtxrun.lua
===================================================================
--- trunk/Master/bin/win32/mtxrun.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/bin/win32/mtxrun.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -194,7 +194,7 @@
 
 package.loaded["l-lua"] = package.loaded["l-lua"] or true
 
--- original size: 6281, stripped down to: 2863
+-- original size: 6330, stripped down to: 2831
 
 if not modules then modules={} end modules ['l-lua']={
  version=1.001,
@@ -312,7 +312,6 @@
  ffi.number=tonumber
 end
 if LUAVERSION>5.3 then
- collectgarbage("generational")
 end
 
 
@@ -3766,7 +3765,7 @@
 
 package.loaded["l-os"] = package.loaded["l-os"] or true
 
--- original size: 19347, stripped down to: 10258
+-- original size: 18916, stripped down to: 10126
 
 if not modules then modules={} end modules ['l-os']={
  version=1.001,
@@ -3933,16 +3932,6 @@
 function os.launch(str)
  execute(format(launchers[os.name] or launchers.unix,str))
 end
-if not os.times then
- function os.times()
-  return {
-   utime=os.gettimeofday(),
-   stime=0,
-   cutime=0,
-   cstime=0,
-  }
- end
-end
 local gettimeofday=os.gettimeofday or os.clock
 os.gettimeofday=gettimeofday
 local startuptime=gettimeofday()
@@ -4218,7 +4207,7 @@
 
 package.loaded["l-file"] = package.loaded["l-file"] or true
 
--- original size: 21804, stripped down to: 9980
+-- original size: 21984, stripped down to: 10148
 
 if not modules then modules={} end modules ['l-file']={
  version=1.001,
@@ -4398,41 +4387,46 @@
 function file.reslash(str)
  return str and lpegmatch(reslasher,str)
 end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
-  name=name.."/m_t_x_t_e_s_t.tmp"
-  local f=io.open(name,"wb")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+  if not name then
+  elseif lfs.isdir(name) then
+   name=name.."/m_t_x_t_e_s_t.tmp"
+   local f=io.open(name,"wb")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
+  elseif lfs.isfile(name) then
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    return true
+   end
+  else
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
   end
- elseif lfs.isfile(name) then
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   return true
+  return false
+ end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+  if name then
+   local a=attributes(name)
+   return a and lpegmatch(readable,a.permissions) or false
+  else
+   return false
   end
- else
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
-  end
  end
- return false
 end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
-  local a=attributes(name)
-  return a and lpegmatch(readable,a.permissions) or false
- else
-  return false
- end
-end
 file.isreadable=file.is_readable 
 file.iswritable=file.is_writable 
 function file.size(name)
@@ -5062,7 +5056,7 @@
 
 package.loaded["l-dir"] = package.loaded["l-dir"] or true
 
--- original size: 18002, stripped down to: 10681
+-- original size: 18253, stripped down to: 10816
 
 if not modules then modules={} end modules ['l-dir']={
  version=1.001,
@@ -5127,13 +5121,15 @@
   end
   local dirs
   local nofdirs=0
-  for name in walkdir(usedpath) do
+  for name,mode,size,time in walkdir(usedpath) do
    if name~="." and name~=".." then
     local full=path..name
-    local mode=attributes(full,'mode')
+    if mode==nil then
+     mode=attributes(full,'mode')
+    end
     if mode=='file' then
      if not patt or find(full,patt) then
-      action(full)
+      action(full,size,time)
      end
     elseif recurse and mode=="directory" then
      if dirs then
@@ -5169,10 +5165,12 @@
  local dirs
  local nofdirs=0
  local noffiles=#result
- for name,a in walkdir(usedpath) do
+ for name,mode in walkdir(usedpath) do
   if name~="." and name~=".." then
    local full=path..name
-   local mode=attributes(full,'mode')
+   if mode==nil then
+    mode=attributes(full,'mode')
+   end
    if mode=='file' then
     if not patt or find(full,patt) then
      noffiles=noffiles+1
@@ -5223,7 +5221,7 @@
   if not find(path,"/$") then
    path=path..'/'
   end
-  for name in scanner,first do
+  for name in scanner,first do 
    if name=="." then
    elseif name==".." then
    else
@@ -5314,10 +5312,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if recurse then
      globfiles(path.."/"..name,recurse,func,files)
@@ -5340,10 +5340,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if not func or func(name) then
      noffiles=noffiles+1
@@ -5524,8 +5526,7 @@
 function dir.push(newdir)
  local curdir=currentdir()
  insert(stack,curdir)
- if newdir and newdir~="" then
-  chdir(newdir)
+ if newdir and newdir~="" and chdir(newdir) then
   return newdir
  else
   return curdir
@@ -6466,7 +6467,7 @@
 
 package.loaded["util-str"] = package.loaded["util-str"] or true
 
--- original size: 43538, stripped down to: 21641
+-- original size: 43488, stripped down to: 21595
 
 if not modules then modules={} end modules ['util-str']={
  version=1.001,
@@ -6482,7 +6483,6 @@
 local load,dump=load,string.dump
 local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
 local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
 local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
 local patterns,lpegmatch=lpeg.patterns,lpeg.match
 local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -7307,7 +7307,7 @@
 
 package.loaded["util-tab"] = package.loaded["util-tab"] or true
 
--- original size: 28810, stripped down to: 16134
+-- original size: 28866, stripped down to: 16134
 
 if not modules then modules={} end modules ['util-tab']={
  version=1.001,
@@ -7971,7 +7971,7 @@
 
 package.loaded["util-fil"] = package.loaded["util-fil"] or true
 
--- original size: 8607, stripped down to: 6727
+-- original size: 11530, stripped down to: 9007
 
 if not modules then modules={} end modules ['util-fil']={
  version=1.001,
@@ -8180,6 +8180,32 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 else
  local floor=math.floor
  function files.writecardinal2(f,n)
@@ -8188,17 +8214,33 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
-end
 function files.writestring(f,s)
  f:write(char(byte(s,1,#s)))
 end
@@ -8210,10 +8252,18 @@
  files.readcardinal2=fio.readcardinal2
  files.readcardinal3=fio.readcardinal3
  files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
  files.readinteger1=fio.readinteger1
  files.readinteger2=fio.readinteger2
  files.readinteger3=fio.readinteger3
  files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
  files.readfixed2=fio.readfixed2
  files.readfixed4=fio.readfixed4
  files.read2dot14=fio.read2dot14
@@ -8234,6 +8284,24 @@
   skipposition(f,4*(n or 1))
  end
 end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
 if fio and fio.readcardinaltable then
  files.readcardinaltable=fio.readcardinaltable
  files.readintegertable=fio.readintegertable
@@ -8271,7 +8339,7 @@
 
 package.loaded["util-sac"] = package.loaded["util-sac"] or true
 
--- original size: 11065, stripped down to: 8209
+-- original size: 11332, stripped down to: 8420
 
 if not modules then modules={} end modules ['util-sac']={
  version=1.001,
@@ -8296,6 +8364,11 @@
   return { f,1,#f,zerobased or false }
  end
 end
+function streams.getstring(f)
+ if f then
+  return f[1]
+ end
+end
 function streams.close()
 end
 function streams.size(f)
@@ -8386,7 +8459,7 @@
  local a,b=byte(f[1],i,j)
  return 0x100*a+b
 end
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
  local i=f[2]
  local j=i+1
  f[2]=j+1
@@ -8458,6 +8531,13 @@
  local a,b,c,d=byte(f[1],i,j)
  return 0x1000000*a+0x10000*b+0x100*c+d
 end
+function streams.readcardinal4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
 function streams.readinteger4(f)
  local i=f[2]
  local j=i+3
@@ -9545,13 +9625,13 @@
 
 package.loaded["util-soc-imp-socket"] = package.loaded["util-soc-imp-socket"] or true
 
--- original size: 4870, stripped down to: 3527
+-- original size: 4905, stripped down to: 3562
 
 
 local type,tostring,setmetatable=type,tostring,setmetatable
 local min=math.min
 local format=string.format
-local socket=require("socket.core")
+local socket=socket or package.loaded.socket or require("socket.core")
 local connect=socket.connect
 local tcp4=socket.tcp4
 local tcp6=socket.tcp6
@@ -10734,12 +10814,12 @@
 
 package.loaded["util-soc-imp-mime"] = package.loaded["util-soc-imp-mime"] or true
 
--- original size: 2328, stripped down to: 1874
+-- original size: 2373, stripped down to: 1931
 
 
 local type,tostring=type,tostring
-local mime=require("mime.core")
-local ltn12=ltn12 or require("ltn12")
+local mime=mime  or package.loaded.mime  or require("mime.core")
+local ltn12=ltn12 or package.loaded.ltn12 or require("ltn12")
 local filtercycle=ltn12.filter.cycle
 local function report(fmt,first,...)
  if logs then
@@ -12691,7 +12771,7 @@
 
 package.loaded["trac-log"] = package.loaded["trac-log"] or true
 
--- original size: 32608, stripped down to: 20925
+-- original size: 32618, stripped down to: 20935
 
 if not modules then modules={} end modules ['trac-log']={
  version=1.001,
@@ -12736,7 +12816,7 @@
 setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
 local report,subreport,status,settarget,setformats,settranslations
 local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
-if runningtex then
+if runningtex and texio then
  if texio.setescape then
   texio.setescape(0) 
  end
@@ -15613,6 +15693,468 @@
 
 do -- create closure to overcome 200 locals limit
 
+package.loaded["util-zip"] = package.loaded["util-zip"] or true
+
+-- original size: 18645, stripped down to: 11291
+
+if not modules then modules={} end modules ['util-zip']={
+ version=1.001,
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local type,tostring,tonumber=type,tostring,tonumber
+local sort=table.sort
+local find,format,sub,gsub=string.find,string.format,string.sub,string.gsub
+local osdate,ostime=os.date,os.time
+local ioopen=io.open
+local loaddata,savedata=io.loaddata,io.savedata
+local filejoin,isdir,dirname,mkdirs=file.join,lfs.isdir,file.dirname,dir.mkdirs
+local files=utilities.files
+local openfile=files.open
+local closefile=files.close
+local readstring=files.readstring
+local readcardinal2=files.readcardinal2le
+local readcardinal4=files.readcardinal4le
+local setposition=files.setposition
+local getposition=files.getposition
+local band=bit32.band
+local rshift=bit32.rshift
+local lshift=bit32.lshift
+local decompress,calculatecrc
+if flate then
+ decompress=flate.flate_decompress
+ calculatecrc=flate.update_crc32
+else
+ local zlibdecompress=zlib.decompress
+ local zlibchecksum=zlib.crc32
+ decompress=function(source,targetsize)
+  local target=zlibdecompress(source,-15)
+  if target then
+   return target
+  else
+   return false,1
+  end
+ end
+ calculatecrc=function(buffer,initial)
+  return zlibchecksum(initial or 0,buffer)
+ end
+end
+local zipfiles={}
+utilities.zipfiles=zipfiles
+local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist  do
+ function openzipfile(name)
+  return {
+   name=name,
+   handle=openfile(name,0),
+  }
+ end
+ local function collect(z)
+  if not z.list then
+   local list={}
+   local hash={}
+   local position=0
+   local index=0
+   local handle=z.handle
+   while true do
+    setposition(handle,position)
+    local signature=readstring(handle,4)
+    if signature=="PK\3\4" then
+     local version=readcardinal2(handle)
+     local flag=readcardinal2(handle)
+     local method=readcardinal2(handle)
+     local filetime=readcardinal2(handle)
+     local filedate=readcardinal2(handle)
+     local crc32=readcardinal4(handle)
+     local compressed=readcardinal4(handle)
+     local uncompressed=readcardinal4(handle)
+     local namelength=readcardinal2(handle)
+     local extralength=readcardinal2(handle)
+     local filename=readstring(handle,namelength)
+     local descriptor=band(flag,8)~=0
+     local encrypted=band(flag,1)~=0
+     local acceptable=method==0 or method==8
+     local skipped=0
+     local size=0
+     if encrypted then
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      skipbytes(8)
+      skipped=skipped+8
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      size=readcardinal4(handle)
+      skipbytes(size)
+      skipped=skipped+size+4
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+     end
+     position=position+30+namelength+extralength+skipped
+     if descriptor then
+      setposition(handle,position+compressed)
+      crc32=readcardinal4(handle)
+      compressed=readcardinal4(handle)
+      uncompressed=readcardinal4(handle)
+     end
+     if acceptable then
+      index=index+1
+      local data={
+       filename=filename,
+       index=index,
+       position=position,
+       method=method,
+       compressed=compressed,
+       uncompressed=uncompressed,
+       crc32=crc32,
+       encrypted=encrypted,
+      }
+      hash[filename]=data
+      list[index]=data
+     else
+     end
+     position=position+compressed
+    else
+     break
+    end
+    z.list=list
+    z.hash=hash
+   end
+  end
+ end
+ function getziplist(z)
+  local list=z.list
+  if not list then
+   collect(z)
+  end
+  return z.list
+ end
+ function getziphash(z)
+  local hash=z.hash
+  if not hash then
+   collect(z)
+  end
+  return z.hash
+ end
+ function foundzipfile(z,name)
+  return getziphash(z)[name]
+ end
+ function closezipfile(z)
+  local f=z.handle
+  if f then
+   closefile(f)
+   z.handle=nil
+  end
+ end
+ function unzipfile(z,filename,check)
+  local hash=z.hash
+  if not hash then
+   hash=zipfiles.hash(z)
+  end
+  local data=hash[filename] 
+  if not data then
+  end
+  if data then
+   local handle=z.handle
+   local position=data.position
+   local compressed=data.compressed
+   if compressed>0 then
+    setposition(handle,position)
+    local result=readstring(handle,compressed)
+    if data.method==8 then
+     result=decompress(result,data.uncompressed)
+    end
+    if check and data.crc32~=calculatecrc(result) then
+     print("checksum mismatch")
+     return ""
+    end
+    return result
+   else
+    return ""
+   end
+  end
+ end
+ zipfiles.open=openzipfile
+ zipfiles.close=closezipfile
+ zipfiles.unzip=unzipfile
+ zipfiles.hash=getziphash
+ zipfiles.list=getziplist
+ zipfiles.found=foundzipfile
+end
+if flate then do
+ local writecardinal1=files.writebyte
+ local writecardinal2=files.writecardinal2le
+ local writecardinal4=files.writecardinal4le
+ local logwriter=logs.writer
+ local globpattern=dir.globpattern
+ local compress=flate.flate_compress
+ local checksum=flate.update_crc32
+ local function fromdostime(dostime,dosdate)
+  return ostime {
+   year=rshift(dosdate,9)+1980,
+   month=band(rshift(dosdate,5),0x0F),
+   day=band((dosdate   ),0x1F),
+   hour=band(rshift(dostime,11)    ),
+   min=band(rshift(dostime,5),0x3F),
+   sec=band((dostime   ),0x1F),
+  }
+ end
+ local function todostime(time)
+  local t=osdate("*t",time)
+  return
+   lshift(t.year-1980,9)+lshift(t.month,5)+t.day,
+   lshift(t.hour,11)+lshift(t.min,5)+rshift(t.sec,1)
+ end
+ local function openzip(filename,level,comment,verbose)
+  local f=ioopen(filename,"wb")
+  if f then
+   return {
+    filename=filename,
+    handle=f,
+    list={},
+    level=tonumber(level) or 3,
+    comment=tostring(comment),
+    verbose=verbose,
+    uncompressed=0,
+    compressed=0,
+   }
+  end
+ end
+ local function writezip(z,name,data,level,time)
+  local f=z.handle
+  local list=z.list
+  local level=tonumber(level) or z.level or 3
+  local method=8
+  local zipped=compress(data,level)
+  local checksum=checksum(data)
+  local verbose=z.verbose
+  if not zipped then
+   method=0
+   zipped=data
+  end
+  local start=f:seek()
+  local compressed=#zipped
+  local uncompressed=#data
+  z.compressed=z.compressed+compressed
+  z.uncompressed=z.uncompressed+uncompressed
+  if verbose then
+   local pct=100*compressed/uncompressed
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,name))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,name))
+   end
+  end
+  f:write("\x50\x4b\x03\x04")
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,method)    
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal4(f,checksum)  
+  writecardinal4(f,compressed)   
+  writecardinal4(f,uncompressed) 
+  writecardinal2(f,#name)  
+  writecardinal2(f,0)
+  f:write(name)      
+  f:write(zipped)
+  list[#list+1]={ #zipped,#data,name,checksum,start,time or 0 }
+ end
+ local function closezip(z)
+  local f=z.handle
+  local list=z.list
+  local comment=z.comment
+  local verbose=z.verbose
+  local count=#list
+  local start=f:seek()
+  for i=1,count do
+   local l=list[i]
+   local compressed=l[1]
+   local uncompressed=l[2]
+   local name=l[3]
+   local checksum=l[4]
+   local start=l[5]
+   local time=l[6]
+   local date,time=todostime(time)
+   f:write('\x50\x4b\x01\x02')
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,8)   
+   writecardinal2(f,time)   
+   writecardinal2(f,date)   
+   writecardinal4(f,checksum)  
+   writecardinal4(f,compressed)   
+   writecardinal4(f,uncompressed) 
+   writecardinal2(f,#name)  
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal4(f,0)   
+   writecardinal4(f,start)  
+   f:write(name)      
+  end
+  local stop=f:seek()
+  local size=stop-start
+  f:write('\x50\x4b\x05\x06')
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,count)  
+  writecardinal2(f,count)  
+  writecardinal4(f,size)   
+  writecardinal4(f,start)  
+  if type(comment)=="string" and comment~="" then
+   writecardinal2(f,#comment) 
+   f:write(comment)     
+  else
+   writecardinal2(f,0)
+  end
+  if verbose then
+   local compressed=z.compressed
+   local uncompressed=z.uncompressed
+   local filename=z.filename
+   local pct=100*compressed/uncompressed
+   logwriter("")
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,filename))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,filename))
+   end
+  end
+  f:close()
+ end
+ local function zipdir(zipname,path,level,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   level=zipname.level
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  if not isdir(path) then
+   return
+  end
+  path=gsub(path,"\\+","/")
+  path=gsub(path,"/+","/")
+  local list={}
+  local count=0
+  globpattern(path,"",true,function(name,size,time)
+   count=count+1
+   list[count]={ name,time }
+  end)
+  sort(list,function(a,b)
+   return a[1]<b[1]
+  end)
+  local zipf=openzip(zipname,level,comment,verbose)
+  if zipf then
+   local p=#path+2
+   for i=1,count do
+    local li=list[i]
+    local name=li[1]
+    local time=li[2]
+    local data=loaddata(name)
+    local name=sub(name,p,#name)
+    writezip(zipf,name,data,level,time,verbose)
+   end
+   closezip(zipf)
+  end
+ end
+ local function unzipdir(zipname,path,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  local z=openzipfile(zipname)
+  if z then
+   local list=getziplist(z)
+   if list then
+    local total=0
+    local count=#list
+    local step=number.idiv(count,10)
+    local done=0
+    for i=1,count do
+     local l=list[i]
+     local n=l.filename
+     local d=unzipfile(z,n) 
+     local p=filejoin(path,n)
+     if mkdirs(dirname(p)) then
+      if verbose=="steps" then
+       total=total+#d
+       done=done+1
+       if done>=step then
+        done=0
+        logwriter(format("%4i files of %4i done, %10i bytes",i,count,total))
+       end
+      elseif verbose then
+       logwriter(n)
+      end
+      savedata(p,d)
+     end
+    end
+    if verbose=="steps" then
+     logwriter(format("%4i files of %4i done, %10i bytes",count,count,total))
+    end
+    closezipfile(z)
+    return true
+   else
+    closezipfile(z)
+   end
+  end
+ end
+ zipfiles.zipdir=zipdir
+ zipfiles.unzipdir=unzipdir
+end end
+if flate then
+ local streams=utilities.streams
+ local openfile=streams.open
+ local closestream=streams.close
+ local setposition=streams.setposition
+ local getsize=streams.size
+ local readcardinal4=streams.readcardinal4le
+ local getstring=streams.getstring
+ local decompress=flate.gz_decompress
+ function zipfiles.gunzipfile(filename)
+  local strm=openfile(filename)
+  if strm then
+   setposition(strm,getsize(strm)-4+1)
+   local size=readcardinal4(strm)
+   local data=decompress(getstring(strm),size)
+   closestream(strm)
+   return data
+  end
+ end
+elseif gzip then
+ local openfile=gzip.open
+ function zipfiles.gunzipfile(filename)
+  local g=openfile(filename,"rb")
+  if g then
+   local d=g:read("*a")
+   d:close()
+   return d
+  end
+ end
+end
+
+
+end -- of closure
+
+do -- create closure to overcome 200 locals limit
+
 package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
 
 -- original size: 60383, stripped down to: 35698
@@ -20103,7 +20645,7 @@
 
 package.loaded["data-exp"] = package.loaded["data-exp"] or true
 
--- original size: 18105, stripped down to: 10389
+-- original size: 18154, stripped down to: 10416
 
 if not modules then modules={} end modules ['data-exp']={
  version=1.001,
@@ -20310,9 +20852,11 @@
  local pattern=tolerant and lessweird or weird
  local filelist={}
  local noffiles=0
- for name in directory(full) do
+ for name,mode in directory(full) do
   if not lpegmatch(pattern,name) then
-   local mode=attributes(full..name,"mode")
+   if not mode then
+    mode=attributes(full..name,"mode")
+   end
    if mode=="file" then
     n=n+1
     noffiles=noffiles+1
@@ -20793,7 +21337,7 @@
 
 package.loaded["data-tmp"] = package.loaded["data-tmp"] or true
 
--- original size: 16116, stripped down to: 10782
+-- original size: 16284, stripped down to: 10938
 
 if not modules then modules={} end modules ['data-tmp']={
  version=1.100,
@@ -20833,6 +21377,7 @@
 caches.ask=false
 caches.relocate=false
 caches.defaults={ "TMPDIR","TEMPDIR","TMP","TEMP","HOME","HOMEPATH" }
+directives.register("system.caches.fast",function(v) caches.fast=true end)
 local writable,readables,usedreadables=nil,{},{}
 local function identify()
  local texmfcaches=resolvers.cleanpathlist("TEXMFCACHE") 
@@ -21066,7 +21611,9 @@
 function caches.savedata(filepath,filename,data,raw)
  local tmaname,tmcname=caches.setluanames(filepath,filename)
  data.cache_uuid=os.uuid()
- if caches.direct then
+ if caches.fast then
+  file.savedata(tmaname,table.fastserialize(data,true))
+ elseif caches.direct then
   file.savedata(tmaname,table.serialize(data,true,saveoptions))
  else
   table.tofile(tmaname,data,true,saveoptions)
@@ -23400,7 +23947,7 @@
 
 package.loaded["data-zip"] = package.loaded["data-zip"] or true
 
--- original size: 8700, stripped down to: 6313
+-- original size: 10263, stripped down to: 7556
 
 if not modules then modules={} end modules ['data-zip']={
  version=1.001,
@@ -23419,6 +23966,65 @@
 zip.archives=archives
 local registeredfiles=zip.registeredfiles or {}
 zip.registeredfiles=registeredfiles
+local zipfiles=utilities.zipfiles
+local openzip,closezip,validfile,wholefile,filehandle,traversezip
+if zipfiles then
+ local ipairs=ipairs
+ openzip=zipfiles.open
+ closezip=zipfiles.close
+ validfile=zipfiles.found
+ wholefile=zipfiles.unzip
+ traversezip=function(zfile)
+  return ipairs(zipfiles.list(zfile))
+ end
+ local streams=utilities.streams
+ local openstream=streams.open
+ local readstring=streams.readstring
+ local streamsize=streams.size
+ local metatable={
+  close=streams.close,
+  read=function(stream,n)
+   readstring(stream,n=="*a" and streamsize(stream) or n)
+  end
+ }
+ filehandle=function(zfile,queryname)
+  local data=wholefile(zfile,queryname)
+  if data then
+   local stream=openstream(data)
+   if stream then
+    return setmetatableindex(stream,metatable)
+   end
+  end
+ end
+else
+ openzip=zip.open
+ closezip=zip.close
+ validfile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   dfile:close()
+   return true
+  end
+  return false
+ end
+ traversezip=function(zfile)
+  return z:files()
+ end
+ wholefile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   local s=dfile:read("*all")
+   dfile:close()
+   return s
+  end
+ end
+ filehandle=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   return dfile
+  end
+ end
+end
 local function validzip(str) 
  if not find(str,"^zip://") then
   return "zip:///"..str
@@ -23433,7 +24039,7 @@
   local arch=archives[name]
   if not arch then
      local full=resolvers.findfile(name) or ""
-     arch=full~="" and zip.open(full) or false
+     arch=full~="" and openzip(full) or false
      archives[name]=arch
   end
     return arch
@@ -23441,7 +24047,7 @@
 end
 function zip.closearchive(name)
  if not name or (name=="" and archives[name]) then
-  zip.close(archives[name])
+  closezip(archives[name])
   archives[name]=nil
  end
 end
@@ -23482,9 +24088,7 @@
     if trace_locating then
      report_zip("finder: archive %a found",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
-     dfile:close()
+    if validfile(zfile,queryname) then
      if trace_locating then
       report_zip("finder: file %a found",queryname)
      end
@@ -23514,12 +24118,12 @@
     if trace_locating then
      report_zip("opener; archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local handle=filehandle(zfile,queryname)
+    if handle then
      if trace_locating then
       report_zip("opener: file %a found",queryname)
      end
-     return resolvers.openers.helpers.textopener('zip',original,dfile)
+     return resolvers.openers.helpers.textopener('zip',original,handle)
     elseif trace_locating then
      report_zip("opener: file %a not found",queryname)
     end
@@ -23545,15 +24149,13 @@
     if trace_locating then
      report_zip("loader: archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local data=wholefile(zfile,queryname)
+    if data then
      logs.show_load(original)
      if trace_locating then
       report_zip("loader; file %a loaded",original)
      end
-     local s=dfile:read("*all")
-     dfile:close()
-     return true,s,#s
+     return true,data,#data
     elseif trace_locating then
      report_zip("loader: file %a not found",queryname)
     end
@@ -23600,7 +24202,7 @@
  if trace_locating then
   report_zip("registering: using filter %a",filter)
  end
- for i in z:files() do
+ for i in traversezip(z) do
   local filename=i.filename
   local path,name=match(filename,filter)
   if not path then
@@ -24734,7 +25336,7 @@
 
 package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true
 
--- original size: 9418, stripped down to: 7087
+-- original size: 9637, stripped down to: 7253
 
 if not modules then modules={} end modules ['luat-fmt']={
  version=1.001,
@@ -24804,6 +25406,13 @@
   checkers=checkers,
   reporter=report_format,
  },
+ luametatex=sandbox.registerrunner {
+  name="make luametatex format",
+  program="luametatex",
+  template=template,
+  checkers=checkers,
+  reporter=report_format,
+ },
  luajittex=sandbox.registerrunner {
   name="make luajittex format",
   program="luajittex",
@@ -24971,10 +25580,10 @@
 
 end -- of closure
 
--- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.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
+-- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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    : 995501
--- stripped bytes    : 395318
+-- original bytes    : 1019480
+-- stripped bytes    : 403728
 
 -- end library merge
 
@@ -25055,6 +25664,8 @@
     'util-env.lua',
     'luat-env.lua', -- can come before inf (as in mkiv)
 
+    'util-zip.lua',
+
     'lxml-tab.lua',
     'lxml-lpt.lua',
  -- 'lxml-ent.lua',

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-cs.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-de.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-fr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-it.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-de.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-it.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-nl.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/documents/general/qrcs/setup-ro.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
===================================================================
--- trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-nodes.tex	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-nodes.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -2305,8 +2305,8 @@
 
 \def\supported#1#2#3%
  {\NC \type{#1}
-  \NC \ifx#2\yes\libidx{node}       {#1}\fi #2
-  \NC \ifx#3\yes\libidx{node.direct}{#1}\fi #3 \NC
+  \NC \ifx#2\yes\lix{node}       {#1}\fi #2
+  \NC \ifx#3\yes\lix{node.direct}{#1}\fi #3 \NC
   \NR}
 
 \starttabulate[|l|c|c|]

Modified: trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-style.tex
===================================================================
--- trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-style.tex	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-style.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -436,6 +436,7 @@
 \unexpanded\def\lib     #1{\doifmode{*bodypart}{\expanded{\libraryindex{\currentlibraryindex+#1}}\type{\currentlibraryindex.#1}}}
 \unexpanded\def\libindex#1{\doifmode{*bodypart}{\expanded{\libraryindex{\currentlibraryindex+#1}}}}
 \unexpanded\def\libidx#1#2{\doifmode{*bodypart}{\expanded{\libraryindex{#1+#2}}\type{#1.#2}}}
+\unexpanded\def\lix   #1#2{\doifmode{*bodypart}{\expanded{\libraryindex{#1+#2}}}}
 
 % \setstructurepageregister[][keys:1=,entries:1=]
 

Modified: trunk/Master/texmf-dist/doc/man/man1/context.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/luatools.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-babel.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-base.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-bibtex.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-cache.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-chars.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-check.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-colors.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-context.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-dvi.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-epub.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-evohome.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-fcd.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-flac.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-fonts.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-grep.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-interface.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-metapost.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-modules.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-package.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-pdf.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-plain.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-profile.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-rsync.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-scite.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-server.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-texworks.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-timing.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-tools.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-unicode.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-unzip.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-update.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-watch.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtx-youless.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/mtxrun.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/texexec.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/texmfstart.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/metapost/context/base/mpiv/mp-mlib.mpiv
===================================================================
--- trunk/Master/texmf-dist/metapost/context/base/mpiv/mp-mlib.mpiv	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/metapost/context/base/mpiv/mp-mlib.mpiv	2019-03-24 21:21:32 UTC (rev 50573)
@@ -16,7 +16,7 @@
 
 boolean context_mlib ; context_mlib := true ;
 
-numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY := runscript("mp.print(LUATEXFUNCTIONALITY)") ;
+% numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY := runscript("mp.print(LUATEXFUNCTIONALITY or (status and status.development_id) or 6346)") ;
 
 %D Objects:
 

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-bibtex.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-bibtex.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-bibtex.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -127,7 +127,7 @@
             utilities.formatters.formatcolumns(result)
             logs.newline()
             for i=1,#result do
-                texio.write_nl(result[i])
+                logs.writer(result[i])
             end
             logs.newline()
         else

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-context.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-context.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-context.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -159,7 +159,7 @@
 
 local defaultformats = {
     "cont-en",
-    "cont-nl",
+ -- "cont-nl",
 }
 
 -- purging files (we should have an mkii and mkiv variants)
@@ -537,7 +537,7 @@
 
 local function luatex_command(l_flags,c_flags,filename,engine)
     return format('%s %s %s "%s"',
-        engine or "luatex",
+        engine or (status and status.luatex_engine) or "luatex",
         flags_to_string(l_flags),
         flags_to_string(c_flags,true),
         filename
@@ -872,10 +872,12 @@
                     --
                     report("run %s: %s",currentrun,command)
                     print("") -- cleaner, else continuation on same line
-                    local returncode, errorstring = os.spawn(command)
+--                     local returncode, errorstring = os.spawn(command)
+                    local returncode = os.execute(command)
                     -- todo: remake format when no proper format is found
                     if not returncode then
-                        report("fatal error: no return code, message: %s",errorstring or "?")
+--                         report("fatal error: no return code, message: %s",errorstring or "?")
+                        report("fatal error: no return code")
                         if resultname then
                             result_save_error(oldbase,newbase)
                         end
@@ -1192,7 +1194,7 @@
         scripts.context.generate()
     end
     local list = (name and { name }) or (environment.filenames[1] and environment.filenames) or defaultformats
-    local engine = getargument("engine") or "luatex"
+    local engine = getargument("engine") or (status and status.luatex_engine) or "luatex"
     if getargument("jit") then
         engine = "luajittex"
     end
@@ -1201,7 +1203,7 @@
         name = formatofinterface[name] or name or ""
         if name == "" then
             -- nothing
-        elseif engine == "luatex" or engine == "luajittex" then
+        elseif engine == "luametatex" or engine == "luatex" or engine == "luajittex" then
             make_mkiv_format(name,engine)
         elseif engine == "pdftex" or engine == "xetex" then
             make_mkii_format(name,engine)

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-dvi.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-dvi.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-dvi.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -83,7 +83,7 @@
 local f_define_font     = formatters["define font      k=%i checksum=%i scale=%p designsize=%p area=%s name=%s"]
 
 local currentdepth = 0
-local usedprinter  = texio and texio.write_ln or print
+local usedprinter  = (logs and logs.writer) or (texio and texio.write_nl) or print
 
 local handler = { } for i=0,255 do handler[i] = false end
 
@@ -379,7 +379,7 @@
         local position = 0
         f:seek("set",position)
         local format = formatters["%0" .. #tostring(filesize) .. "i :  %s"]
-        local flush  = printer or (texio and texio.write_ln) or print
+        local flush  = printer or usedprinter
         usedprinter = function(str)
             flush(format(position,str))
             position = f:seek()

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-fcd.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-fcd.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-fcd.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -66,7 +66,7 @@
 }
 
 local report  = application.report
-local writeln = print -- texio.write_nl
+local writeln = (logs and logs.writer) or (texio and texio.write_nl) or print
 
 local find, char, byte, lower, gsub, format = string.find, string.char, string.byte, string.lower, string.gsub, string.format
 

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-fonts.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -14,7 +14,7 @@
 local nameonly, basename, joinpath, collapsepath = file.nameonly, file.basename, file.join, file.collapsepath
 local lower = string.lower
 local concat = table.concat
-local write_nl = texio.write_nl
+local write_nl = (logs and logs.writer) or (texio and texio.write_nl) or print
 
 local otlversion  = 3.106
 

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-grep.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-grep.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-grep.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -69,7 +69,7 @@
 local newline  = crlf + cr + lf
 local content  = lpeg.C((1-newline)^0) * newline + lpeg.C(lpeg.P(1)^1)
 
-local write_nl = texio.write_nl
+local write_nl = (logs and logs.writer) or (texio and texio.write_nl) or print
 
 -- local pattern = "LIJST[@TYPE='BULLET']/LIJSTITEM[contains(text(),'Kern')]"
 

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-install.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-install.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-install.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -36,8 +36,8 @@
 local gsub, find, escapedpattern = string.gsub, string.find, string.escapedpattern
 local round = math.round
 local savetable, loadtable, sortedhash = table.save, table.load, table.sortedhash
-local joinfile, filesize, dirname, addsuffix = file.join, file.size, file.dirname, file.addsuffix
-local isdir, isfile, walkdir = lfs.isdir, lfs.isfile, lfs.dir
+local copyfile, joinfile, filesize, dirname, addsuffix, basename = file.copy, file.join, file.size, file.dirname, file.addsuffix, file.basename
+local isdir, isfile, walkdir, pushdir, popdir, currentdir = lfs.isdir, lfs.isfile, lfs.dir, lfs.chdir, dir.push, dir.pop, currentdir
 local mkdirs, globdir = dir.mkdirs, dir.glob
 local osremove, osexecute, ostype = os.remove, os.execute, os.type
 local savedata = io.savedata
@@ -223,9 +223,9 @@
         mkdirs(tree)
     end
 
-    local function update(url,tree)
+    local function update(url,what,zipfile,skiplist)
 
-        tree = joinfile("tex",tree)
+        local tree = joinfile("tex",what)
 
         local ok = validdir(tree)
         if not validdir(tree) then
@@ -252,24 +252,69 @@
 
         local total = 0
         local done  = 0
+        local count = 0
 
         if not old then
 
-            report("installing %s, %i files",tree,#new)
+            if zipfile then
+                zipfile = addsuffix(what,"zip")
+            end
+            if zipfile then
+                local zipurl = url .. "/" .. zipfile
+                report("fetching %a",zipurl)
+                local zipdata = fetch(zipurl)
+                if zipdata then
+                    io.savedata(zipfile,zipdata)
+                else
+                    zipfile = false
+                end
+            end
 
-            for i=1,#new do
+            if type(zipfile) == "string" and isfile(zipfile) then
+
+                -- todo: pcall
+
+                report("unzipping %a",zipfile)
+
+                local specification = {
+                    zipname = zipfile,
+                    path    = ".",
+                 -- verbose = true,
+                    verbose = "steps",
+                }
+
+                if utilities.zipfiles.unzipdir(specification) then
+                    osremove(zipfile)
+                    goto done
+                else
+                    osremove(zipfile)
+                end
+
+            end
+
+            count = #new
+
+            report("installing %s, %i files",tree,count)
+
+            for i=1,count do
                 total = total + new[i][2]
             end
 
-            for i=1,#new do
+            for i=1,count do
                 local entry  = new[i]
                 local name   = entry[1]
                 local size   = entry[2]
                 local target = joinfile(tree,name)
                 done = done + size
-                download("new",url,target,total,done)
+                if not skiplist or not skiplist[basename(name)] then
+                    download("new",url,target,total,done)
+                else
+                    report("skipping %s",target)
+                end
             end
 
+            ::done::
+
         else
 
             report("updating %s, %i files",tree,#new)
@@ -279,24 +324,30 @@
             local todo = { }
 
             for newname, newhash in sortedhash(hnew) do
-                local target  = joinfile(tree,newname)
-                local oldhash = hold[newname]
-                local action  = nil
-                if not oldhash then
-                    action = "added"
-                elseif oldhash[3] ~= newhash[3] then
-                    action = "changed"
-                elseif not ispresent(joinfile(tree,newname)) then
-                    action = "missing"
+                local target = joinfile(tree,newname)
+                if not skiplist or not skiplist[basename(newname)] then
+                    local oldhash = hold[newname]
+                    local action  = nil
+                    if not oldhash then
+                        action = "added"
+                    elseif oldhash[3] ~= newhash[3] then
+                        action = "changed"
+                    elseif not ispresent(joinfile(tree,newname)) then
+                        action = "missing"
+                    end
+                    if action then
+                        local size = newhash[2]
+                        total = total + size
+                        todo[#todo+1] = { action, target, size }
+                    end
+                else
+                    report("skipping %s",target)
                 end
-                if action then
-                    local size = newhash[2]
-                    total = total + size
-                    todo[#todo+1] = { action, target, size }
-                end
             end
 
-            for i=1,#todo do
+            count = #todo
+
+            for i=1,count do
                 local entry = todo[i]
                 download(entry[1],url,entry[2],total,done)
                 done = done + entry[3]
@@ -314,6 +365,8 @@
 
         savetable(lua,new)
 
+        return { tree, count, done }
+
     end
 
     local targetroot = dir.current()
@@ -355,10 +408,18 @@
     report("platform : %s",osplatform)
     report("system   : %s",ostype)
 
-    update(url,"texmf")
-    update(url,"texmf-context")
-    update(url,texmfplatform)
+    local status   = { }
+    local skiplist = {
+        ["mtxrun"]      = true,
+        ["context"]     = true,
+        ["mtxrun.exe"]  = true,
+        ["context.exe"] = true,
+    }
 
+    status[#status+1] = update(url,"texmf",true)
+    status[#status+1] = update(url,"texmf-context",true)
+    status[#status+1] = update(url,texmfplatform,false,skiplist)
+
     prepare("texmf-cache")
     prepare("texmf-project")
     prepare("texmf-fonts")
@@ -367,36 +428,83 @@
 
     local binpath = joinfile(targetroot,"tex",texmfplatform,"bin")
 
-    if ostype == "unix" then
-        osexecute(formatters["chmod +x %s/*"](binpath))
+    local luametatex = "luametatex"
+    local mtxrun     = "mtxrun"
+    local context    = "context"
+
+    if ostype == "windows" then
+        luametatex = addsuffix(luametatex,"exe")
+        mtxrun     = addsuffix(mtxrun,"exe")
+        context    = addsuffix(context,"exe")
     end
 
-    local mtxrun  = joinfile(binpath,"mtxrun")
-    local context = joinfile(binpath,"context")
+    local luametatexbin = joinfile(binpath,luametatex)
+    local mtxrunbin     = joinfile(binpath,mtxrun)
+    local contextbin    = joinfile(binpath,context)
 
-    if ostype == "windows" then
-        addsuffix(mtxrun,"exe")
-        addsuffix(context,"exe")
+    local cdir = currentdir()
+    local pdir = pushdir(binpath)
+
+    report("current  : %S",cdir)
+    report("target   : %S",pdir)
+
+    if pdir ~= cdir then
+
+        report("removing : %s",mtxrun)
+        report("removing : %s",context)
+
+        osremove(mtxrun)
+        osremove(context)
+
+        if isfile(luametatex) then
+            lfs.symlink(luametatex,mtxrun)
+            lfs.symlink(luametatex,context)
+        end
+
+        if isfile(mtxrun) then
+            report("linked   : %s",mtxrun)
+        else
+            copyfile(luametatex,mtxrun)
+            report("copied   : %s",mtxrun)
+        end
+        if isfile(context) then
+            report("linked   : %s",context)
+        else
+            copyfile(luametatex,context)
+            report("copied   : %s",context)
+        end
+
     end
 
-    run("%s --generate",mtxrun)
-    run("%s --make en", context)
-    run("%s --make nl", context)
+    popdir()
 
- -- local mtxrun  = joinfile(binpath,"mtxrunjit")
- -- local context = joinfile(binpath,"contextjit")
- --
- -- if ostype == "windows" then
- --     addsuffix(mtxrun,"exe")
- --     addsuffix(context,"exe")
- -- end
- --
- -- run("%s --generate",mtxrun)
- -- run("%s --make en", context)
- -- run("%s --make nl", context)
+    if lfs.setexecutable(luametatexbin) then
+        report("xbit set : %s",luametatexbin)
+    else
+     -- report("xbit bad : %s",luametatexbin)
+    end
+    if lfs.setexecutable(mtxrunbin) then
+        report("xbit set : %s",mtxrunbin)
+    else
+     -- report("xbit bad : %s",mtxrunbin)
+    end
+    if lfs.setexecutable(contextbin) then
+        report("xbit set : %s",contextbin)
+    else
+     -- report("xbit bad : %s",contextbin)
+    end
 
+    run("%s --generate",mtxrunbin)
+    run("%s --make en", contextbin)
+
     -- in calling script: update mtxrun.exe and mtxrun.lua
 
+    report("")
+    for i=1,#status do
+        report("%-20s : %4i files with %9i bytes installed",unpack(status[i]))
+    end
+    report("")
+
     report("update, done")
 end
 

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtx-tools.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtx-tools.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtx-tools.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -53,7 +53,8 @@
     helpinfo = helpinfo,
 }
 
-local report = application.report
+local report  = application.report
+local writeln = (logs and logs.writer) or (texio and texio.write_nl) or print
 
 scripts       = scripts       or { }
 scripts.tools = scripts.tools or { }
@@ -189,7 +190,7 @@
     result = table.concat(result,"\n")
 
     if not outputfile or outputfile == "" then
-        texio.write_nl(result)
+        writeln(result)
     else
         io.savedata(outputfile,result)
     end

Modified: trunk/Master/texmf-dist/scripts/context/lua/mtxrun.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/lua/mtxrun.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/lua/mtxrun.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -194,7 +194,7 @@
 
 package.loaded["l-lua"] = package.loaded["l-lua"] or true
 
--- original size: 6281, stripped down to: 2863
+-- original size: 6330, stripped down to: 2831
 
 if not modules then modules={} end modules ['l-lua']={
  version=1.001,
@@ -312,7 +312,6 @@
  ffi.number=tonumber
 end
 if LUAVERSION>5.3 then
- collectgarbage("generational")
 end
 
 
@@ -3766,7 +3765,7 @@
 
 package.loaded["l-os"] = package.loaded["l-os"] or true
 
--- original size: 19347, stripped down to: 10258
+-- original size: 18916, stripped down to: 10126
 
 if not modules then modules={} end modules ['l-os']={
  version=1.001,
@@ -3933,16 +3932,6 @@
 function os.launch(str)
  execute(format(launchers[os.name] or launchers.unix,str))
 end
-if not os.times then
- function os.times()
-  return {
-   utime=os.gettimeofday(),
-   stime=0,
-   cutime=0,
-   cstime=0,
-  }
- end
-end
 local gettimeofday=os.gettimeofday or os.clock
 os.gettimeofday=gettimeofday
 local startuptime=gettimeofday()
@@ -4218,7 +4207,7 @@
 
 package.loaded["l-file"] = package.loaded["l-file"] or true
 
--- original size: 21804, stripped down to: 9980
+-- original size: 21984, stripped down to: 10148
 
 if not modules then modules={} end modules ['l-file']={
  version=1.001,
@@ -4398,41 +4387,46 @@
 function file.reslash(str)
  return str and lpegmatch(reslasher,str)
 end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
-  name=name.."/m_t_x_t_e_s_t.tmp"
-  local f=io.open(name,"wb")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+  if not name then
+  elseif lfs.isdir(name) then
+   name=name.."/m_t_x_t_e_s_t.tmp"
+   local f=io.open(name,"wb")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
+  elseif lfs.isfile(name) then
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    return true
+   end
+  else
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
   end
- elseif lfs.isfile(name) then
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   return true
+  return false
+ end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+  if name then
+   local a=attributes(name)
+   return a and lpegmatch(readable,a.permissions) or false
+  else
+   return false
   end
- else
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
-  end
  end
- return false
 end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
-  local a=attributes(name)
-  return a and lpegmatch(readable,a.permissions) or false
- else
-  return false
- end
-end
 file.isreadable=file.is_readable 
 file.iswritable=file.is_writable 
 function file.size(name)
@@ -5062,7 +5056,7 @@
 
 package.loaded["l-dir"] = package.loaded["l-dir"] or true
 
--- original size: 18002, stripped down to: 10681
+-- original size: 18253, stripped down to: 10816
 
 if not modules then modules={} end modules ['l-dir']={
  version=1.001,
@@ -5127,13 +5121,15 @@
   end
   local dirs
   local nofdirs=0
-  for name in walkdir(usedpath) do
+  for name,mode,size,time in walkdir(usedpath) do
    if name~="." and name~=".." then
     local full=path..name
-    local mode=attributes(full,'mode')
+    if mode==nil then
+     mode=attributes(full,'mode')
+    end
     if mode=='file' then
      if not patt or find(full,patt) then
-      action(full)
+      action(full,size,time)
      end
     elseif recurse and mode=="directory" then
      if dirs then
@@ -5169,10 +5165,12 @@
  local dirs
  local nofdirs=0
  local noffiles=#result
- for name,a in walkdir(usedpath) do
+ for name,mode in walkdir(usedpath) do
   if name~="." and name~=".." then
    local full=path..name
-   local mode=attributes(full,'mode')
+   if mode==nil then
+    mode=attributes(full,'mode')
+   end
    if mode=='file' then
     if not patt or find(full,patt) then
      noffiles=noffiles+1
@@ -5223,7 +5221,7 @@
   if not find(path,"/$") then
    path=path..'/'
   end
-  for name in scanner,first do
+  for name in scanner,first do 
    if name=="." then
    elseif name==".." then
    else
@@ -5314,10 +5312,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if recurse then
      globfiles(path.."/"..name,recurse,func,files)
@@ -5340,10 +5340,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if not func or func(name) then
      noffiles=noffiles+1
@@ -5524,8 +5526,7 @@
 function dir.push(newdir)
  local curdir=currentdir()
  insert(stack,curdir)
- if newdir and newdir~="" then
-  chdir(newdir)
+ if newdir and newdir~="" and chdir(newdir) then
   return newdir
  else
   return curdir
@@ -6466,7 +6467,7 @@
 
 package.loaded["util-str"] = package.loaded["util-str"] or true
 
--- original size: 43538, stripped down to: 21641
+-- original size: 43488, stripped down to: 21595
 
 if not modules then modules={} end modules ['util-str']={
  version=1.001,
@@ -6482,7 +6483,6 @@
 local load,dump=load,string.dump
 local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
 local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
 local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
 local patterns,lpegmatch=lpeg.patterns,lpeg.match
 local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -7307,7 +7307,7 @@
 
 package.loaded["util-tab"] = package.loaded["util-tab"] or true
 
--- original size: 28810, stripped down to: 16134
+-- original size: 28866, stripped down to: 16134
 
 if not modules then modules={} end modules ['util-tab']={
  version=1.001,
@@ -7971,7 +7971,7 @@
 
 package.loaded["util-fil"] = package.loaded["util-fil"] or true
 
--- original size: 8607, stripped down to: 6727
+-- original size: 11530, stripped down to: 9007
 
 if not modules then modules={} end modules ['util-fil']={
  version=1.001,
@@ -8180,6 +8180,32 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 else
  local floor=math.floor
  function files.writecardinal2(f,n)
@@ -8188,17 +8214,33 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
-end
 function files.writestring(f,s)
  f:write(char(byte(s,1,#s)))
 end
@@ -8210,10 +8252,18 @@
  files.readcardinal2=fio.readcardinal2
  files.readcardinal3=fio.readcardinal3
  files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
  files.readinteger1=fio.readinteger1
  files.readinteger2=fio.readinteger2
  files.readinteger3=fio.readinteger3
  files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
  files.readfixed2=fio.readfixed2
  files.readfixed4=fio.readfixed4
  files.read2dot14=fio.read2dot14
@@ -8234,6 +8284,24 @@
   skipposition(f,4*(n or 1))
  end
 end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
 if fio and fio.readcardinaltable then
  files.readcardinaltable=fio.readcardinaltable
  files.readintegertable=fio.readintegertable
@@ -8271,7 +8339,7 @@
 
 package.loaded["util-sac"] = package.loaded["util-sac"] or true
 
--- original size: 11065, stripped down to: 8209
+-- original size: 11332, stripped down to: 8420
 
 if not modules then modules={} end modules ['util-sac']={
  version=1.001,
@@ -8296,6 +8364,11 @@
   return { f,1,#f,zerobased or false }
  end
 end
+function streams.getstring(f)
+ if f then
+  return f[1]
+ end
+end
 function streams.close()
 end
 function streams.size(f)
@@ -8386,7 +8459,7 @@
  local a,b=byte(f[1],i,j)
  return 0x100*a+b
 end
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
  local i=f[2]
  local j=i+1
  f[2]=j+1
@@ -8458,6 +8531,13 @@
  local a,b,c,d=byte(f[1],i,j)
  return 0x1000000*a+0x10000*b+0x100*c+d
 end
+function streams.readcardinal4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
 function streams.readinteger4(f)
  local i=f[2]
  local j=i+3
@@ -9545,13 +9625,13 @@
 
 package.loaded["util-soc-imp-socket"] = package.loaded["util-soc-imp-socket"] or true
 
--- original size: 4870, stripped down to: 3527
+-- original size: 4905, stripped down to: 3562
 
 
 local type,tostring,setmetatable=type,tostring,setmetatable
 local min=math.min
 local format=string.format
-local socket=require("socket.core")
+local socket=socket or package.loaded.socket or require("socket.core")
 local connect=socket.connect
 local tcp4=socket.tcp4
 local tcp6=socket.tcp6
@@ -10734,12 +10814,12 @@
 
 package.loaded["util-soc-imp-mime"] = package.loaded["util-soc-imp-mime"] or true
 
--- original size: 2328, stripped down to: 1874
+-- original size: 2373, stripped down to: 1931
 
 
 local type,tostring=type,tostring
-local mime=require("mime.core")
-local ltn12=ltn12 or require("ltn12")
+local mime=mime  or package.loaded.mime  or require("mime.core")
+local ltn12=ltn12 or package.loaded.ltn12 or require("ltn12")
 local filtercycle=ltn12.filter.cycle
 local function report(fmt,first,...)
  if logs then
@@ -12691,7 +12771,7 @@
 
 package.loaded["trac-log"] = package.loaded["trac-log"] or true
 
--- original size: 32608, stripped down to: 20925
+-- original size: 32618, stripped down to: 20935
 
 if not modules then modules={} end modules ['trac-log']={
  version=1.001,
@@ -12736,7 +12816,7 @@
 setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
 local report,subreport,status,settarget,setformats,settranslations
 local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
-if runningtex then
+if runningtex and texio then
  if texio.setescape then
   texio.setescape(0) 
  end
@@ -15613,6 +15693,468 @@
 
 do -- create closure to overcome 200 locals limit
 
+package.loaded["util-zip"] = package.loaded["util-zip"] or true
+
+-- original size: 18645, stripped down to: 11291
+
+if not modules then modules={} end modules ['util-zip']={
+ version=1.001,
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local type,tostring,tonumber=type,tostring,tonumber
+local sort=table.sort
+local find,format,sub,gsub=string.find,string.format,string.sub,string.gsub
+local osdate,ostime=os.date,os.time
+local ioopen=io.open
+local loaddata,savedata=io.loaddata,io.savedata
+local filejoin,isdir,dirname,mkdirs=file.join,lfs.isdir,file.dirname,dir.mkdirs
+local files=utilities.files
+local openfile=files.open
+local closefile=files.close
+local readstring=files.readstring
+local readcardinal2=files.readcardinal2le
+local readcardinal4=files.readcardinal4le
+local setposition=files.setposition
+local getposition=files.getposition
+local band=bit32.band
+local rshift=bit32.rshift
+local lshift=bit32.lshift
+local decompress,calculatecrc
+if flate then
+ decompress=flate.flate_decompress
+ calculatecrc=flate.update_crc32
+else
+ local zlibdecompress=zlib.decompress
+ local zlibchecksum=zlib.crc32
+ decompress=function(source,targetsize)
+  local target=zlibdecompress(source,-15)
+  if target then
+   return target
+  else
+   return false,1
+  end
+ end
+ calculatecrc=function(buffer,initial)
+  return zlibchecksum(initial or 0,buffer)
+ end
+end
+local zipfiles={}
+utilities.zipfiles=zipfiles
+local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist  do
+ function openzipfile(name)
+  return {
+   name=name,
+   handle=openfile(name,0),
+  }
+ end
+ local function collect(z)
+  if not z.list then
+   local list={}
+   local hash={}
+   local position=0
+   local index=0
+   local handle=z.handle
+   while true do
+    setposition(handle,position)
+    local signature=readstring(handle,4)
+    if signature=="PK\3\4" then
+     local version=readcardinal2(handle)
+     local flag=readcardinal2(handle)
+     local method=readcardinal2(handle)
+     local filetime=readcardinal2(handle)
+     local filedate=readcardinal2(handle)
+     local crc32=readcardinal4(handle)
+     local compressed=readcardinal4(handle)
+     local uncompressed=readcardinal4(handle)
+     local namelength=readcardinal2(handle)
+     local extralength=readcardinal2(handle)
+     local filename=readstring(handle,namelength)
+     local descriptor=band(flag,8)~=0
+     local encrypted=band(flag,1)~=0
+     local acceptable=method==0 or method==8
+     local skipped=0
+     local size=0
+     if encrypted then
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      skipbytes(8)
+      skipped=skipped+8
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      size=readcardinal4(handle)
+      skipbytes(size)
+      skipped=skipped+size+4
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+     end
+     position=position+30+namelength+extralength+skipped
+     if descriptor then
+      setposition(handle,position+compressed)
+      crc32=readcardinal4(handle)
+      compressed=readcardinal4(handle)
+      uncompressed=readcardinal4(handle)
+     end
+     if acceptable then
+      index=index+1
+      local data={
+       filename=filename,
+       index=index,
+       position=position,
+       method=method,
+       compressed=compressed,
+       uncompressed=uncompressed,
+       crc32=crc32,
+       encrypted=encrypted,
+      }
+      hash[filename]=data
+      list[index]=data
+     else
+     end
+     position=position+compressed
+    else
+     break
+    end
+    z.list=list
+    z.hash=hash
+   end
+  end
+ end
+ function getziplist(z)
+  local list=z.list
+  if not list then
+   collect(z)
+  end
+  return z.list
+ end
+ function getziphash(z)
+  local hash=z.hash
+  if not hash then
+   collect(z)
+  end
+  return z.hash
+ end
+ function foundzipfile(z,name)
+  return getziphash(z)[name]
+ end
+ function closezipfile(z)
+  local f=z.handle
+  if f then
+   closefile(f)
+   z.handle=nil
+  end
+ end
+ function unzipfile(z,filename,check)
+  local hash=z.hash
+  if not hash then
+   hash=zipfiles.hash(z)
+  end
+  local data=hash[filename] 
+  if not data then
+  end
+  if data then
+   local handle=z.handle
+   local position=data.position
+   local compressed=data.compressed
+   if compressed>0 then
+    setposition(handle,position)
+    local result=readstring(handle,compressed)
+    if data.method==8 then
+     result=decompress(result,data.uncompressed)
+    end
+    if check and data.crc32~=calculatecrc(result) then
+     print("checksum mismatch")
+     return ""
+    end
+    return result
+   else
+    return ""
+   end
+  end
+ end
+ zipfiles.open=openzipfile
+ zipfiles.close=closezipfile
+ zipfiles.unzip=unzipfile
+ zipfiles.hash=getziphash
+ zipfiles.list=getziplist
+ zipfiles.found=foundzipfile
+end
+if flate then do
+ local writecardinal1=files.writebyte
+ local writecardinal2=files.writecardinal2le
+ local writecardinal4=files.writecardinal4le
+ local logwriter=logs.writer
+ local globpattern=dir.globpattern
+ local compress=flate.flate_compress
+ local checksum=flate.update_crc32
+ local function fromdostime(dostime,dosdate)
+  return ostime {
+   year=rshift(dosdate,9)+1980,
+   month=band(rshift(dosdate,5),0x0F),
+   day=band((dosdate   ),0x1F),
+   hour=band(rshift(dostime,11)    ),
+   min=band(rshift(dostime,5),0x3F),
+   sec=band((dostime   ),0x1F),
+  }
+ end
+ local function todostime(time)
+  local t=osdate("*t",time)
+  return
+   lshift(t.year-1980,9)+lshift(t.month,5)+t.day,
+   lshift(t.hour,11)+lshift(t.min,5)+rshift(t.sec,1)
+ end
+ local function openzip(filename,level,comment,verbose)
+  local f=ioopen(filename,"wb")
+  if f then
+   return {
+    filename=filename,
+    handle=f,
+    list={},
+    level=tonumber(level) or 3,
+    comment=tostring(comment),
+    verbose=verbose,
+    uncompressed=0,
+    compressed=0,
+   }
+  end
+ end
+ local function writezip(z,name,data,level,time)
+  local f=z.handle
+  local list=z.list
+  local level=tonumber(level) or z.level or 3
+  local method=8
+  local zipped=compress(data,level)
+  local checksum=checksum(data)
+  local verbose=z.verbose
+  if not zipped then
+   method=0
+   zipped=data
+  end
+  local start=f:seek()
+  local compressed=#zipped
+  local uncompressed=#data
+  z.compressed=z.compressed+compressed
+  z.uncompressed=z.uncompressed+uncompressed
+  if verbose then
+   local pct=100*compressed/uncompressed
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,name))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,name))
+   end
+  end
+  f:write("\x50\x4b\x03\x04")
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,method)    
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal4(f,checksum)  
+  writecardinal4(f,compressed)   
+  writecardinal4(f,uncompressed) 
+  writecardinal2(f,#name)  
+  writecardinal2(f,0)
+  f:write(name)      
+  f:write(zipped)
+  list[#list+1]={ #zipped,#data,name,checksum,start,time or 0 }
+ end
+ local function closezip(z)
+  local f=z.handle
+  local list=z.list
+  local comment=z.comment
+  local verbose=z.verbose
+  local count=#list
+  local start=f:seek()
+  for i=1,count do
+   local l=list[i]
+   local compressed=l[1]
+   local uncompressed=l[2]
+   local name=l[3]
+   local checksum=l[4]
+   local start=l[5]
+   local time=l[6]
+   local date,time=todostime(time)
+   f:write('\x50\x4b\x01\x02')
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,8)   
+   writecardinal2(f,time)   
+   writecardinal2(f,date)   
+   writecardinal4(f,checksum)  
+   writecardinal4(f,compressed)   
+   writecardinal4(f,uncompressed) 
+   writecardinal2(f,#name)  
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal4(f,0)   
+   writecardinal4(f,start)  
+   f:write(name)      
+  end
+  local stop=f:seek()
+  local size=stop-start
+  f:write('\x50\x4b\x05\x06')
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,count)  
+  writecardinal2(f,count)  
+  writecardinal4(f,size)   
+  writecardinal4(f,start)  
+  if type(comment)=="string" and comment~="" then
+   writecardinal2(f,#comment) 
+   f:write(comment)     
+  else
+   writecardinal2(f,0)
+  end
+  if verbose then
+   local compressed=z.compressed
+   local uncompressed=z.uncompressed
+   local filename=z.filename
+   local pct=100*compressed/uncompressed
+   logwriter("")
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,filename))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,filename))
+   end
+  end
+  f:close()
+ end
+ local function zipdir(zipname,path,level,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   level=zipname.level
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  if not isdir(path) then
+   return
+  end
+  path=gsub(path,"\\+","/")
+  path=gsub(path,"/+","/")
+  local list={}
+  local count=0
+  globpattern(path,"",true,function(name,size,time)
+   count=count+1
+   list[count]={ name,time }
+  end)
+  sort(list,function(a,b)
+   return a[1]<b[1]
+  end)
+  local zipf=openzip(zipname,level,comment,verbose)
+  if zipf then
+   local p=#path+2
+   for i=1,count do
+    local li=list[i]
+    local name=li[1]
+    local time=li[2]
+    local data=loaddata(name)
+    local name=sub(name,p,#name)
+    writezip(zipf,name,data,level,time,verbose)
+   end
+   closezip(zipf)
+  end
+ end
+ local function unzipdir(zipname,path,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  local z=openzipfile(zipname)
+  if z then
+   local list=getziplist(z)
+   if list then
+    local total=0
+    local count=#list
+    local step=number.idiv(count,10)
+    local done=0
+    for i=1,count do
+     local l=list[i]
+     local n=l.filename
+     local d=unzipfile(z,n) 
+     local p=filejoin(path,n)
+     if mkdirs(dirname(p)) then
+      if verbose=="steps" then
+       total=total+#d
+       done=done+1
+       if done>=step then
+        done=0
+        logwriter(format("%4i files of %4i done, %10i bytes",i,count,total))
+       end
+      elseif verbose then
+       logwriter(n)
+      end
+      savedata(p,d)
+     end
+    end
+    if verbose=="steps" then
+     logwriter(format("%4i files of %4i done, %10i bytes",count,count,total))
+    end
+    closezipfile(z)
+    return true
+   else
+    closezipfile(z)
+   end
+  end
+ end
+ zipfiles.zipdir=zipdir
+ zipfiles.unzipdir=unzipdir
+end end
+if flate then
+ local streams=utilities.streams
+ local openfile=streams.open
+ local closestream=streams.close
+ local setposition=streams.setposition
+ local getsize=streams.size
+ local readcardinal4=streams.readcardinal4le
+ local getstring=streams.getstring
+ local decompress=flate.gz_decompress
+ function zipfiles.gunzipfile(filename)
+  local strm=openfile(filename)
+  if strm then
+   setposition(strm,getsize(strm)-4+1)
+   local size=readcardinal4(strm)
+   local data=decompress(getstring(strm),size)
+   closestream(strm)
+   return data
+  end
+ end
+elseif gzip then
+ local openfile=gzip.open
+ function zipfiles.gunzipfile(filename)
+  local g=openfile(filename,"rb")
+  if g then
+   local d=g:read("*a")
+   d:close()
+   return d
+  end
+ end
+end
+
+
+end -- of closure
+
+do -- create closure to overcome 200 locals limit
+
 package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
 
 -- original size: 60383, stripped down to: 35698
@@ -20103,7 +20645,7 @@
 
 package.loaded["data-exp"] = package.loaded["data-exp"] or true
 
--- original size: 18105, stripped down to: 10389
+-- original size: 18154, stripped down to: 10416
 
 if not modules then modules={} end modules ['data-exp']={
  version=1.001,
@@ -20310,9 +20852,11 @@
  local pattern=tolerant and lessweird or weird
  local filelist={}
  local noffiles=0
- for name in directory(full) do
+ for name,mode in directory(full) do
   if not lpegmatch(pattern,name) then
-   local mode=attributes(full..name,"mode")
+   if not mode then
+    mode=attributes(full..name,"mode")
+   end
    if mode=="file" then
     n=n+1
     noffiles=noffiles+1
@@ -20793,7 +21337,7 @@
 
 package.loaded["data-tmp"] = package.loaded["data-tmp"] or true
 
--- original size: 16116, stripped down to: 10782
+-- original size: 16284, stripped down to: 10938
 
 if not modules then modules={} end modules ['data-tmp']={
  version=1.100,
@@ -20833,6 +21377,7 @@
 caches.ask=false
 caches.relocate=false
 caches.defaults={ "TMPDIR","TEMPDIR","TMP","TEMP","HOME","HOMEPATH" }
+directives.register("system.caches.fast",function(v) caches.fast=true end)
 local writable,readables,usedreadables=nil,{},{}
 local function identify()
  local texmfcaches=resolvers.cleanpathlist("TEXMFCACHE") 
@@ -21066,7 +21611,9 @@
 function caches.savedata(filepath,filename,data,raw)
  local tmaname,tmcname=caches.setluanames(filepath,filename)
  data.cache_uuid=os.uuid()
- if caches.direct then
+ if caches.fast then
+  file.savedata(tmaname,table.fastserialize(data,true))
+ elseif caches.direct then
   file.savedata(tmaname,table.serialize(data,true,saveoptions))
  else
   table.tofile(tmaname,data,true,saveoptions)
@@ -23400,7 +23947,7 @@
 
 package.loaded["data-zip"] = package.loaded["data-zip"] or true
 
--- original size: 8700, stripped down to: 6313
+-- original size: 10263, stripped down to: 7556
 
 if not modules then modules={} end modules ['data-zip']={
  version=1.001,
@@ -23419,6 +23966,65 @@
 zip.archives=archives
 local registeredfiles=zip.registeredfiles or {}
 zip.registeredfiles=registeredfiles
+local zipfiles=utilities.zipfiles
+local openzip,closezip,validfile,wholefile,filehandle,traversezip
+if zipfiles then
+ local ipairs=ipairs
+ openzip=zipfiles.open
+ closezip=zipfiles.close
+ validfile=zipfiles.found
+ wholefile=zipfiles.unzip
+ traversezip=function(zfile)
+  return ipairs(zipfiles.list(zfile))
+ end
+ local streams=utilities.streams
+ local openstream=streams.open
+ local readstring=streams.readstring
+ local streamsize=streams.size
+ local metatable={
+  close=streams.close,
+  read=function(stream,n)
+   readstring(stream,n=="*a" and streamsize(stream) or n)
+  end
+ }
+ filehandle=function(zfile,queryname)
+  local data=wholefile(zfile,queryname)
+  if data then
+   local stream=openstream(data)
+   if stream then
+    return setmetatableindex(stream,metatable)
+   end
+  end
+ end
+else
+ openzip=zip.open
+ closezip=zip.close
+ validfile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   dfile:close()
+   return true
+  end
+  return false
+ end
+ traversezip=function(zfile)
+  return z:files()
+ end
+ wholefile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   local s=dfile:read("*all")
+   dfile:close()
+   return s
+  end
+ end
+ filehandle=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   return dfile
+  end
+ end
+end
 local function validzip(str) 
  if not find(str,"^zip://") then
   return "zip:///"..str
@@ -23433,7 +24039,7 @@
   local arch=archives[name]
   if not arch then
      local full=resolvers.findfile(name) or ""
-     arch=full~="" and zip.open(full) or false
+     arch=full~="" and openzip(full) or false
      archives[name]=arch
   end
     return arch
@@ -23441,7 +24047,7 @@
 end
 function zip.closearchive(name)
  if not name or (name=="" and archives[name]) then
-  zip.close(archives[name])
+  closezip(archives[name])
   archives[name]=nil
  end
 end
@@ -23482,9 +24088,7 @@
     if trace_locating then
      report_zip("finder: archive %a found",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
-     dfile:close()
+    if validfile(zfile,queryname) then
      if trace_locating then
       report_zip("finder: file %a found",queryname)
      end
@@ -23514,12 +24118,12 @@
     if trace_locating then
      report_zip("opener; archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local handle=filehandle(zfile,queryname)
+    if handle then
      if trace_locating then
       report_zip("opener: file %a found",queryname)
      end
-     return resolvers.openers.helpers.textopener('zip',original,dfile)
+     return resolvers.openers.helpers.textopener('zip',original,handle)
     elseif trace_locating then
      report_zip("opener: file %a not found",queryname)
     end
@@ -23545,15 +24149,13 @@
     if trace_locating then
      report_zip("loader: archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local data=wholefile(zfile,queryname)
+    if data then
      logs.show_load(original)
      if trace_locating then
       report_zip("loader; file %a loaded",original)
      end
-     local s=dfile:read("*all")
-     dfile:close()
-     return true,s,#s
+     return true,data,#data
     elseif trace_locating then
      report_zip("loader: file %a not found",queryname)
     end
@@ -23600,7 +24202,7 @@
  if trace_locating then
   report_zip("registering: using filter %a",filter)
  end
- for i in z:files() do
+ for i in traversezip(z) do
   local filename=i.filename
   local path,name=match(filename,filter)
   if not path then
@@ -24734,7 +25336,7 @@
 
 package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true
 
--- original size: 9418, stripped down to: 7087
+-- original size: 9637, stripped down to: 7253
 
 if not modules then modules={} end modules ['luat-fmt']={
  version=1.001,
@@ -24804,6 +25406,13 @@
   checkers=checkers,
   reporter=report_format,
  },
+ luametatex=sandbox.registerrunner {
+  name="make luametatex format",
+  program="luametatex",
+  template=template,
+  checkers=checkers,
+  reporter=report_format,
+ },
  luajittex=sandbox.registerrunner {
   name="make luajittex format",
   program="luajittex",
@@ -24971,10 +25580,10 @@
 
 end -- of closure
 
--- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.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
+-- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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    : 995501
--- stripped bytes    : 395318
+-- original bytes    : 1019480
+-- stripped bytes    : 403728
 
 -- end library merge
 
@@ -25055,6 +25664,8 @@
     'util-env.lua',
     'luat-env.lua', -- can come before inf (as in mkiv)
 
+    'util-zip.lua',
+
     'lxml-tab.lua',
     'lxml-lpt.lua',
  -- 'lxml-ent.lua',

Modified: trunk/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/stubs/mswin/mtxrun.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -194,7 +194,7 @@
 
 package.loaded["l-lua"] = package.loaded["l-lua"] or true
 
--- original size: 6281, stripped down to: 2863
+-- original size: 6330, stripped down to: 2831
 
 if not modules then modules={} end modules ['l-lua']={
  version=1.001,
@@ -312,7 +312,6 @@
  ffi.number=tonumber
 end
 if LUAVERSION>5.3 then
- collectgarbage("generational")
 end
 
 
@@ -3766,7 +3765,7 @@
 
 package.loaded["l-os"] = package.loaded["l-os"] or true
 
--- original size: 19347, stripped down to: 10258
+-- original size: 18916, stripped down to: 10126
 
 if not modules then modules={} end modules ['l-os']={
  version=1.001,
@@ -3933,16 +3932,6 @@
 function os.launch(str)
  execute(format(launchers[os.name] or launchers.unix,str))
 end
-if not os.times then
- function os.times()
-  return {
-   utime=os.gettimeofday(),
-   stime=0,
-   cutime=0,
-   cstime=0,
-  }
- end
-end
 local gettimeofday=os.gettimeofday or os.clock
 os.gettimeofday=gettimeofday
 local startuptime=gettimeofday()
@@ -4218,7 +4207,7 @@
 
 package.loaded["l-file"] = package.loaded["l-file"] or true
 
--- original size: 21804, stripped down to: 9980
+-- original size: 21984, stripped down to: 10148
 
 if not modules then modules={} end modules ['l-file']={
  version=1.001,
@@ -4398,41 +4387,46 @@
 function file.reslash(str)
  return str and lpegmatch(reslasher,str)
 end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
-  name=name.."/m_t_x_t_e_s_t.tmp"
-  local f=io.open(name,"wb")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+  if not name then
+  elseif lfs.isdir(name) then
+   name=name.."/m_t_x_t_e_s_t.tmp"
+   local f=io.open(name,"wb")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
+  elseif lfs.isfile(name) then
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    return true
+   end
+  else
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
   end
- elseif lfs.isfile(name) then
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   return true
+  return false
+ end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+  if name then
+   local a=attributes(name)
+   return a and lpegmatch(readable,a.permissions) or false
+  else
+   return false
   end
- else
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
-  end
  end
- return false
 end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
-  local a=attributes(name)
-  return a and lpegmatch(readable,a.permissions) or false
- else
-  return false
- end
-end
 file.isreadable=file.is_readable 
 file.iswritable=file.is_writable 
 function file.size(name)
@@ -5062,7 +5056,7 @@
 
 package.loaded["l-dir"] = package.loaded["l-dir"] or true
 
--- original size: 18002, stripped down to: 10681
+-- original size: 18253, stripped down to: 10816
 
 if not modules then modules={} end modules ['l-dir']={
  version=1.001,
@@ -5127,13 +5121,15 @@
   end
   local dirs
   local nofdirs=0
-  for name in walkdir(usedpath) do
+  for name,mode,size,time in walkdir(usedpath) do
    if name~="." and name~=".." then
     local full=path..name
-    local mode=attributes(full,'mode')
+    if mode==nil then
+     mode=attributes(full,'mode')
+    end
     if mode=='file' then
      if not patt or find(full,patt) then
-      action(full)
+      action(full,size,time)
      end
     elseif recurse and mode=="directory" then
      if dirs then
@@ -5169,10 +5165,12 @@
  local dirs
  local nofdirs=0
  local noffiles=#result
- for name,a in walkdir(usedpath) do
+ for name,mode in walkdir(usedpath) do
   if name~="." and name~=".." then
    local full=path..name
-   local mode=attributes(full,'mode')
+   if mode==nil then
+    mode=attributes(full,'mode')
+   end
    if mode=='file' then
     if not patt or find(full,patt) then
      noffiles=noffiles+1
@@ -5223,7 +5221,7 @@
   if not find(path,"/$") then
    path=path..'/'
   end
-  for name in scanner,first do
+  for name in scanner,first do 
    if name=="." then
    elseif name==".." then
    else
@@ -5314,10 +5312,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if recurse then
      globfiles(path.."/"..name,recurse,func,files)
@@ -5340,10 +5340,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if not func or func(name) then
      noffiles=noffiles+1
@@ -5524,8 +5526,7 @@
 function dir.push(newdir)
  local curdir=currentdir()
  insert(stack,curdir)
- if newdir and newdir~="" then
-  chdir(newdir)
+ if newdir and newdir~="" and chdir(newdir) then
   return newdir
  else
   return curdir
@@ -6466,7 +6467,7 @@
 
 package.loaded["util-str"] = package.loaded["util-str"] or true
 
--- original size: 43538, stripped down to: 21641
+-- original size: 43488, stripped down to: 21595
 
 if not modules then modules={} end modules ['util-str']={
  version=1.001,
@@ -6482,7 +6483,6 @@
 local load,dump=load,string.dump
 local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
 local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
 local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
 local patterns,lpegmatch=lpeg.patterns,lpeg.match
 local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -7307,7 +7307,7 @@
 
 package.loaded["util-tab"] = package.loaded["util-tab"] or true
 
--- original size: 28810, stripped down to: 16134
+-- original size: 28866, stripped down to: 16134
 
 if not modules then modules={} end modules ['util-tab']={
  version=1.001,
@@ -7971,7 +7971,7 @@
 
 package.loaded["util-fil"] = package.loaded["util-fil"] or true
 
--- original size: 8607, stripped down to: 6727
+-- original size: 11530, stripped down to: 9007
 
 if not modules then modules={} end modules ['util-fil']={
  version=1.001,
@@ -8180,6 +8180,32 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 else
  local floor=math.floor
  function files.writecardinal2(f,n)
@@ -8188,17 +8214,33 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
-end
 function files.writestring(f,s)
  f:write(char(byte(s,1,#s)))
 end
@@ -8210,10 +8252,18 @@
  files.readcardinal2=fio.readcardinal2
  files.readcardinal3=fio.readcardinal3
  files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
  files.readinteger1=fio.readinteger1
  files.readinteger2=fio.readinteger2
  files.readinteger3=fio.readinteger3
  files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
  files.readfixed2=fio.readfixed2
  files.readfixed4=fio.readfixed4
  files.read2dot14=fio.read2dot14
@@ -8234,6 +8284,24 @@
   skipposition(f,4*(n or 1))
  end
 end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
 if fio and fio.readcardinaltable then
  files.readcardinaltable=fio.readcardinaltable
  files.readintegertable=fio.readintegertable
@@ -8271,7 +8339,7 @@
 
 package.loaded["util-sac"] = package.loaded["util-sac"] or true
 
--- original size: 11065, stripped down to: 8209
+-- original size: 11332, stripped down to: 8420
 
 if not modules then modules={} end modules ['util-sac']={
  version=1.001,
@@ -8296,6 +8364,11 @@
   return { f,1,#f,zerobased or false }
  end
 end
+function streams.getstring(f)
+ if f then
+  return f[1]
+ end
+end
 function streams.close()
 end
 function streams.size(f)
@@ -8386,7 +8459,7 @@
  local a,b=byte(f[1],i,j)
  return 0x100*a+b
 end
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
  local i=f[2]
  local j=i+1
  f[2]=j+1
@@ -8458,6 +8531,13 @@
  local a,b,c,d=byte(f[1],i,j)
  return 0x1000000*a+0x10000*b+0x100*c+d
 end
+function streams.readcardinal4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
 function streams.readinteger4(f)
  local i=f[2]
  local j=i+3
@@ -9545,13 +9625,13 @@
 
 package.loaded["util-soc-imp-socket"] = package.loaded["util-soc-imp-socket"] or true
 
--- original size: 4870, stripped down to: 3527
+-- original size: 4905, stripped down to: 3562
 
 
 local type,tostring,setmetatable=type,tostring,setmetatable
 local min=math.min
 local format=string.format
-local socket=require("socket.core")
+local socket=socket or package.loaded.socket or require("socket.core")
 local connect=socket.connect
 local tcp4=socket.tcp4
 local tcp6=socket.tcp6
@@ -10734,12 +10814,12 @@
 
 package.loaded["util-soc-imp-mime"] = package.loaded["util-soc-imp-mime"] or true
 
--- original size: 2328, stripped down to: 1874
+-- original size: 2373, stripped down to: 1931
 
 
 local type,tostring=type,tostring
-local mime=require("mime.core")
-local ltn12=ltn12 or require("ltn12")
+local mime=mime  or package.loaded.mime  or require("mime.core")
+local ltn12=ltn12 or package.loaded.ltn12 or require("ltn12")
 local filtercycle=ltn12.filter.cycle
 local function report(fmt,first,...)
  if logs then
@@ -12691,7 +12771,7 @@
 
 package.loaded["trac-log"] = package.loaded["trac-log"] or true
 
--- original size: 32608, stripped down to: 20925
+-- original size: 32618, stripped down to: 20935
 
 if not modules then modules={} end modules ['trac-log']={
  version=1.001,
@@ -12736,7 +12816,7 @@
 setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
 local report,subreport,status,settarget,setformats,settranslations
 local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
-if runningtex then
+if runningtex and texio then
  if texio.setescape then
   texio.setescape(0) 
  end
@@ -15613,6 +15693,468 @@
 
 do -- create closure to overcome 200 locals limit
 
+package.loaded["util-zip"] = package.loaded["util-zip"] or true
+
+-- original size: 18645, stripped down to: 11291
+
+if not modules then modules={} end modules ['util-zip']={
+ version=1.001,
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local type,tostring,tonumber=type,tostring,tonumber
+local sort=table.sort
+local find,format,sub,gsub=string.find,string.format,string.sub,string.gsub
+local osdate,ostime=os.date,os.time
+local ioopen=io.open
+local loaddata,savedata=io.loaddata,io.savedata
+local filejoin,isdir,dirname,mkdirs=file.join,lfs.isdir,file.dirname,dir.mkdirs
+local files=utilities.files
+local openfile=files.open
+local closefile=files.close
+local readstring=files.readstring
+local readcardinal2=files.readcardinal2le
+local readcardinal4=files.readcardinal4le
+local setposition=files.setposition
+local getposition=files.getposition
+local band=bit32.band
+local rshift=bit32.rshift
+local lshift=bit32.lshift
+local decompress,calculatecrc
+if flate then
+ decompress=flate.flate_decompress
+ calculatecrc=flate.update_crc32
+else
+ local zlibdecompress=zlib.decompress
+ local zlibchecksum=zlib.crc32
+ decompress=function(source,targetsize)
+  local target=zlibdecompress(source,-15)
+  if target then
+   return target
+  else
+   return false,1
+  end
+ end
+ calculatecrc=function(buffer,initial)
+  return zlibchecksum(initial or 0,buffer)
+ end
+end
+local zipfiles={}
+utilities.zipfiles=zipfiles
+local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist  do
+ function openzipfile(name)
+  return {
+   name=name,
+   handle=openfile(name,0),
+  }
+ end
+ local function collect(z)
+  if not z.list then
+   local list={}
+   local hash={}
+   local position=0
+   local index=0
+   local handle=z.handle
+   while true do
+    setposition(handle,position)
+    local signature=readstring(handle,4)
+    if signature=="PK\3\4" then
+     local version=readcardinal2(handle)
+     local flag=readcardinal2(handle)
+     local method=readcardinal2(handle)
+     local filetime=readcardinal2(handle)
+     local filedate=readcardinal2(handle)
+     local crc32=readcardinal4(handle)
+     local compressed=readcardinal4(handle)
+     local uncompressed=readcardinal4(handle)
+     local namelength=readcardinal2(handle)
+     local extralength=readcardinal2(handle)
+     local filename=readstring(handle,namelength)
+     local descriptor=band(flag,8)~=0
+     local encrypted=band(flag,1)~=0
+     local acceptable=method==0 or method==8
+     local skipped=0
+     local size=0
+     if encrypted then
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      skipbytes(8)
+      skipped=skipped+8
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      size=readcardinal4(handle)
+      skipbytes(size)
+      skipped=skipped+size+4
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+     end
+     position=position+30+namelength+extralength+skipped
+     if descriptor then
+      setposition(handle,position+compressed)
+      crc32=readcardinal4(handle)
+      compressed=readcardinal4(handle)
+      uncompressed=readcardinal4(handle)
+     end
+     if acceptable then
+      index=index+1
+      local data={
+       filename=filename,
+       index=index,
+       position=position,
+       method=method,
+       compressed=compressed,
+       uncompressed=uncompressed,
+       crc32=crc32,
+       encrypted=encrypted,
+      }
+      hash[filename]=data
+      list[index]=data
+     else
+     end
+     position=position+compressed
+    else
+     break
+    end
+    z.list=list
+    z.hash=hash
+   end
+  end
+ end
+ function getziplist(z)
+  local list=z.list
+  if not list then
+   collect(z)
+  end
+  return z.list
+ end
+ function getziphash(z)
+  local hash=z.hash
+  if not hash then
+   collect(z)
+  end
+  return z.hash
+ end
+ function foundzipfile(z,name)
+  return getziphash(z)[name]
+ end
+ function closezipfile(z)
+  local f=z.handle
+  if f then
+   closefile(f)
+   z.handle=nil
+  end
+ end
+ function unzipfile(z,filename,check)
+  local hash=z.hash
+  if not hash then
+   hash=zipfiles.hash(z)
+  end
+  local data=hash[filename] 
+  if not data then
+  end
+  if data then
+   local handle=z.handle
+   local position=data.position
+   local compressed=data.compressed
+   if compressed>0 then
+    setposition(handle,position)
+    local result=readstring(handle,compressed)
+    if data.method==8 then
+     result=decompress(result,data.uncompressed)
+    end
+    if check and data.crc32~=calculatecrc(result) then
+     print("checksum mismatch")
+     return ""
+    end
+    return result
+   else
+    return ""
+   end
+  end
+ end
+ zipfiles.open=openzipfile
+ zipfiles.close=closezipfile
+ zipfiles.unzip=unzipfile
+ zipfiles.hash=getziphash
+ zipfiles.list=getziplist
+ zipfiles.found=foundzipfile
+end
+if flate then do
+ local writecardinal1=files.writebyte
+ local writecardinal2=files.writecardinal2le
+ local writecardinal4=files.writecardinal4le
+ local logwriter=logs.writer
+ local globpattern=dir.globpattern
+ local compress=flate.flate_compress
+ local checksum=flate.update_crc32
+ local function fromdostime(dostime,dosdate)
+  return ostime {
+   year=rshift(dosdate,9)+1980,
+   month=band(rshift(dosdate,5),0x0F),
+   day=band((dosdate   ),0x1F),
+   hour=band(rshift(dostime,11)    ),
+   min=band(rshift(dostime,5),0x3F),
+   sec=band((dostime   ),0x1F),
+  }
+ end
+ local function todostime(time)
+  local t=osdate("*t",time)
+  return
+   lshift(t.year-1980,9)+lshift(t.month,5)+t.day,
+   lshift(t.hour,11)+lshift(t.min,5)+rshift(t.sec,1)
+ end
+ local function openzip(filename,level,comment,verbose)
+  local f=ioopen(filename,"wb")
+  if f then
+   return {
+    filename=filename,
+    handle=f,
+    list={},
+    level=tonumber(level) or 3,
+    comment=tostring(comment),
+    verbose=verbose,
+    uncompressed=0,
+    compressed=0,
+   }
+  end
+ end
+ local function writezip(z,name,data,level,time)
+  local f=z.handle
+  local list=z.list
+  local level=tonumber(level) or z.level or 3
+  local method=8
+  local zipped=compress(data,level)
+  local checksum=checksum(data)
+  local verbose=z.verbose
+  if not zipped then
+   method=0
+   zipped=data
+  end
+  local start=f:seek()
+  local compressed=#zipped
+  local uncompressed=#data
+  z.compressed=z.compressed+compressed
+  z.uncompressed=z.uncompressed+uncompressed
+  if verbose then
+   local pct=100*compressed/uncompressed
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,name))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,name))
+   end
+  end
+  f:write("\x50\x4b\x03\x04")
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,method)    
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal4(f,checksum)  
+  writecardinal4(f,compressed)   
+  writecardinal4(f,uncompressed) 
+  writecardinal2(f,#name)  
+  writecardinal2(f,0)
+  f:write(name)      
+  f:write(zipped)
+  list[#list+1]={ #zipped,#data,name,checksum,start,time or 0 }
+ end
+ local function closezip(z)
+  local f=z.handle
+  local list=z.list
+  local comment=z.comment
+  local verbose=z.verbose
+  local count=#list
+  local start=f:seek()
+  for i=1,count do
+   local l=list[i]
+   local compressed=l[1]
+   local uncompressed=l[2]
+   local name=l[3]
+   local checksum=l[4]
+   local start=l[5]
+   local time=l[6]
+   local date,time=todostime(time)
+   f:write('\x50\x4b\x01\x02')
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,8)   
+   writecardinal2(f,time)   
+   writecardinal2(f,date)   
+   writecardinal4(f,checksum)  
+   writecardinal4(f,compressed)   
+   writecardinal4(f,uncompressed) 
+   writecardinal2(f,#name)  
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal4(f,0)   
+   writecardinal4(f,start)  
+   f:write(name)      
+  end
+  local stop=f:seek()
+  local size=stop-start
+  f:write('\x50\x4b\x05\x06')
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,count)  
+  writecardinal2(f,count)  
+  writecardinal4(f,size)   
+  writecardinal4(f,start)  
+  if type(comment)=="string" and comment~="" then
+   writecardinal2(f,#comment) 
+   f:write(comment)     
+  else
+   writecardinal2(f,0)
+  end
+  if verbose then
+   local compressed=z.compressed
+   local uncompressed=z.uncompressed
+   local filename=z.filename
+   local pct=100*compressed/uncompressed
+   logwriter("")
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,filename))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,filename))
+   end
+  end
+  f:close()
+ end
+ local function zipdir(zipname,path,level,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   level=zipname.level
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  if not isdir(path) then
+   return
+  end
+  path=gsub(path,"\\+","/")
+  path=gsub(path,"/+","/")
+  local list={}
+  local count=0
+  globpattern(path,"",true,function(name,size,time)
+   count=count+1
+   list[count]={ name,time }
+  end)
+  sort(list,function(a,b)
+   return a[1]<b[1]
+  end)
+  local zipf=openzip(zipname,level,comment,verbose)
+  if zipf then
+   local p=#path+2
+   for i=1,count do
+    local li=list[i]
+    local name=li[1]
+    local time=li[2]
+    local data=loaddata(name)
+    local name=sub(name,p,#name)
+    writezip(zipf,name,data,level,time,verbose)
+   end
+   closezip(zipf)
+  end
+ end
+ local function unzipdir(zipname,path,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  local z=openzipfile(zipname)
+  if z then
+   local list=getziplist(z)
+   if list then
+    local total=0
+    local count=#list
+    local step=number.idiv(count,10)
+    local done=0
+    for i=1,count do
+     local l=list[i]
+     local n=l.filename
+     local d=unzipfile(z,n) 
+     local p=filejoin(path,n)
+     if mkdirs(dirname(p)) then
+      if verbose=="steps" then
+       total=total+#d
+       done=done+1
+       if done>=step then
+        done=0
+        logwriter(format("%4i files of %4i done, %10i bytes",i,count,total))
+       end
+      elseif verbose then
+       logwriter(n)
+      end
+      savedata(p,d)
+     end
+    end
+    if verbose=="steps" then
+     logwriter(format("%4i files of %4i done, %10i bytes",count,count,total))
+    end
+    closezipfile(z)
+    return true
+   else
+    closezipfile(z)
+   end
+  end
+ end
+ zipfiles.zipdir=zipdir
+ zipfiles.unzipdir=unzipdir
+end end
+if flate then
+ local streams=utilities.streams
+ local openfile=streams.open
+ local closestream=streams.close
+ local setposition=streams.setposition
+ local getsize=streams.size
+ local readcardinal4=streams.readcardinal4le
+ local getstring=streams.getstring
+ local decompress=flate.gz_decompress
+ function zipfiles.gunzipfile(filename)
+  local strm=openfile(filename)
+  if strm then
+   setposition(strm,getsize(strm)-4+1)
+   local size=readcardinal4(strm)
+   local data=decompress(getstring(strm),size)
+   closestream(strm)
+   return data
+  end
+ end
+elseif gzip then
+ local openfile=gzip.open
+ function zipfiles.gunzipfile(filename)
+  local g=openfile(filename,"rb")
+  if g then
+   local d=g:read("*a")
+   d:close()
+   return d
+  end
+ end
+end
+
+
+end -- of closure
+
+do -- create closure to overcome 200 locals limit
+
 package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
 
 -- original size: 60383, stripped down to: 35698
@@ -20103,7 +20645,7 @@
 
 package.loaded["data-exp"] = package.loaded["data-exp"] or true
 
--- original size: 18105, stripped down to: 10389
+-- original size: 18154, stripped down to: 10416
 
 if not modules then modules={} end modules ['data-exp']={
  version=1.001,
@@ -20310,9 +20852,11 @@
  local pattern=tolerant and lessweird or weird
  local filelist={}
  local noffiles=0
- for name in directory(full) do
+ for name,mode in directory(full) do
   if not lpegmatch(pattern,name) then
-   local mode=attributes(full..name,"mode")
+   if not mode then
+    mode=attributes(full..name,"mode")
+   end
    if mode=="file" then
     n=n+1
     noffiles=noffiles+1
@@ -20793,7 +21337,7 @@
 
 package.loaded["data-tmp"] = package.loaded["data-tmp"] or true
 
--- original size: 16116, stripped down to: 10782
+-- original size: 16284, stripped down to: 10938
 
 if not modules then modules={} end modules ['data-tmp']={
  version=1.100,
@@ -20833,6 +21377,7 @@
 caches.ask=false
 caches.relocate=false
 caches.defaults={ "TMPDIR","TEMPDIR","TMP","TEMP","HOME","HOMEPATH" }
+directives.register("system.caches.fast",function(v) caches.fast=true end)
 local writable,readables,usedreadables=nil,{},{}
 local function identify()
  local texmfcaches=resolvers.cleanpathlist("TEXMFCACHE") 
@@ -21066,7 +21611,9 @@
 function caches.savedata(filepath,filename,data,raw)
  local tmaname,tmcname=caches.setluanames(filepath,filename)
  data.cache_uuid=os.uuid()
- if caches.direct then
+ if caches.fast then
+  file.savedata(tmaname,table.fastserialize(data,true))
+ elseif caches.direct then
   file.savedata(tmaname,table.serialize(data,true,saveoptions))
  else
   table.tofile(tmaname,data,true,saveoptions)
@@ -23400,7 +23947,7 @@
 
 package.loaded["data-zip"] = package.loaded["data-zip"] or true
 
--- original size: 8700, stripped down to: 6313
+-- original size: 10263, stripped down to: 7556
 
 if not modules then modules={} end modules ['data-zip']={
  version=1.001,
@@ -23419,6 +23966,65 @@
 zip.archives=archives
 local registeredfiles=zip.registeredfiles or {}
 zip.registeredfiles=registeredfiles
+local zipfiles=utilities.zipfiles
+local openzip,closezip,validfile,wholefile,filehandle,traversezip
+if zipfiles then
+ local ipairs=ipairs
+ openzip=zipfiles.open
+ closezip=zipfiles.close
+ validfile=zipfiles.found
+ wholefile=zipfiles.unzip
+ traversezip=function(zfile)
+  return ipairs(zipfiles.list(zfile))
+ end
+ local streams=utilities.streams
+ local openstream=streams.open
+ local readstring=streams.readstring
+ local streamsize=streams.size
+ local metatable={
+  close=streams.close,
+  read=function(stream,n)
+   readstring(stream,n=="*a" and streamsize(stream) or n)
+  end
+ }
+ filehandle=function(zfile,queryname)
+  local data=wholefile(zfile,queryname)
+  if data then
+   local stream=openstream(data)
+   if stream then
+    return setmetatableindex(stream,metatable)
+   end
+  end
+ end
+else
+ openzip=zip.open
+ closezip=zip.close
+ validfile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   dfile:close()
+   return true
+  end
+  return false
+ end
+ traversezip=function(zfile)
+  return z:files()
+ end
+ wholefile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   local s=dfile:read("*all")
+   dfile:close()
+   return s
+  end
+ end
+ filehandle=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   return dfile
+  end
+ end
+end
 local function validzip(str) 
  if not find(str,"^zip://") then
   return "zip:///"..str
@@ -23433,7 +24039,7 @@
   local arch=archives[name]
   if not arch then
      local full=resolvers.findfile(name) or ""
-     arch=full~="" and zip.open(full) or false
+     arch=full~="" and openzip(full) or false
      archives[name]=arch
   end
     return arch
@@ -23441,7 +24047,7 @@
 end
 function zip.closearchive(name)
  if not name or (name=="" and archives[name]) then
-  zip.close(archives[name])
+  closezip(archives[name])
   archives[name]=nil
  end
 end
@@ -23482,9 +24088,7 @@
     if trace_locating then
      report_zip("finder: archive %a found",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
-     dfile:close()
+    if validfile(zfile,queryname) then
      if trace_locating then
       report_zip("finder: file %a found",queryname)
      end
@@ -23514,12 +24118,12 @@
     if trace_locating then
      report_zip("opener; archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local handle=filehandle(zfile,queryname)
+    if handle then
      if trace_locating then
       report_zip("opener: file %a found",queryname)
      end
-     return resolvers.openers.helpers.textopener('zip',original,dfile)
+     return resolvers.openers.helpers.textopener('zip',original,handle)
     elseif trace_locating then
      report_zip("opener: file %a not found",queryname)
     end
@@ -23545,15 +24149,13 @@
     if trace_locating then
      report_zip("loader: archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local data=wholefile(zfile,queryname)
+    if data then
      logs.show_load(original)
      if trace_locating then
       report_zip("loader; file %a loaded",original)
      end
-     local s=dfile:read("*all")
-     dfile:close()
-     return true,s,#s
+     return true,data,#data
     elseif trace_locating then
      report_zip("loader: file %a not found",queryname)
     end
@@ -23600,7 +24202,7 @@
  if trace_locating then
   report_zip("registering: using filter %a",filter)
  end
- for i in z:files() do
+ for i in traversezip(z) do
   local filename=i.filename
   local path,name=match(filename,filter)
   if not path then
@@ -24734,7 +25336,7 @@
 
 package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true
 
--- original size: 9418, stripped down to: 7087
+-- original size: 9637, stripped down to: 7253
 
 if not modules then modules={} end modules ['luat-fmt']={
  version=1.001,
@@ -24804,6 +25406,13 @@
   checkers=checkers,
   reporter=report_format,
  },
+ luametatex=sandbox.registerrunner {
+  name="make luametatex format",
+  program="luametatex",
+  template=template,
+  checkers=checkers,
+  reporter=report_format,
+ },
  luajittex=sandbox.registerrunner {
   name="make luajittex format",
   program="luajittex",
@@ -24971,10 +25580,10 @@
 
 end -- of closure
 
--- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.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
+-- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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    : 995501
--- stripped bytes    : 395318
+-- original bytes    : 1019480
+-- stripped bytes    : 403728
 
 -- end library merge
 
@@ -25055,6 +25664,8 @@
     'util-env.lua',
     'luat-env.lua', -- can come before inf (as in mkiv)
 
+    'util-zip.lua',
+
     'lxml-tab.lua',
     'lxml-lpt.lua',
  -- 'lxml-ent.lua',

Modified: trunk/Master/texmf-dist/scripts/context/stubs/unix/mtxrun
===================================================================
--- trunk/Master/texmf-dist/scripts/context/stubs/unix/mtxrun	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/stubs/unix/mtxrun	2019-03-24 21:21:32 UTC (rev 50573)
@@ -194,7 +194,7 @@
 
 package.loaded["l-lua"] = package.loaded["l-lua"] or true
 
--- original size: 6281, stripped down to: 2863
+-- original size: 6330, stripped down to: 2831
 
 if not modules then modules={} end modules ['l-lua']={
  version=1.001,
@@ -312,7 +312,6 @@
  ffi.number=tonumber
 end
 if LUAVERSION>5.3 then
- collectgarbage("generational")
 end
 
 
@@ -3766,7 +3765,7 @@
 
 package.loaded["l-os"] = package.loaded["l-os"] or true
 
--- original size: 19347, stripped down to: 10258
+-- original size: 18916, stripped down to: 10126
 
 if not modules then modules={} end modules ['l-os']={
  version=1.001,
@@ -3933,16 +3932,6 @@
 function os.launch(str)
  execute(format(launchers[os.name] or launchers.unix,str))
 end
-if not os.times then
- function os.times()
-  return {
-   utime=os.gettimeofday(),
-   stime=0,
-   cutime=0,
-   cstime=0,
-  }
- end
-end
 local gettimeofday=os.gettimeofday or os.clock
 os.gettimeofday=gettimeofday
 local startuptime=gettimeofday()
@@ -4218,7 +4207,7 @@
 
 package.loaded["l-file"] = package.loaded["l-file"] or true
 
--- original size: 21804, stripped down to: 9980
+-- original size: 21984, stripped down to: 10148
 
 if not modules then modules={} end modules ['l-file']={
  version=1.001,
@@ -4398,41 +4387,46 @@
 function file.reslash(str)
  return str and lpegmatch(reslasher,str)
 end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
-  name=name.."/m_t_x_t_e_s_t.tmp"
-  local f=io.open(name,"wb")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+  if not name then
+  elseif lfs.isdir(name) then
+   name=name.."/m_t_x_t_e_s_t.tmp"
+   local f=io.open(name,"wb")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
+  elseif lfs.isfile(name) then
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    return true
+   end
+  else
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
   end
- elseif lfs.isfile(name) then
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   return true
+  return false
+ end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+  if name then
+   local a=attributes(name)
+   return a and lpegmatch(readable,a.permissions) or false
+  else
+   return false
   end
- else
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
-  end
  end
- return false
 end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
-  local a=attributes(name)
-  return a and lpegmatch(readable,a.permissions) or false
- else
-  return false
- end
-end
 file.isreadable=file.is_readable 
 file.iswritable=file.is_writable 
 function file.size(name)
@@ -5062,7 +5056,7 @@
 
 package.loaded["l-dir"] = package.loaded["l-dir"] or true
 
--- original size: 18002, stripped down to: 10681
+-- original size: 18253, stripped down to: 10816
 
 if not modules then modules={} end modules ['l-dir']={
  version=1.001,
@@ -5127,13 +5121,15 @@
   end
   local dirs
   local nofdirs=0
-  for name in walkdir(usedpath) do
+  for name,mode,size,time in walkdir(usedpath) do
    if name~="." and name~=".." then
     local full=path..name
-    local mode=attributes(full,'mode')
+    if mode==nil then
+     mode=attributes(full,'mode')
+    end
     if mode=='file' then
      if not patt or find(full,patt) then
-      action(full)
+      action(full,size,time)
      end
     elseif recurse and mode=="directory" then
      if dirs then
@@ -5169,10 +5165,12 @@
  local dirs
  local nofdirs=0
  local noffiles=#result
- for name,a in walkdir(usedpath) do
+ for name,mode in walkdir(usedpath) do
   if name~="." and name~=".." then
    local full=path..name
-   local mode=attributes(full,'mode')
+   if mode==nil then
+    mode=attributes(full,'mode')
+   end
    if mode=='file' then
     if not patt or find(full,patt) then
      noffiles=noffiles+1
@@ -5223,7 +5221,7 @@
   if not find(path,"/$") then
    path=path..'/'
   end
-  for name in scanner,first do
+  for name in scanner,first do 
    if name=="." then
    elseif name==".." then
    else
@@ -5314,10 +5312,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if recurse then
      globfiles(path.."/"..name,recurse,func,files)
@@ -5340,10 +5340,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if not func or func(name) then
      noffiles=noffiles+1
@@ -5524,8 +5526,7 @@
 function dir.push(newdir)
  local curdir=currentdir()
  insert(stack,curdir)
- if newdir and newdir~="" then
-  chdir(newdir)
+ if newdir and newdir~="" and chdir(newdir) then
   return newdir
  else
   return curdir
@@ -6466,7 +6467,7 @@
 
 package.loaded["util-str"] = package.loaded["util-str"] or true
 
--- original size: 43538, stripped down to: 21641
+-- original size: 43488, stripped down to: 21595
 
 if not modules then modules={} end modules ['util-str']={
  version=1.001,
@@ -6482,7 +6483,6 @@
 local load,dump=load,string.dump
 local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
 local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
 local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
 local patterns,lpegmatch=lpeg.patterns,lpeg.match
 local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -7307,7 +7307,7 @@
 
 package.loaded["util-tab"] = package.loaded["util-tab"] or true
 
--- original size: 28810, stripped down to: 16134
+-- original size: 28866, stripped down to: 16134
 
 if not modules then modules={} end modules ['util-tab']={
  version=1.001,
@@ -7971,7 +7971,7 @@
 
 package.loaded["util-fil"] = package.loaded["util-fil"] or true
 
--- original size: 8607, stripped down to: 6727
+-- original size: 11530, stripped down to: 9007
 
 if not modules then modules={} end modules ['util-fil']={
  version=1.001,
@@ -8180,6 +8180,32 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 else
  local floor=math.floor
  function files.writecardinal2(f,n)
@@ -8188,17 +8214,33 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
-end
 function files.writestring(f,s)
  f:write(char(byte(s,1,#s)))
 end
@@ -8210,10 +8252,18 @@
  files.readcardinal2=fio.readcardinal2
  files.readcardinal3=fio.readcardinal3
  files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
  files.readinteger1=fio.readinteger1
  files.readinteger2=fio.readinteger2
  files.readinteger3=fio.readinteger3
  files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
  files.readfixed2=fio.readfixed2
  files.readfixed4=fio.readfixed4
  files.read2dot14=fio.read2dot14
@@ -8234,6 +8284,24 @@
   skipposition(f,4*(n or 1))
  end
 end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
 if fio and fio.readcardinaltable then
  files.readcardinaltable=fio.readcardinaltable
  files.readintegertable=fio.readintegertable
@@ -8271,7 +8339,7 @@
 
 package.loaded["util-sac"] = package.loaded["util-sac"] or true
 
--- original size: 11065, stripped down to: 8209
+-- original size: 11332, stripped down to: 8420
 
 if not modules then modules={} end modules ['util-sac']={
  version=1.001,
@@ -8296,6 +8364,11 @@
   return { f,1,#f,zerobased or false }
  end
 end
+function streams.getstring(f)
+ if f then
+  return f[1]
+ end
+end
 function streams.close()
 end
 function streams.size(f)
@@ -8386,7 +8459,7 @@
  local a,b=byte(f[1],i,j)
  return 0x100*a+b
 end
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
  local i=f[2]
  local j=i+1
  f[2]=j+1
@@ -8458,6 +8531,13 @@
  local a,b,c,d=byte(f[1],i,j)
  return 0x1000000*a+0x10000*b+0x100*c+d
 end
+function streams.readcardinal4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
 function streams.readinteger4(f)
  local i=f[2]
  local j=i+3
@@ -9545,13 +9625,13 @@
 
 package.loaded["util-soc-imp-socket"] = package.loaded["util-soc-imp-socket"] or true
 
--- original size: 4870, stripped down to: 3527
+-- original size: 4905, stripped down to: 3562
 
 
 local type,tostring,setmetatable=type,tostring,setmetatable
 local min=math.min
 local format=string.format
-local socket=require("socket.core")
+local socket=socket or package.loaded.socket or require("socket.core")
 local connect=socket.connect
 local tcp4=socket.tcp4
 local tcp6=socket.tcp6
@@ -10734,12 +10814,12 @@
 
 package.loaded["util-soc-imp-mime"] = package.loaded["util-soc-imp-mime"] or true
 
--- original size: 2328, stripped down to: 1874
+-- original size: 2373, stripped down to: 1931
 
 
 local type,tostring=type,tostring
-local mime=require("mime.core")
-local ltn12=ltn12 or require("ltn12")
+local mime=mime  or package.loaded.mime  or require("mime.core")
+local ltn12=ltn12 or package.loaded.ltn12 or require("ltn12")
 local filtercycle=ltn12.filter.cycle
 local function report(fmt,first,...)
  if logs then
@@ -12691,7 +12771,7 @@
 
 package.loaded["trac-log"] = package.loaded["trac-log"] or true
 
--- original size: 32608, stripped down to: 20925
+-- original size: 32618, stripped down to: 20935
 
 if not modules then modules={} end modules ['trac-log']={
  version=1.001,
@@ -12736,7 +12816,7 @@
 setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
 local report,subreport,status,settarget,setformats,settranslations
 local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
-if runningtex then
+if runningtex and texio then
  if texio.setescape then
   texio.setescape(0) 
  end
@@ -15613,6 +15693,468 @@
 
 do -- create closure to overcome 200 locals limit
 
+package.loaded["util-zip"] = package.loaded["util-zip"] or true
+
+-- original size: 18645, stripped down to: 11291
+
+if not modules then modules={} end modules ['util-zip']={
+ version=1.001,
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local type,tostring,tonumber=type,tostring,tonumber
+local sort=table.sort
+local find,format,sub,gsub=string.find,string.format,string.sub,string.gsub
+local osdate,ostime=os.date,os.time
+local ioopen=io.open
+local loaddata,savedata=io.loaddata,io.savedata
+local filejoin,isdir,dirname,mkdirs=file.join,lfs.isdir,file.dirname,dir.mkdirs
+local files=utilities.files
+local openfile=files.open
+local closefile=files.close
+local readstring=files.readstring
+local readcardinal2=files.readcardinal2le
+local readcardinal4=files.readcardinal4le
+local setposition=files.setposition
+local getposition=files.getposition
+local band=bit32.band
+local rshift=bit32.rshift
+local lshift=bit32.lshift
+local decompress,calculatecrc
+if flate then
+ decompress=flate.flate_decompress
+ calculatecrc=flate.update_crc32
+else
+ local zlibdecompress=zlib.decompress
+ local zlibchecksum=zlib.crc32
+ decompress=function(source,targetsize)
+  local target=zlibdecompress(source,-15)
+  if target then
+   return target
+  else
+   return false,1
+  end
+ end
+ calculatecrc=function(buffer,initial)
+  return zlibchecksum(initial or 0,buffer)
+ end
+end
+local zipfiles={}
+utilities.zipfiles=zipfiles
+local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist  do
+ function openzipfile(name)
+  return {
+   name=name,
+   handle=openfile(name,0),
+  }
+ end
+ local function collect(z)
+  if not z.list then
+   local list={}
+   local hash={}
+   local position=0
+   local index=0
+   local handle=z.handle
+   while true do
+    setposition(handle,position)
+    local signature=readstring(handle,4)
+    if signature=="PK\3\4" then
+     local version=readcardinal2(handle)
+     local flag=readcardinal2(handle)
+     local method=readcardinal2(handle)
+     local filetime=readcardinal2(handle)
+     local filedate=readcardinal2(handle)
+     local crc32=readcardinal4(handle)
+     local compressed=readcardinal4(handle)
+     local uncompressed=readcardinal4(handle)
+     local namelength=readcardinal2(handle)
+     local extralength=readcardinal2(handle)
+     local filename=readstring(handle,namelength)
+     local descriptor=band(flag,8)~=0
+     local encrypted=band(flag,1)~=0
+     local acceptable=method==0 or method==8
+     local skipped=0
+     local size=0
+     if encrypted then
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      skipbytes(8)
+      skipped=skipped+8
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      size=readcardinal4(handle)
+      skipbytes(size)
+      skipped=skipped+size+4
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+     end
+     position=position+30+namelength+extralength+skipped
+     if descriptor then
+      setposition(handle,position+compressed)
+      crc32=readcardinal4(handle)
+      compressed=readcardinal4(handle)
+      uncompressed=readcardinal4(handle)
+     end
+     if acceptable then
+      index=index+1
+      local data={
+       filename=filename,
+       index=index,
+       position=position,
+       method=method,
+       compressed=compressed,
+       uncompressed=uncompressed,
+       crc32=crc32,
+       encrypted=encrypted,
+      }
+      hash[filename]=data
+      list[index]=data
+     else
+     end
+     position=position+compressed
+    else
+     break
+    end
+    z.list=list
+    z.hash=hash
+   end
+  end
+ end
+ function getziplist(z)
+  local list=z.list
+  if not list then
+   collect(z)
+  end
+  return z.list
+ end
+ function getziphash(z)
+  local hash=z.hash
+  if not hash then
+   collect(z)
+  end
+  return z.hash
+ end
+ function foundzipfile(z,name)
+  return getziphash(z)[name]
+ end
+ function closezipfile(z)
+  local f=z.handle
+  if f then
+   closefile(f)
+   z.handle=nil
+  end
+ end
+ function unzipfile(z,filename,check)
+  local hash=z.hash
+  if not hash then
+   hash=zipfiles.hash(z)
+  end
+  local data=hash[filename] 
+  if not data then
+  end
+  if data then
+   local handle=z.handle
+   local position=data.position
+   local compressed=data.compressed
+   if compressed>0 then
+    setposition(handle,position)
+    local result=readstring(handle,compressed)
+    if data.method==8 then
+     result=decompress(result,data.uncompressed)
+    end
+    if check and data.crc32~=calculatecrc(result) then
+     print("checksum mismatch")
+     return ""
+    end
+    return result
+   else
+    return ""
+   end
+  end
+ end
+ zipfiles.open=openzipfile
+ zipfiles.close=closezipfile
+ zipfiles.unzip=unzipfile
+ zipfiles.hash=getziphash
+ zipfiles.list=getziplist
+ zipfiles.found=foundzipfile
+end
+if flate then do
+ local writecardinal1=files.writebyte
+ local writecardinal2=files.writecardinal2le
+ local writecardinal4=files.writecardinal4le
+ local logwriter=logs.writer
+ local globpattern=dir.globpattern
+ local compress=flate.flate_compress
+ local checksum=flate.update_crc32
+ local function fromdostime(dostime,dosdate)
+  return ostime {
+   year=rshift(dosdate,9)+1980,
+   month=band(rshift(dosdate,5),0x0F),
+   day=band((dosdate   ),0x1F),
+   hour=band(rshift(dostime,11)    ),
+   min=band(rshift(dostime,5),0x3F),
+   sec=band((dostime   ),0x1F),
+  }
+ end
+ local function todostime(time)
+  local t=osdate("*t",time)
+  return
+   lshift(t.year-1980,9)+lshift(t.month,5)+t.day,
+   lshift(t.hour,11)+lshift(t.min,5)+rshift(t.sec,1)
+ end
+ local function openzip(filename,level,comment,verbose)
+  local f=ioopen(filename,"wb")
+  if f then
+   return {
+    filename=filename,
+    handle=f,
+    list={},
+    level=tonumber(level) or 3,
+    comment=tostring(comment),
+    verbose=verbose,
+    uncompressed=0,
+    compressed=0,
+   }
+  end
+ end
+ local function writezip(z,name,data,level,time)
+  local f=z.handle
+  local list=z.list
+  local level=tonumber(level) or z.level or 3
+  local method=8
+  local zipped=compress(data,level)
+  local checksum=checksum(data)
+  local verbose=z.verbose
+  if not zipped then
+   method=0
+   zipped=data
+  end
+  local start=f:seek()
+  local compressed=#zipped
+  local uncompressed=#data
+  z.compressed=z.compressed+compressed
+  z.uncompressed=z.uncompressed+uncompressed
+  if verbose then
+   local pct=100*compressed/uncompressed
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,name))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,name))
+   end
+  end
+  f:write("\x50\x4b\x03\x04")
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,method)    
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal4(f,checksum)  
+  writecardinal4(f,compressed)   
+  writecardinal4(f,uncompressed) 
+  writecardinal2(f,#name)  
+  writecardinal2(f,0)
+  f:write(name)      
+  f:write(zipped)
+  list[#list+1]={ #zipped,#data,name,checksum,start,time or 0 }
+ end
+ local function closezip(z)
+  local f=z.handle
+  local list=z.list
+  local comment=z.comment
+  local verbose=z.verbose
+  local count=#list
+  local start=f:seek()
+  for i=1,count do
+   local l=list[i]
+   local compressed=l[1]
+   local uncompressed=l[2]
+   local name=l[3]
+   local checksum=l[4]
+   local start=l[5]
+   local time=l[6]
+   local date,time=todostime(time)
+   f:write('\x50\x4b\x01\x02')
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,8)   
+   writecardinal2(f,time)   
+   writecardinal2(f,date)   
+   writecardinal4(f,checksum)  
+   writecardinal4(f,compressed)   
+   writecardinal4(f,uncompressed) 
+   writecardinal2(f,#name)  
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal4(f,0)   
+   writecardinal4(f,start)  
+   f:write(name)      
+  end
+  local stop=f:seek()
+  local size=stop-start
+  f:write('\x50\x4b\x05\x06')
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,count)  
+  writecardinal2(f,count)  
+  writecardinal4(f,size)   
+  writecardinal4(f,start)  
+  if type(comment)=="string" and comment~="" then
+   writecardinal2(f,#comment) 
+   f:write(comment)     
+  else
+   writecardinal2(f,0)
+  end
+  if verbose then
+   local compressed=z.compressed
+   local uncompressed=z.uncompressed
+   local filename=z.filename
+   local pct=100*compressed/uncompressed
+   logwriter("")
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,filename))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,filename))
+   end
+  end
+  f:close()
+ end
+ local function zipdir(zipname,path,level,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   level=zipname.level
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  if not isdir(path) then
+   return
+  end
+  path=gsub(path,"\\+","/")
+  path=gsub(path,"/+","/")
+  local list={}
+  local count=0
+  globpattern(path,"",true,function(name,size,time)
+   count=count+1
+   list[count]={ name,time }
+  end)
+  sort(list,function(a,b)
+   return a[1]<b[1]
+  end)
+  local zipf=openzip(zipname,level,comment,verbose)
+  if zipf then
+   local p=#path+2
+   for i=1,count do
+    local li=list[i]
+    local name=li[1]
+    local time=li[2]
+    local data=loaddata(name)
+    local name=sub(name,p,#name)
+    writezip(zipf,name,data,level,time,verbose)
+   end
+   closezip(zipf)
+  end
+ end
+ local function unzipdir(zipname,path,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  local z=openzipfile(zipname)
+  if z then
+   local list=getziplist(z)
+   if list then
+    local total=0
+    local count=#list
+    local step=number.idiv(count,10)
+    local done=0
+    for i=1,count do
+     local l=list[i]
+     local n=l.filename
+     local d=unzipfile(z,n) 
+     local p=filejoin(path,n)
+     if mkdirs(dirname(p)) then
+      if verbose=="steps" then
+       total=total+#d
+       done=done+1
+       if done>=step then
+        done=0
+        logwriter(format("%4i files of %4i done, %10i bytes",i,count,total))
+       end
+      elseif verbose then
+       logwriter(n)
+      end
+      savedata(p,d)
+     end
+    end
+    if verbose=="steps" then
+     logwriter(format("%4i files of %4i done, %10i bytes",count,count,total))
+    end
+    closezipfile(z)
+    return true
+   else
+    closezipfile(z)
+   end
+  end
+ end
+ zipfiles.zipdir=zipdir
+ zipfiles.unzipdir=unzipdir
+end end
+if flate then
+ local streams=utilities.streams
+ local openfile=streams.open
+ local closestream=streams.close
+ local setposition=streams.setposition
+ local getsize=streams.size
+ local readcardinal4=streams.readcardinal4le
+ local getstring=streams.getstring
+ local decompress=flate.gz_decompress
+ function zipfiles.gunzipfile(filename)
+  local strm=openfile(filename)
+  if strm then
+   setposition(strm,getsize(strm)-4+1)
+   local size=readcardinal4(strm)
+   local data=decompress(getstring(strm),size)
+   closestream(strm)
+   return data
+  end
+ end
+elseif gzip then
+ local openfile=gzip.open
+ function zipfiles.gunzipfile(filename)
+  local g=openfile(filename,"rb")
+  if g then
+   local d=g:read("*a")
+   d:close()
+   return d
+  end
+ end
+end
+
+
+end -- of closure
+
+do -- create closure to overcome 200 locals limit
+
 package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
 
 -- original size: 60383, stripped down to: 35698
@@ -20103,7 +20645,7 @@
 
 package.loaded["data-exp"] = package.loaded["data-exp"] or true
 
--- original size: 18105, stripped down to: 10389
+-- original size: 18154, stripped down to: 10416
 
 if not modules then modules={} end modules ['data-exp']={
  version=1.001,
@@ -20310,9 +20852,11 @@
  local pattern=tolerant and lessweird or weird
  local filelist={}
  local noffiles=0
- for name in directory(full) do
+ for name,mode in directory(full) do
   if not lpegmatch(pattern,name) then
-   local mode=attributes(full..name,"mode")
+   if not mode then
+    mode=attributes(full..name,"mode")
+   end
    if mode=="file" then
     n=n+1
     noffiles=noffiles+1
@@ -20793,7 +21337,7 @@
 
 package.loaded["data-tmp"] = package.loaded["data-tmp"] or true
 
--- original size: 16116, stripped down to: 10782
+-- original size: 16284, stripped down to: 10938
 
 if not modules then modules={} end modules ['data-tmp']={
  version=1.100,
@@ -20833,6 +21377,7 @@
 caches.ask=false
 caches.relocate=false
 caches.defaults={ "TMPDIR","TEMPDIR","TMP","TEMP","HOME","HOMEPATH" }
+directives.register("system.caches.fast",function(v) caches.fast=true end)
 local writable,readables,usedreadables=nil,{},{}
 local function identify()
  local texmfcaches=resolvers.cleanpathlist("TEXMFCACHE") 
@@ -21066,7 +21611,9 @@
 function caches.savedata(filepath,filename,data,raw)
  local tmaname,tmcname=caches.setluanames(filepath,filename)
  data.cache_uuid=os.uuid()
- if caches.direct then
+ if caches.fast then
+  file.savedata(tmaname,table.fastserialize(data,true))
+ elseif caches.direct then
   file.savedata(tmaname,table.serialize(data,true,saveoptions))
  else
   table.tofile(tmaname,data,true,saveoptions)
@@ -23400,7 +23947,7 @@
 
 package.loaded["data-zip"] = package.loaded["data-zip"] or true
 
--- original size: 8700, stripped down to: 6313
+-- original size: 10263, stripped down to: 7556
 
 if not modules then modules={} end modules ['data-zip']={
  version=1.001,
@@ -23419,6 +23966,65 @@
 zip.archives=archives
 local registeredfiles=zip.registeredfiles or {}
 zip.registeredfiles=registeredfiles
+local zipfiles=utilities.zipfiles
+local openzip,closezip,validfile,wholefile,filehandle,traversezip
+if zipfiles then
+ local ipairs=ipairs
+ openzip=zipfiles.open
+ closezip=zipfiles.close
+ validfile=zipfiles.found
+ wholefile=zipfiles.unzip
+ traversezip=function(zfile)
+  return ipairs(zipfiles.list(zfile))
+ end
+ local streams=utilities.streams
+ local openstream=streams.open
+ local readstring=streams.readstring
+ local streamsize=streams.size
+ local metatable={
+  close=streams.close,
+  read=function(stream,n)
+   readstring(stream,n=="*a" and streamsize(stream) or n)
+  end
+ }
+ filehandle=function(zfile,queryname)
+  local data=wholefile(zfile,queryname)
+  if data then
+   local stream=openstream(data)
+   if stream then
+    return setmetatableindex(stream,metatable)
+   end
+  end
+ end
+else
+ openzip=zip.open
+ closezip=zip.close
+ validfile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   dfile:close()
+   return true
+  end
+  return false
+ end
+ traversezip=function(zfile)
+  return z:files()
+ end
+ wholefile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   local s=dfile:read("*all")
+   dfile:close()
+   return s
+  end
+ end
+ filehandle=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   return dfile
+  end
+ end
+end
 local function validzip(str) 
  if not find(str,"^zip://") then
   return "zip:///"..str
@@ -23433,7 +24039,7 @@
   local arch=archives[name]
   if not arch then
      local full=resolvers.findfile(name) or ""
-     arch=full~="" and zip.open(full) or false
+     arch=full~="" and openzip(full) or false
      archives[name]=arch
   end
     return arch
@@ -23441,7 +24047,7 @@
 end
 function zip.closearchive(name)
  if not name or (name=="" and archives[name]) then
-  zip.close(archives[name])
+  closezip(archives[name])
   archives[name]=nil
  end
 end
@@ -23482,9 +24088,7 @@
     if trace_locating then
      report_zip("finder: archive %a found",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
-     dfile:close()
+    if validfile(zfile,queryname) then
      if trace_locating then
       report_zip("finder: file %a found",queryname)
      end
@@ -23514,12 +24118,12 @@
     if trace_locating then
      report_zip("opener; archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local handle=filehandle(zfile,queryname)
+    if handle then
      if trace_locating then
       report_zip("opener: file %a found",queryname)
      end
-     return resolvers.openers.helpers.textopener('zip',original,dfile)
+     return resolvers.openers.helpers.textopener('zip',original,handle)
     elseif trace_locating then
      report_zip("opener: file %a not found",queryname)
     end
@@ -23545,15 +24149,13 @@
     if trace_locating then
      report_zip("loader: archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local data=wholefile(zfile,queryname)
+    if data then
      logs.show_load(original)
      if trace_locating then
       report_zip("loader; file %a loaded",original)
      end
-     local s=dfile:read("*all")
-     dfile:close()
-     return true,s,#s
+     return true,data,#data
     elseif trace_locating then
      report_zip("loader: file %a not found",queryname)
     end
@@ -23600,7 +24202,7 @@
  if trace_locating then
   report_zip("registering: using filter %a",filter)
  end
- for i in z:files() do
+ for i in traversezip(z) do
   local filename=i.filename
   local path,name=match(filename,filter)
   if not path then
@@ -24734,7 +25336,7 @@
 
 package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true
 
--- original size: 9418, stripped down to: 7087
+-- original size: 9637, stripped down to: 7253
 
 if not modules then modules={} end modules ['luat-fmt']={
  version=1.001,
@@ -24804,6 +25406,13 @@
   checkers=checkers,
   reporter=report_format,
  },
+ luametatex=sandbox.registerrunner {
+  name="make luametatex format",
+  program="luametatex",
+  template=template,
+  checkers=checkers,
+  reporter=report_format,
+ },
  luajittex=sandbox.registerrunner {
   name="make luajittex format",
   program="luajittex",
@@ -24971,10 +25580,10 @@
 
 end -- of closure
 
--- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.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
+-- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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    : 995501
--- stripped bytes    : 395318
+-- original bytes    : 1019480
+-- stripped bytes    : 403728
 
 -- end library merge
 
@@ -25055,6 +25664,8 @@
     'util-env.lua',
     'luat-env.lua', -- can come before inf (as in mkiv)
 
+    'util-zip.lua',
+
     'lxml-tab.lua',
     'lxml-lpt.lua',
  -- 'lxml-ent.lua',

Modified: trunk/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/scripts/context/stubs/win64/mtxrun.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -194,7 +194,7 @@
 
 package.loaded["l-lua"] = package.loaded["l-lua"] or true
 
--- original size: 6281, stripped down to: 2863
+-- original size: 6330, stripped down to: 2831
 
 if not modules then modules={} end modules ['l-lua']={
  version=1.001,
@@ -312,7 +312,6 @@
  ffi.number=tonumber
 end
 if LUAVERSION>5.3 then
- collectgarbage("generational")
 end
 
 
@@ -3766,7 +3765,7 @@
 
 package.loaded["l-os"] = package.loaded["l-os"] or true
 
--- original size: 19347, stripped down to: 10258
+-- original size: 18916, stripped down to: 10126
 
 if not modules then modules={} end modules ['l-os']={
  version=1.001,
@@ -3933,16 +3932,6 @@
 function os.launch(str)
  execute(format(launchers[os.name] or launchers.unix,str))
 end
-if not os.times then
- function os.times()
-  return {
-   utime=os.gettimeofday(),
-   stime=0,
-   cutime=0,
-   cstime=0,
-  }
- end
-end
 local gettimeofday=os.gettimeofday or os.clock
 os.gettimeofday=gettimeofday
 local startuptime=gettimeofday()
@@ -4218,7 +4207,7 @@
 
 package.loaded["l-file"] = package.loaded["l-file"] or true
 
--- original size: 21804, stripped down to: 9980
+-- original size: 21984, stripped down to: 10148
 
 if not modules then modules={} end modules ['l-file']={
  version=1.001,
@@ -4398,41 +4387,46 @@
 function file.reslash(str)
  return str and lpegmatch(reslasher,str)
 end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
-  name=name.."/m_t_x_t_e_s_t.tmp"
-  local f=io.open(name,"wb")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+  if not name then
+  elseif lfs.isdir(name) then
+   name=name.."/m_t_x_t_e_s_t.tmp"
+   local f=io.open(name,"wb")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
+  elseif lfs.isfile(name) then
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    return true
+   end
+  else
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
   end
- elseif lfs.isfile(name) then
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   return true
+  return false
+ end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+  if name then
+   local a=attributes(name)
+   return a and lpegmatch(readable,a.permissions) or false
+  else
+   return false
   end
- else
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
-  end
  end
- return false
 end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
-  local a=attributes(name)
-  return a and lpegmatch(readable,a.permissions) or false
- else
-  return false
- end
-end
 file.isreadable=file.is_readable 
 file.iswritable=file.is_writable 
 function file.size(name)
@@ -5062,7 +5056,7 @@
 
 package.loaded["l-dir"] = package.loaded["l-dir"] or true
 
--- original size: 18002, stripped down to: 10681
+-- original size: 18253, stripped down to: 10816
 
 if not modules then modules={} end modules ['l-dir']={
  version=1.001,
@@ -5127,13 +5121,15 @@
   end
   local dirs
   local nofdirs=0
-  for name in walkdir(usedpath) do
+  for name,mode,size,time in walkdir(usedpath) do
    if name~="." and name~=".." then
     local full=path..name
-    local mode=attributes(full,'mode')
+    if mode==nil then
+     mode=attributes(full,'mode')
+    end
     if mode=='file' then
      if not patt or find(full,patt) then
-      action(full)
+      action(full,size,time)
      end
     elseif recurse and mode=="directory" then
      if dirs then
@@ -5169,10 +5165,12 @@
  local dirs
  local nofdirs=0
  local noffiles=#result
- for name,a in walkdir(usedpath) do
+ for name,mode in walkdir(usedpath) do
   if name~="." and name~=".." then
    local full=path..name
-   local mode=attributes(full,'mode')
+   if mode==nil then
+    mode=attributes(full,'mode')
+   end
    if mode=='file' then
     if not patt or find(full,patt) then
      noffiles=noffiles+1
@@ -5223,7 +5221,7 @@
   if not find(path,"/$") then
    path=path..'/'
   end
-  for name in scanner,first do
+  for name in scanner,first do 
    if name=="." then
    elseif name==".." then
    else
@@ -5314,10 +5312,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if recurse then
      globfiles(path.."/"..name,recurse,func,files)
@@ -5340,10 +5340,12 @@
  end
  files=files or {}
  local noffiles=#files
- for name in walkdir(path) do
+ for name,mode in walkdir(path) do
   if find(name,"^%.") then
   else
-   local mode=attributes(name,'mode')
+   if mode==nil then
+    mode=attributes(name,'mode')
+   end
    if mode=="directory" then
     if not func or func(name) then
      noffiles=noffiles+1
@@ -5524,8 +5526,7 @@
 function dir.push(newdir)
  local curdir=currentdir()
  insert(stack,curdir)
- if newdir and newdir~="" then
-  chdir(newdir)
+ if newdir and newdir~="" and chdir(newdir) then
   return newdir
  else
   return curdir
@@ -6466,7 +6467,7 @@
 
 package.loaded["util-str"] = package.loaded["util-str"] or true
 
--- original size: 43538, stripped down to: 21641
+-- original size: 43488, stripped down to: 21595
 
 if not modules then modules={} end modules ['util-str']={
  version=1.001,
@@ -6482,7 +6483,6 @@
 local load,dump=load,string.dump
 local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
 local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
 local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
 local patterns,lpegmatch=lpeg.patterns,lpeg.match
 local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -7307,7 +7307,7 @@
 
 package.loaded["util-tab"] = package.loaded["util-tab"] or true
 
--- original size: 28810, stripped down to: 16134
+-- original size: 28866, stripped down to: 16134
 
 if not modules then modules={} end modules ['util-tab']={
  version=1.001,
@@ -7971,7 +7971,7 @@
 
 package.loaded["util-fil"] = package.loaded["util-fil"] or true
 
--- original size: 8607, stripped down to: 6727
+-- original size: 11530, stripped down to: 9007
 
 if not modules then modules={} end modules ['util-fil']={
  version=1.001,
@@ -8180,6 +8180,32 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 else
  local floor=math.floor
  function files.writecardinal2(f,n)
@@ -8188,17 +8214,33 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
-end
 function files.writestring(f,s)
  f:write(char(byte(s,1,#s)))
 end
@@ -8210,10 +8252,18 @@
  files.readcardinal2=fio.readcardinal2
  files.readcardinal3=fio.readcardinal3
  files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
  files.readinteger1=fio.readinteger1
  files.readinteger2=fio.readinteger2
  files.readinteger3=fio.readinteger3
  files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
  files.readfixed2=fio.readfixed2
  files.readfixed4=fio.readfixed4
  files.read2dot14=fio.read2dot14
@@ -8234,6 +8284,24 @@
   skipposition(f,4*(n or 1))
  end
 end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
 if fio and fio.readcardinaltable then
  files.readcardinaltable=fio.readcardinaltable
  files.readintegertable=fio.readintegertable
@@ -8271,7 +8339,7 @@
 
 package.loaded["util-sac"] = package.loaded["util-sac"] or true
 
--- original size: 11065, stripped down to: 8209
+-- original size: 11332, stripped down to: 8420
 
 if not modules then modules={} end modules ['util-sac']={
  version=1.001,
@@ -8296,6 +8364,11 @@
   return { f,1,#f,zerobased or false }
  end
 end
+function streams.getstring(f)
+ if f then
+  return f[1]
+ end
+end
 function streams.close()
 end
 function streams.size(f)
@@ -8386,7 +8459,7 @@
  local a,b=byte(f[1],i,j)
  return 0x100*a+b
 end
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
  local i=f[2]
  local j=i+1
  f[2]=j+1
@@ -8458,6 +8531,13 @@
  local a,b,c,d=byte(f[1],i,j)
  return 0x1000000*a+0x10000*b+0x100*c+d
 end
+function streams.readcardinal4le(f)
+ local i=f[2]
+ local j=i+3
+ f[2]=j+1
+ local d,c,b,a=byte(f[1],i,j)
+ return 0x1000000*a+0x10000*b+0x100*c+d
+end
 function streams.readinteger4(f)
  local i=f[2]
  local j=i+3
@@ -9545,13 +9625,13 @@
 
 package.loaded["util-soc-imp-socket"] = package.loaded["util-soc-imp-socket"] or true
 
--- original size: 4870, stripped down to: 3527
+-- original size: 4905, stripped down to: 3562
 
 
 local type,tostring,setmetatable=type,tostring,setmetatable
 local min=math.min
 local format=string.format
-local socket=require("socket.core")
+local socket=socket or package.loaded.socket or require("socket.core")
 local connect=socket.connect
 local tcp4=socket.tcp4
 local tcp6=socket.tcp6
@@ -10734,12 +10814,12 @@
 
 package.loaded["util-soc-imp-mime"] = package.loaded["util-soc-imp-mime"] or true
 
--- original size: 2328, stripped down to: 1874
+-- original size: 2373, stripped down to: 1931
 
 
 local type,tostring=type,tostring
-local mime=require("mime.core")
-local ltn12=ltn12 or require("ltn12")
+local mime=mime  or package.loaded.mime  or require("mime.core")
+local ltn12=ltn12 or package.loaded.ltn12 or require("ltn12")
 local filtercycle=ltn12.filter.cycle
 local function report(fmt,first,...)
  if logs then
@@ -12691,7 +12771,7 @@
 
 package.loaded["trac-log"] = package.loaded["trac-log"] or true
 
--- original size: 32608, stripped down to: 20925
+-- original size: 32618, stripped down to: 20935
 
 if not modules then modules={} end modules ['trac-log']={
  version=1.001,
@@ -12736,7 +12816,7 @@
 setmetatableindex(logs,function(t,k) t[k]=ignore;return ignore end)
 local report,subreport,status,settarget,setformats,settranslations
 local direct,subdirect,writer,pushtarget,poptarget,setlogfile,settimedlog,setprocessor,setformatters,newline
-if runningtex then
+if runningtex and texio then
  if texio.setescape then
   texio.setescape(0) 
  end
@@ -15613,6 +15693,468 @@
 
 do -- create closure to overcome 200 locals limit
 
+package.loaded["util-zip"] = package.loaded["util-zip"] or true
+
+-- original size: 18645, stripped down to: 11291
+
+if not modules then modules={} end modules ['util-zip']={
+ version=1.001,
+ author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright="PRAGMA ADE / ConTeXt Development Team",
+ license="see context related readme files"
+}
+local type,tostring,tonumber=type,tostring,tonumber
+local sort=table.sort
+local find,format,sub,gsub=string.find,string.format,string.sub,string.gsub
+local osdate,ostime=os.date,os.time
+local ioopen=io.open
+local loaddata,savedata=io.loaddata,io.savedata
+local filejoin,isdir,dirname,mkdirs=file.join,lfs.isdir,file.dirname,dir.mkdirs
+local files=utilities.files
+local openfile=files.open
+local closefile=files.close
+local readstring=files.readstring
+local readcardinal2=files.readcardinal2le
+local readcardinal4=files.readcardinal4le
+local setposition=files.setposition
+local getposition=files.getposition
+local band=bit32.band
+local rshift=bit32.rshift
+local lshift=bit32.lshift
+local decompress,calculatecrc
+if flate then
+ decompress=flate.flate_decompress
+ calculatecrc=flate.update_crc32
+else
+ local zlibdecompress=zlib.decompress
+ local zlibchecksum=zlib.crc32
+ decompress=function(source,targetsize)
+  local target=zlibdecompress(source,-15)
+  if target then
+   return target
+  else
+   return false,1
+  end
+ end
+ calculatecrc=function(buffer,initial)
+  return zlibchecksum(initial or 0,buffer)
+ end
+end
+local zipfiles={}
+utilities.zipfiles=zipfiles
+local openzipfile,closezipfile,unzipfile,foundzipfile,getziphash,getziplist  do
+ function openzipfile(name)
+  return {
+   name=name,
+   handle=openfile(name,0),
+  }
+ end
+ local function collect(z)
+  if not z.list then
+   local list={}
+   local hash={}
+   local position=0
+   local index=0
+   local handle=z.handle
+   while true do
+    setposition(handle,position)
+    local signature=readstring(handle,4)
+    if signature=="PK\3\4" then
+     local version=readcardinal2(handle)
+     local flag=readcardinal2(handle)
+     local method=readcardinal2(handle)
+     local filetime=readcardinal2(handle)
+     local filedate=readcardinal2(handle)
+     local crc32=readcardinal4(handle)
+     local compressed=readcardinal4(handle)
+     local uncompressed=readcardinal4(handle)
+     local namelength=readcardinal2(handle)
+     local extralength=readcardinal2(handle)
+     local filename=readstring(handle,namelength)
+     local descriptor=band(flag,8)~=0
+     local encrypted=band(flag,1)~=0
+     local acceptable=method==0 or method==8
+     local skipped=0
+     local size=0
+     if encrypted then
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      skipbytes(8)
+      skipped=skipped+8
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+      size=readcardinal4(handle)
+      skipbytes(size)
+      skipped=skipped+size+4
+      size=readcardinal2(handle)
+      skipbytes(size)
+      skipped=skipped+size+2
+     end
+     position=position+30+namelength+extralength+skipped
+     if descriptor then
+      setposition(handle,position+compressed)
+      crc32=readcardinal4(handle)
+      compressed=readcardinal4(handle)
+      uncompressed=readcardinal4(handle)
+     end
+     if acceptable then
+      index=index+1
+      local data={
+       filename=filename,
+       index=index,
+       position=position,
+       method=method,
+       compressed=compressed,
+       uncompressed=uncompressed,
+       crc32=crc32,
+       encrypted=encrypted,
+      }
+      hash[filename]=data
+      list[index]=data
+     else
+     end
+     position=position+compressed
+    else
+     break
+    end
+    z.list=list
+    z.hash=hash
+   end
+  end
+ end
+ function getziplist(z)
+  local list=z.list
+  if not list then
+   collect(z)
+  end
+  return z.list
+ end
+ function getziphash(z)
+  local hash=z.hash
+  if not hash then
+   collect(z)
+  end
+  return z.hash
+ end
+ function foundzipfile(z,name)
+  return getziphash(z)[name]
+ end
+ function closezipfile(z)
+  local f=z.handle
+  if f then
+   closefile(f)
+   z.handle=nil
+  end
+ end
+ function unzipfile(z,filename,check)
+  local hash=z.hash
+  if not hash then
+   hash=zipfiles.hash(z)
+  end
+  local data=hash[filename] 
+  if not data then
+  end
+  if data then
+   local handle=z.handle
+   local position=data.position
+   local compressed=data.compressed
+   if compressed>0 then
+    setposition(handle,position)
+    local result=readstring(handle,compressed)
+    if data.method==8 then
+     result=decompress(result,data.uncompressed)
+    end
+    if check and data.crc32~=calculatecrc(result) then
+     print("checksum mismatch")
+     return ""
+    end
+    return result
+   else
+    return ""
+   end
+  end
+ end
+ zipfiles.open=openzipfile
+ zipfiles.close=closezipfile
+ zipfiles.unzip=unzipfile
+ zipfiles.hash=getziphash
+ zipfiles.list=getziplist
+ zipfiles.found=foundzipfile
+end
+if flate then do
+ local writecardinal1=files.writebyte
+ local writecardinal2=files.writecardinal2le
+ local writecardinal4=files.writecardinal4le
+ local logwriter=logs.writer
+ local globpattern=dir.globpattern
+ local compress=flate.flate_compress
+ local checksum=flate.update_crc32
+ local function fromdostime(dostime,dosdate)
+  return ostime {
+   year=rshift(dosdate,9)+1980,
+   month=band(rshift(dosdate,5),0x0F),
+   day=band((dosdate   ),0x1F),
+   hour=band(rshift(dostime,11)    ),
+   min=band(rshift(dostime,5),0x3F),
+   sec=band((dostime   ),0x1F),
+  }
+ end
+ local function todostime(time)
+  local t=osdate("*t",time)
+  return
+   lshift(t.year-1980,9)+lshift(t.month,5)+t.day,
+   lshift(t.hour,11)+lshift(t.min,5)+rshift(t.sec,1)
+ end
+ local function openzip(filename,level,comment,verbose)
+  local f=ioopen(filename,"wb")
+  if f then
+   return {
+    filename=filename,
+    handle=f,
+    list={},
+    level=tonumber(level) or 3,
+    comment=tostring(comment),
+    verbose=verbose,
+    uncompressed=0,
+    compressed=0,
+   }
+  end
+ end
+ local function writezip(z,name,data,level,time)
+  local f=z.handle
+  local list=z.list
+  local level=tonumber(level) or z.level or 3
+  local method=8
+  local zipped=compress(data,level)
+  local checksum=checksum(data)
+  local verbose=z.verbose
+  if not zipped then
+   method=0
+   zipped=data
+  end
+  local start=f:seek()
+  local compressed=#zipped
+  local uncompressed=#data
+  z.compressed=z.compressed+compressed
+  z.uncompressed=z.uncompressed+uncompressed
+  if verbose then
+   local pct=100*compressed/uncompressed
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,name))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,name))
+   end
+  end
+  f:write("\x50\x4b\x03\x04")
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,method)    
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal4(f,checksum)  
+  writecardinal4(f,compressed)   
+  writecardinal4(f,uncompressed) 
+  writecardinal2(f,#name)  
+  writecardinal2(f,0)
+  f:write(name)      
+  f:write(zipped)
+  list[#list+1]={ #zipped,#data,name,checksum,start,time or 0 }
+ end
+ local function closezip(z)
+  local f=z.handle
+  local list=z.list
+  local comment=z.comment
+  local verbose=z.verbose
+  local count=#list
+  local start=f:seek()
+  for i=1,count do
+   local l=list[i]
+   local compressed=l[1]
+   local uncompressed=l[2]
+   local name=l[3]
+   local checksum=l[4]
+   local start=l[5]
+   local time=l[6]
+   local date,time=todostime(time)
+   f:write('\x50\x4b\x01\x02')
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,8)   
+   writecardinal2(f,time)   
+   writecardinal2(f,date)   
+   writecardinal4(f,checksum)  
+   writecardinal4(f,compressed)   
+   writecardinal4(f,uncompressed) 
+   writecardinal2(f,#name)  
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal2(f,0)   
+   writecardinal4(f,0)   
+   writecardinal4(f,start)  
+   f:write(name)      
+  end
+  local stop=f:seek()
+  local size=stop-start
+  f:write('\x50\x4b\x05\x06')
+  writecardinal2(f,0)   
+  writecardinal2(f,0)   
+  writecardinal2(f,count)  
+  writecardinal2(f,count)  
+  writecardinal4(f,size)   
+  writecardinal4(f,start)  
+  if type(comment)=="string" and comment~="" then
+   writecardinal2(f,#comment) 
+   f:write(comment)     
+  else
+   writecardinal2(f,0)
+  end
+  if verbose then
+   local compressed=z.compressed
+   local uncompressed=z.uncompressed
+   local filename=z.filename
+   local pct=100*compressed/uncompressed
+   logwriter("")
+   if pct>=100 then
+    logwriter(format("%10i        %s",uncompressed,filename))
+   else
+    logwriter(format("%10i  %02.1f  %s",uncompressed,pct,filename))
+   end
+  end
+  f:close()
+ end
+ local function zipdir(zipname,path,level,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   level=zipname.level
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  if not isdir(path) then
+   return
+  end
+  path=gsub(path,"\\+","/")
+  path=gsub(path,"/+","/")
+  local list={}
+  local count=0
+  globpattern(path,"",true,function(name,size,time)
+   count=count+1
+   list[count]={ name,time }
+  end)
+  sort(list,function(a,b)
+   return a[1]<b[1]
+  end)
+  local zipf=openzip(zipname,level,comment,verbose)
+  if zipf then
+   local p=#path+2
+   for i=1,count do
+    local li=list[i]
+    local name=li[1]
+    local time=li[2]
+    local data=loaddata(name)
+    local name=sub(name,p,#name)
+    writezip(zipf,name,data,level,time,verbose)
+   end
+   closezip(zipf)
+  end
+ end
+ local function unzipdir(zipname,path,verbose)
+  if type(zipname)=="table" then
+   verbose=zipname.verbose
+   path=zipname.path
+   zipname=zipname.zipname
+  end
+  if not zipname or zipname=="" then
+   return
+  end
+  if not path or path=="" then
+   path="."
+  end
+  local z=openzipfile(zipname)
+  if z then
+   local list=getziplist(z)
+   if list then
+    local total=0
+    local count=#list
+    local step=number.idiv(count,10)
+    local done=0
+    for i=1,count do
+     local l=list[i]
+     local n=l.filename
+     local d=unzipfile(z,n) 
+     local p=filejoin(path,n)
+     if mkdirs(dirname(p)) then
+      if verbose=="steps" then
+       total=total+#d
+       done=done+1
+       if done>=step then
+        done=0
+        logwriter(format("%4i files of %4i done, %10i bytes",i,count,total))
+       end
+      elseif verbose then
+       logwriter(n)
+      end
+      savedata(p,d)
+     end
+    end
+    if verbose=="steps" then
+     logwriter(format("%4i files of %4i done, %10i bytes",count,count,total))
+    end
+    closezipfile(z)
+    return true
+   else
+    closezipfile(z)
+   end
+  end
+ end
+ zipfiles.zipdir=zipdir
+ zipfiles.unzipdir=unzipdir
+end end
+if flate then
+ local streams=utilities.streams
+ local openfile=streams.open
+ local closestream=streams.close
+ local setposition=streams.setposition
+ local getsize=streams.size
+ local readcardinal4=streams.readcardinal4le
+ local getstring=streams.getstring
+ local decompress=flate.gz_decompress
+ function zipfiles.gunzipfile(filename)
+  local strm=openfile(filename)
+  if strm then
+   setposition(strm,getsize(strm)-4+1)
+   local size=readcardinal4(strm)
+   local data=decompress(getstring(strm),size)
+   closestream(strm)
+   return data
+  end
+ end
+elseif gzip then
+ local openfile=gzip.open
+ function zipfiles.gunzipfile(filename)
+  local g=openfile(filename,"rb")
+  if g then
+   local d=g:read("*a")
+   d:close()
+   return d
+  end
+ end
+end
+
+
+end -- of closure
+
+do -- create closure to overcome 200 locals limit
+
 package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
 
 -- original size: 60383, stripped down to: 35698
@@ -20103,7 +20645,7 @@
 
 package.loaded["data-exp"] = package.loaded["data-exp"] or true
 
--- original size: 18105, stripped down to: 10389
+-- original size: 18154, stripped down to: 10416
 
 if not modules then modules={} end modules ['data-exp']={
  version=1.001,
@@ -20310,9 +20852,11 @@
  local pattern=tolerant and lessweird or weird
  local filelist={}
  local noffiles=0
- for name in directory(full) do
+ for name,mode in directory(full) do
   if not lpegmatch(pattern,name) then
-   local mode=attributes(full..name,"mode")
+   if not mode then
+    mode=attributes(full..name,"mode")
+   end
    if mode=="file" then
     n=n+1
     noffiles=noffiles+1
@@ -20793,7 +21337,7 @@
 
 package.loaded["data-tmp"] = package.loaded["data-tmp"] or true
 
--- original size: 16116, stripped down to: 10782
+-- original size: 16284, stripped down to: 10938
 
 if not modules then modules={} end modules ['data-tmp']={
  version=1.100,
@@ -20833,6 +21377,7 @@
 caches.ask=false
 caches.relocate=false
 caches.defaults={ "TMPDIR","TEMPDIR","TMP","TEMP","HOME","HOMEPATH" }
+directives.register("system.caches.fast",function(v) caches.fast=true end)
 local writable,readables,usedreadables=nil,{},{}
 local function identify()
  local texmfcaches=resolvers.cleanpathlist("TEXMFCACHE") 
@@ -21066,7 +21611,9 @@
 function caches.savedata(filepath,filename,data,raw)
  local tmaname,tmcname=caches.setluanames(filepath,filename)
  data.cache_uuid=os.uuid()
- if caches.direct then
+ if caches.fast then
+  file.savedata(tmaname,table.fastserialize(data,true))
+ elseif caches.direct then
   file.savedata(tmaname,table.serialize(data,true,saveoptions))
  else
   table.tofile(tmaname,data,true,saveoptions)
@@ -23400,7 +23947,7 @@
 
 package.loaded["data-zip"] = package.loaded["data-zip"] or true
 
--- original size: 8700, stripped down to: 6313
+-- original size: 10263, stripped down to: 7556
 
 if not modules then modules={} end modules ['data-zip']={
  version=1.001,
@@ -23419,6 +23966,65 @@
 zip.archives=archives
 local registeredfiles=zip.registeredfiles or {}
 zip.registeredfiles=registeredfiles
+local zipfiles=utilities.zipfiles
+local openzip,closezip,validfile,wholefile,filehandle,traversezip
+if zipfiles then
+ local ipairs=ipairs
+ openzip=zipfiles.open
+ closezip=zipfiles.close
+ validfile=zipfiles.found
+ wholefile=zipfiles.unzip
+ traversezip=function(zfile)
+  return ipairs(zipfiles.list(zfile))
+ end
+ local streams=utilities.streams
+ local openstream=streams.open
+ local readstring=streams.readstring
+ local streamsize=streams.size
+ local metatable={
+  close=streams.close,
+  read=function(stream,n)
+   readstring(stream,n=="*a" and streamsize(stream) or n)
+  end
+ }
+ filehandle=function(zfile,queryname)
+  local data=wholefile(zfile,queryname)
+  if data then
+   local stream=openstream(data)
+   if stream then
+    return setmetatableindex(stream,metatable)
+   end
+  end
+ end
+else
+ openzip=zip.open
+ closezip=zip.close
+ validfile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   dfile:close()
+   return true
+  end
+  return false
+ end
+ traversezip=function(zfile)
+  return z:files()
+ end
+ wholefile=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   local s=dfile:read("*all")
+   dfile:close()
+   return s
+  end
+ end
+ filehandle=function(zfile,queryname)
+  local dfile=zfile:open(queryname)
+  if dfile then
+   return dfile
+  end
+ end
+end
 local function validzip(str) 
  if not find(str,"^zip://") then
   return "zip:///"..str
@@ -23433,7 +24039,7 @@
   local arch=archives[name]
   if not arch then
      local full=resolvers.findfile(name) or ""
-     arch=full~="" and zip.open(full) or false
+     arch=full~="" and openzip(full) or false
      archives[name]=arch
   end
     return arch
@@ -23441,7 +24047,7 @@
 end
 function zip.closearchive(name)
  if not name or (name=="" and archives[name]) then
-  zip.close(archives[name])
+  closezip(archives[name])
   archives[name]=nil
  end
 end
@@ -23482,9 +24088,7 @@
     if trace_locating then
      report_zip("finder: archive %a found",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
-     dfile:close()
+    if validfile(zfile,queryname) then
      if trace_locating then
       report_zip("finder: file %a found",queryname)
      end
@@ -23514,12 +24118,12 @@
     if trace_locating then
      report_zip("opener; archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local handle=filehandle(zfile,queryname)
+    if handle then
      if trace_locating then
       report_zip("opener: file %a found",queryname)
      end
-     return resolvers.openers.helpers.textopener('zip',original,dfile)
+     return resolvers.openers.helpers.textopener('zip',original,handle)
     elseif trace_locating then
      report_zip("opener: file %a not found",queryname)
     end
@@ -23545,15 +24149,13 @@
     if trace_locating then
      report_zip("loader: archive %a opened",archive)
     end
-    local dfile=zfile:open(queryname)
-    if dfile then
+    local data=wholefile(zfile,queryname)
+    if data then
      logs.show_load(original)
      if trace_locating then
       report_zip("loader; file %a loaded",original)
      end
-     local s=dfile:read("*all")
-     dfile:close()
-     return true,s,#s
+     return true,data,#data
     elseif trace_locating then
      report_zip("loader: file %a not found",queryname)
     end
@@ -23600,7 +24202,7 @@
  if trace_locating then
   report_zip("registering: using filter %a",filter)
  end
- for i in z:files() do
+ for i in traversezip(z) do
   local filename=i.filename
   local path,name=match(filename,filter)
   if not path then
@@ -24734,7 +25336,7 @@
 
 package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true
 
--- original size: 9418, stripped down to: 7087
+-- original size: 9637, stripped down to: 7253
 
 if not modules then modules={} end modules ['luat-fmt']={
  version=1.001,
@@ -24804,6 +25406,13 @@
   checkers=checkers,
   reporter=report_format,
  },
+ luametatex=sandbox.registerrunner {
+  name="make luametatex format",
+  program="luametatex",
+  template=template,
+  checkers=checkers,
+  reporter=report_format,
+ },
  luajittex=sandbox.registerrunner {
   name="make luajittex format",
   program="luajittex",
@@ -24971,10 +25580,10 @@
 
 end -- of closure
 
--- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.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
+-- used libraries    : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.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-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.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    : 995501
--- stripped bytes    : 395318
+-- original bytes    : 1019480
+-- stripped bytes    : 403728
 
 -- end library merge
 
@@ -25055,6 +25664,8 @@
     'util-env.lua',
     'luat-env.lua', -- can come before inf (as in mkiv)
 
+    'util-zip.lua',
+
     'lxml-tab.lua',
     'lxml-lpt.lua',
  -- 'lxml-ent.lua',

Modified: trunk/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii	2019-03-24 21:21:32 UTC (rev 50573)
@@ -11,7 +11,7 @@
 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for
 %C details.
 
-\newcontextversion{2019.03.05 15:40}
+\newcontextversion{2019.03.21 21:39}
 
 %D This file is loaded at runtime, thereby providing an
 %D excellent place for hacks, patches, extensions and new

Modified: trunk/Master/texmf-dist/tex/context/base/mkii/context.mkii
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkii/context.mkii	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkii/context.mkii	2019-03-24 21:21:32 UTC (rev 50573)
@@ -20,7 +20,7 @@
 %D your styles an modules.
 
 \edef\contextformat {\jobname}
-\edef\contextversion{2019.03.05 15:40}
+\edef\contextversion{2019.03.21 21:39}
 
 %D For those who want to use this:
 

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv	2019-03-24 21:21:32 UTC (rev 50573)
@@ -57,14 +57,34 @@
 \unexpanded\def\checkedtextchar#1% #2%
   {\clf_doifelsecharinfont\numexpr#1\relax{\char#1}} % {#2}
 
+% \unexpanded\def\textormathchar#1%
+%   {\relax\ifmmode
+%      \char#1\relax
+%    \else\iffontchar\font#1\relax
+%      \char#1\relax
+%    \else
+%      \normalstartimath\char#1\normalstopimath
+%    \fi\fi}
+
+\newconditional\prefermathovertextchar
+
 \unexpanded\def\textormathchar#1%
-  {\relax\ifmmode
-     \char#1\relax
-   \else\iffontchar\font#1\relax
-     \char#1\relax
+  {\begingroup
+   \scratchcounter#1\relax
+   \ifmmode
+     \char\scratchcounter
    \else
-     \normalstartimath\char#1\normalstopimath
-   \fi\fi}
+      \ifconditional\prefermathovertextchar
+        % dirty trick .. maybe let this adapt to bf too ?
+        \setfontid\fontid\textfont\c_font_fam_mr
+      \fi
+      \iffontchar\font\scratchcounter
+        \char\scratchcounter
+      \else
+        \normalstartimath\char\scratchcounter\normalstopimath
+      \fi
+   \fi
+   \endgroup}
 
 \unexpanded\def\textormathchars#1%
   {{\font_text_or_mathchars#1\relax}}

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -793,7 +793,7 @@
                         tj = storefunction(tj)
                         if tokenflushmode then
                             if newtoken then
-                                flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_code),"]")
+                                flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_token_code),"]")
                             else
                                 flush(currentcatcodes,"[",t_cldl_luafunction,tj,"]")
                             end
@@ -811,7 +811,7 @@
                             tj = storefunction(tj)
                             if tokenflushmode then
                                 if newtoken then
-                                    flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_code),j == tn and "]" or ",")
+                                    flush(currentcatcodes,"[",newtoken(tj,lua_expandable_call_token_code),j == tn and "]" or ",")
                                 else
                                     flush(currentcatcodes,"[",t_cldl_luafunction,tj,j == tn and "]" or ",")
                                 end

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv	2019-03-24 21:21:32 UTC (rev 50573)
@@ -11,7 +11,7 @@
 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for
 %C details.
 
-\newcontextversion{2019.03.05 15:40}
+\newcontextversion{2019.03.21 21:39}
 
 %D This file is loaded at runtime, thereby providing an excellent place for
 %D hacks, patches, extensions and new features.

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/context.mkiv	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/context.mkiv	2019-03-24 21:21:32 UTC (rev 50573)
@@ -42,7 +42,7 @@
 %D has to match \type {YYYY.MM.DD HH:MM} format.
 
 \edef\contextformat {\jobname}
-\edef\contextversion{2019.03.05 15:40}
+\edef\contextversion{2019.03.21 21:39}
 \edef\contextkind   {beta}
 
 %D Kind of special:

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/data-exp.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -344,9 +344,11 @@
     local pattern  = tolerant and lessweird or weird
     local filelist = { }
     local noffiles = 0
-    for name in directory(full) do
+    for name, mode in directory(full) do
         if not lpegmatch(pattern,name) then
-            local mode = attributes(full..name,"mode")
+            if not mode then
+                mode = attributes(full..name,"mode")
+            end
             if mode == "file" then
                 n = n + 1
                 noffiles = noffiles + 1

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -68,6 +68,8 @@
 caches.relocate = false
 caches.defaults = { "TMPDIR", "TEMPDIR", "TMP", "TEMP", "HOME", "HOMEPATH" }
 
+directives.register("system.caches.fast",function(v) caches.fast = true end)
+
 local writable, readables, usedreadables = nil, { }, { }
 
 -- we could use a metatable for writable and readable but not yet
@@ -364,7 +366,9 @@
 function caches.savedata(filepath,filename,data,raw)
     local tmaname, tmcname = caches.setluanames(filepath,filename)
     data.cache_uuid = os.uuid()
-    if caches.direct then
+    if caches.fast then
+        file.savedata(tmaname,table.fastserialize(data,true))
+    elseif caches.direct then
         file.savedata(tmaname,table.serialize(data,true,saveoptions))
     else
         table.tofile(tmaname,data,true,saveoptions)

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -37,6 +37,81 @@
 local registeredfiles = zip.registeredfiles or { }
 zip.registeredfiles   = registeredfiles
 
+local zipfiles        = utilities.zipfiles
+
+local openzip, closezip, validfile, wholefile, filehandle, traversezip
+
+if zipfiles then
+
+    local ipairs = ipairs
+
+    openzip   = zipfiles.open
+    closezip  = zipfiles.close
+    validfile = zipfiles.found
+    wholefile = zipfiles.unzip
+
+    traversezip = function(zfile)
+        return ipairs(zipfiles.list(zfile))
+    end
+
+    local streams     = utilities.streams
+    local openstream  = streams.open
+    local readstring  = streams.readstring
+    local streamsize  = streams.size
+
+    local metatable = {
+        close = streams.close,
+        read  = function(stream,n)
+            readstring(stream,n == "*a" and streamsize(stream) or n)
+        end
+    }
+
+    filehandle = function(zfile,queryname)
+        local data = wholefile(zfile,queryname)
+        if data then
+            local stream = openstream(data)
+            if stream then
+                return setmetatableindex(stream,metatable)
+            end
+        end
+    end
+
+else
+
+    openzip  = zip.open
+    closezip = zip.close
+
+    validfile = function(zfile,queryname)
+        local dfile = zfile:open(queryname)
+        if dfile then
+            dfile:close()
+            return true
+        end
+        return false
+    end
+
+    traversezip = function(zfile)
+        return z:files()
+    end
+
+    wholefile = function(zfile,queryname)
+        local dfile = zfile:open(queryname)
+        if dfile then
+            local s = dfile:read("*all")
+            dfile:close()
+            return s
+        end
+    end
+
+    filehandle = function(zfile,queryname)
+        local dfile = zfile:open(queryname)
+        if dfile then
+            return dfile
+        end
+    end
+
+end
+
 local function validzip(str) -- todo: use url splitter
     if not find(str,"^zip://") then
         return "zip:///" .. str
@@ -52,7 +127,7 @@
         local arch = archives[name]
         if not arch then
            local full = resolvers.findfile(name) or ""
-           arch = full ~= "" and zip.open(full) or false
+           arch = full ~= "" and openzip(full) or false
            archives[name] = arch
         end
        return arch
@@ -61,7 +136,7 @@
 
 function zip.closearchive(name)
     if not name or (name == "" and archives[name]) then
-        zip.close(archives[name])
+        closezip(archives[name])
         archives[name] = nil
     end
 end
@@ -106,9 +181,7 @@
                 if trace_locating then
                     report_zip("finder: archive %a found",archive)
                 end
-                local dfile = zfile:open(queryname)
-                if dfile then
-                    dfile:close()
+                if validfile(zfile,queryname) then
                     if trace_locating then
                         report_zip("finder: file %a found",queryname)
                     end
@@ -139,12 +212,12 @@
                 if trace_locating then
                     report_zip("opener; archive %a opened",archive)
                 end
-                local dfile = zfile:open(queryname)
-                if dfile then
+                local handle = filehandle(zfile,queryname)
+                if handle then
                     if trace_locating then
                         report_zip("opener: file %a found",queryname)
                     end
-                    return resolvers.openers.helpers.textopener('zip',original,dfile)
+                    return resolvers.openers.helpers.textopener('zip',original,handle)
                 elseif trace_locating then
                     report_zip("opener: file %a not found",queryname)
                 end
@@ -171,15 +244,13 @@
                 if trace_locating then
                     report_zip("loader: archive %a opened",archive)
                 end
-                local dfile = zfile:open(queryname)
-                if dfile then
+                local data = wholefile(zfile,queryname)
+                if data then
                     logs.show_load(original)
                     if trace_locating then
                         report_zip("loader; file %a loaded",original)
                     end
-                    local s = dfile:read("*all")
-                    dfile:close()
-                    return true, s, #s
+                    return true, data, #data
                 elseif trace_locating then
                     report_zip("loader: file %a not found",queryname)
                 end
@@ -231,7 +302,7 @@
     if trace_locating then
         report_zip("registering: using filter %a",filter)
     end
-    for i in z:files() do
+    for i in traversezip(z) do
         local filename = i.filename
         local path, name = match(filename,filter)
         if not path then

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi	2019-03-24 21:21:32 UTC (rev 50573)
@@ -50,6 +50,7 @@
 \registerctxluafile{font-otc}{}
 \registerctxluafile{font-oth}{}
 \registerctxluafile{font-osd}{}
+% \doifelsefileexists{font-osm.lua}{\registerctxluafile{font-osm}{}}{}
 \registerctxluafile{font-ocl}{}
 
 % we use otf code for type one

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/font-one.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/font-one.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/font-one.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -761,7 +761,7 @@
     if foundname == "" then
         foundname = fonts.names.getfilename(fullname,"afm") or ""
     end
-    if foundname == "" and afm.autoprefixed then
+    if fullname and foundname == "" and afm.autoprefixed then
         local encoding, shortname = match(fullname,"^(.-)%-(.*)$") -- context: encoding-name.*
         if encoding and shortname and fonts.encodings.known[encoding] then
             shortname = findbinfile(shortname,'afm') or "" -- just to be sure

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -615,6 +615,8 @@
                 end
             end
             --
+            -- needs checking: this might be needed per instance ?
+            --
             if script == "deva" then
                 sharedfeatures["dv04"] = true -- dv04_remove_joiners
             elseif script == "dev2" then
@@ -689,7 +691,7 @@
 
     if not devanagaridata then
 
-        devanagaridata      = {
+        devanagaridata = {
             reph      = false,
             vattu     = false,
             blwfcache = { },
@@ -1329,7 +1331,7 @@
 
 function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replacement)
     local stop = getnext(start)
-    local font = getfont(start)
+    local font = getfont(start) -- hm
     local last = start
     while stop do
         local char = ischar(stop,font)

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -515,15 +515,20 @@
 end
 
 local function cleanfilename(fullname,defaultsuffix)
-    local path, name, suffix = splitname(fullname)
-    name = gsub(lower(name),"[^%a%d]","")
-    if suffix and suffix ~= "" then
-        return name .. ".".. suffix
-    elseif defaultsuffix and defaultsuffix ~= "" then
-        return name .. ".".. defaultsuffix
-    else
-        return name
+    if fullname then
+        local path, name, suffix = splitname(fullname)
+        if name then
+            name = gsub(lower(name),"[^%a%d]","")
+            if suffix and suffix ~= "" then
+                return name .. ".".. suffix
+            elseif defaultsuffix and defaultsuffix ~= "" then
+                return name .. ".".. defaultsuffix
+            else
+                return name
+            end
+        end
     end
+    return "badfontname"
 end
 
 local sorter = function(a,b)

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -1611,15 +1611,15 @@
         ds.pageindex = nofimages
         local image  = wrapimage(figure)
         local pager  = new_latelua { action = updatepage, n = nofimages }
-        image.next = pager
-        pager.prev = image
-        local box  = hpack(image)
-     -- indexed[figure.index] = figure
-        box.width  = figure.width
-        box.height = figure.height
-        box.depth  = 0
+        image.next   = pager
+        pager.prev   = image
+        local box    = hpack(image)
+        box.width    = figure.width
+        box.height   = figure.height
+        box.depth    = 0
         texsetbox(nr,box)
         ds.objectnumber = figure.objnum
+     -- indexed[figure.index] = figure
         ctx_relocateexternalfigure()
     end
     return data

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -91,13 +91,15 @@
         end
         local dirs
         local nofdirs  = 0
-        for name in walkdir(usedpath) do
+        for name, mode, size, time in walkdir(usedpath) do
             if name ~= "." and name ~= ".." then
                 local full = path .. name
-                local mode = attributes(full,'mode')
+                if mode == nil then
+                    mode = attributes(full,'mode')
+                end
                 if mode == 'file' then
                     if not patt or find(full,patt) then
-                        action(full)
+                        action(full,size,time)
                     end
                 elseif recurse and mode == "directory" then
                     if dirs then
@@ -134,10 +136,12 @@
     local dirs
     local nofdirs  = 0
     local noffiles = #result
-    for name, a in walkdir(usedpath) do
+    for name, mode in walkdir(usedpath) do
         if name ~= "." and name ~= ".." then
             local full = path .. name
-            local mode = attributes(full,'mode')
+            if mode == nil then
+                mode = attributes(full,'mode')
+            end
             if mode == 'file' then
                 if not patt or find(full,patt) then
                     noffiles = noffiles + 1
@@ -193,7 +197,7 @@
         if not find(path,"/$") then
             path = path .. '/'
         end
-        for name in scanner, first do
+        for name in scanner, first do -- cna be optimized
             if name == "." then
                 -- skip
             elseif name == ".." then
@@ -321,11 +325,13 @@
     end
     files = files or { }
     local noffiles = #files
-    for name in walkdir(path) do
+    for name, mode in walkdir(path) do
         if find(name,"^%.") then
             --- skip
         else
-            local mode = attributes(name,'mode')
+            if mode == nil then
+                mode = attributes(name,'mode')
+            end
             if mode == "directory" then
                 if recurse then
                     globfiles(path .. "/" .. name,recurse,func,files)
@@ -350,11 +356,13 @@
     end
     files = files or { }
     local noffiles = #files
-    for name in walkdir(path) do
+    for name, mode in walkdir(path) do
         if find(name,"^%.") then
             --- skip
         else
-            local mode = attributes(name,'mode')
+            if mode == nil then
+                mode = attributes(name,'mode')
+            end
             if mode == "directory" then
                 if not func or func(name) then
                     noffiles = noffiles + 1
@@ -597,8 +605,7 @@
 function dir.push(newdir)
     local curdir = currentdir()
     insert(stack,curdir)
-    if newdir and newdir ~= "" then
-        chdir(newdir)
+    if newdir and newdir ~= "" and chdir(newdir) then
         return newdir
     else
         return curdir

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/l-file.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/l-file.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/l-file.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -73,13 +73,9 @@
 
 -- better this way:
 
------ tricky     = S("/\\") * P(-1)
 local attributes = lfs.attributes
 
 function lfs.isdir(name)
- -- if not lpegmatch(tricky,name) then
- --     name = name .. "/."
- -- end
     return attributes(name,"mode") == "directory"
 end
 
@@ -336,43 +332,52 @@
 -- But after some testing Taco and I came up with the more robust
 -- variant:
 
-function file.is_writable(name)
-    if not name then
-        -- error
-    elseif lfs.isdir(name) then
-        name = name .. "/m_t_x_t_e_s_t.tmp"
-        local f = io.open(name,"wb")
-        if f then
-            f:close()
-            os.remove(name)
-            return true
+if lfs.isreadablefile and lfs.iswritablefile then
+
+    file.is_readable = lfs.isreadablefile
+    file.is_writable = lfs.iswritablefile
+
+else
+
+    function file.is_writable(name)
+        if not name then
+            -- error
+        elseif lfs.isdir(name) then
+            name = name .. "/m_t_x_t_e_s_t.tmp"
+            local f = io.open(name,"wb")
+            if f then
+                f:close()
+                os.remove(name)
+                return true
+            end
+        elseif lfs.isfile(name) then
+            local f = io.open(name,"ab")
+            if f then
+                f:close()
+                return true
+            end
+        else
+            local f = io.open(name,"ab")
+            if f then
+                f:close()
+                os.remove(name)
+                return true
+            end
         end
-    elseif lfs.isfile(name) then
-        local f = io.open(name,"ab")
-        if f then
-            f:close()
-            return true
-        end
-    else
-        local f = io.open(name,"ab")
-        if f then
-            f:close()
-            os.remove(name)
-            return true
-        end
+        return false
     end
-    return false
-end
 
-local readable = P("r") * Cc(true)
+    local readable = P("r") * Cc(true)
 
-function file.is_readable(name)
-    if name then
-        local a = attributes(name)
-        return a and lpegmatch(readable,a.permissions) or false
-    else
-        return false
+    function file.is_readable(name)
+        if name then
+            local a = attributes(name)
+            return a and lpegmatch(readable,a.permissions) or false
+        else
+            return false
+        end
     end
+
 end
 
 file.isreadable = file.is_readable -- depricated

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/l-lua.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -250,5 +250,6 @@
 -- if not loaded["socket.url"]  then loaded["socket.url"]  = socket.url  end
 
 if LUAVERSION > 5.3 then
-    collectgarbage("generational")
+ -- collectgarbage("collect")
+ -- collectgarbage("generational") -- crashes on unix
 end

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/l-os.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/l-os.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -230,22 +230,6 @@
     execute(format(launchers[os.name] or launchers.unix,str))
 end
 
-if not os.times then -- ?
-    -- utime  = user time
-    -- stime  = system time
-    -- cutime = children user time
-    -- cstime = children system time
-    function os.times()
-        return {
-            utime  = os.gettimeofday(), -- user
-            stime  = 0,                 -- system
-            cutime = 0,                 -- children user
-            cstime = 0,                 -- children system
-        }
-    end
-end
-
-
 local gettimeofday = os.gettimeofday or os.clock
 os.gettimeofday    = gettimeofday
 

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -180,7 +180,6 @@
 -- experiment: for now not in not in export mode!
 
 local flatten = languages.flatten
-local getlist = nodes.getlist
 
 nodes.handlers.flattenline = flatten
 

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-col.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -429,7 +429,8 @@
         local ref = indexcolorref(color)
         if ref then
             figure.colorspace = ref
-            data.used.color = color
+            data.used.color    = color
+            data.used.colorref = ref
         end
     end
 end

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/lpdf-pde.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -1003,7 +1003,15 @@
         return openpdf(str,userpassword,ownerpassword,true)
     end
 
-    local function querypdf(pdfdoc,pagenumber)
+    local sizes = {
+        crop  = "CropBox",
+        media = "MediaBox",
+        bleed = "BleedBox",
+        art   = "ArtBox",
+        trim  = "TrimBox",
+    }
+
+    local function querypdf(pdfdoc,pagenumber,size)
         if pdfdoc then
             if not pagenumber then
                 pagenumber = 1
@@ -1011,9 +1019,9 @@
             local root = pdfdoc.Catalog
             local page = pdfdoc.pages[pagenumber]
             if page then
-                -- todo
+                local sizetag  = sizes[size or "crop"] or sizes.cro
                 local mediabox = page.MediaBox or { 0, 0, 0, 0 }
-                local cropbox  = page.CropBox or mediabox
+                local cropbox  = page[sizetag] or mediabox
                 return {
                     filename    = pdfdoc.filename,
                     pagenumber  = pagenumber,

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/luat-fmt.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -79,6 +79,13 @@
         checkers = checkers,
         reporter = report_format,
     },
+    luametatex = sandbox.registerrunner {
+        name     = "make luametatex format",
+        program  = "luametatex",
+        template = template,
+        checkers = checkers,
+        reporter = report_format,
+    },
     luajittex = sandbox.registerrunner {
         name     = "make luajittex format",
         program  = "luajittex",

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv	2019-03-24 21:21:32 UTC (rev 50573)
@@ -54,6 +54,10 @@
 %registerctxluafile{util-soc-imp-ftp}    {}
 %registerctxluafile{util-soc-imp-smtp}   {}
 
+\ifcase\contextlmtxmode\else
+    \registerctxluafile{util-zip}{}
+\fi
+
 \registerctxluafile{data-ini}{}
 \registerctxluafile{data-exp}{}
 \registerctxluafile{data-env}{}

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -64,8 +64,9 @@
         end
     end
     if quit then
-        if status.setexitcode then
-            status.setexitcode(1)
+        local setexitcode = lua.setexitcode or status.setexitcode
+        if setexitcode then
+            setexitcode(1)
             if type(quit) == "table" then
                 logs.newline()
                 report_tex("quitting due to: %, t",quit)

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/mlib-run.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -348,6 +348,13 @@
     return mpx
 end
 
+
+-- luatex.wrapup(function()
+--     for k, mpx in next, mpxformats do
+--         mpx:finish()
+--     end
+-- end)
+
 function metapost.popformat()
     nofformats = nofformats - 1
 end

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/mtx-context-listing.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/mtx-context-listing.tex	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/mtx-context-listing.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -116,10 +116,10 @@
                     -- forced
                 end
                 context.page()
-                context.setupfootertexts( -- return true: we need to keep this entry
-                    { function() context.detokenize(pattern and filename or file.basename(filename)) return true end },
-                    { function() context.pagenumber() return true end }
-                )
+--                context.setupfootertexts( -- return true: we need to keep this entry
+--                    { function() context.detokenize(pattern and filename or file.basename(filename)) return true end },
+--                    { function() context.pagenumber() return true end }
+--                )
                 if scite then
                     context.scitefile { filename } -- here { }
                 elseif pretty then

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/node-met.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/node-met.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -136,104 +136,83 @@
 nodes.tonode = function(n) return n end
 nodes.tonut  = function(n) return n end
 
-local n_getid           = node.getid
-local n_getlist         = node.getlist
-local n_getnext         = node.getnext
-local n_getprev         = node.getprev
-local n_getchar         = node.getchar
-local n_getfont         = node.getfont
-local n_getsubtype      = node.getsubtype
-local n_getfield        = node.getfield
-local n_getattr         = node.get_attribute
-local n_getdisc         = node.getdisc
-local n_getleader       = node.getleader
+-- These are never used in \CONTEXT, only as a gimmick in node operators
+-- so we keep them around.
 
-local n_setfield        = node.setfield
-local n_setattr         = n_setfield
+local n_getfield = node.getfield
+local n_getattr  = node.get_attribute
 
-local n_setnext         = node.setnext or -- always
-    function(c,n)
-        n_setfield(c,"next",n)
-    end
-local n_setprev         = node.setprev or -- always
-    function(c,p)
-        n_setfield(c,"prev",p)
-    end
-local n_setlist         = node.setlist or -- always
-    function(c,l)
-        n_setfield(c,"list",l)
-    end
-local n_setlink         = node.setlink or -- always
-    function(...)
-        -- not that fast but not used often anyway
-        local h = nil
-        for i=1,select("#",...) do
-            local n = select(i,...)
-            if not n then
-                -- go on
-            elseif h then
-                n_setfield(h,"next",n)
-                n_setfield(n,"prev",h)
-            else
-                h = n
-            end
-        end
-        return h
-    end
-local n_setboth         = node.setboth or -- always
-    function(c,p,n)
-        n_setfield(c,"prev",p)
-        n_setfield(c,"next",n)
-    end
+local n_setfield = node.setfield
+local n_setattr  = n_setfield
 
-nodes.setnext         = n_setnext
-nodes.setprev         = n_setprev
-nodes.setlink         = n_setlink
-nodes.setboth         = n_setboth
-nodes.setlist         = n_setlist
+nodes.getfield = n_getfield
+nodes.setfield = n_setfield
+nodes.getattr  = n_getattr
+nodes.setattr  = n_setattr
+nodes.takeattr = nodes.unset_attribute
 
-nodes.getfield        = n_getfield
-nodes.setfield        = n_setfield
-nodes.getattr         = n_getattr
-nodes.setattr         = n_setattr
-nodes.takeattr        = nodes.unset_attribute
+local function n_getid     (n) return n_getfield(n,"id")      end
+local function n_getsubtype(n) return n_getfield(n,"subtype") end
 
-nodes.getnext         = n_getnext
-nodes.getprev         = n_getprev
-nodes.getid           = n_getid
-nodes.getchar         = n_getchar
-nodes.getfont         = n_getfont
-nodes.getsubtype      = n_getsubtype
-nodes.getlist         = n_getlist
-nodes.getleader       = n_getleader
-nodes.getdisc         = n_getdisc
+nodes.getid      = n_getid
+nodes.getsubtype = n_getsubtype
 
-if not node.getwhd then
-    function node.getwhd(n)
-        return n_getfield(n,"width"), n_getfield(n,"height"), n_getfield(n,"depth")
-    end
-end
+local function n_getchar(n)   return n_getfield(n,"char")    end
+local function n_setchar(n,c) return n_setfield(n,"char",c)  end
+local function n_getfont(n)   return n_getfield(n,"font")    end
+local function n_setfont(n,f) return n_setfield(n,"font",f)  end
 
-if not node.setwhd then
-    function node.setwhd(n,w,h,d)
-        n_setfield(n,"width",w or 0)
-        n_setfield(n,"height",h or 0)
-        n_setfield(n,"depth",d or 0)
+nodes.getchar = n_getchar
+nodes.setchar = n_setchar
+nodes.getfont = n_getfont
+nodes.setfont = n_setfont
+
+local function n_getlist  (n)   return n_getfield(n,"list")     end
+local function n_setlist  (n,l) return n_setfield(n,"list",l)   end
+local function n_getleader(n)   return n_getfield(n,"leader")   end
+local function n_setleader(n,l) return n_setfield(n,"leader",l) end
+
+nodes.getlist   = n_getlist
+nodes.setlist   = n_setlist
+nodes.getleader = n_getleader
+nodes.setleader = n_setleader
+
+local function n_getnext(n)       return n_getfield(n,"next")    end
+local function n_setnext(n,nn)    return n_setfield(n,"next",nn) end
+local function n_getprev(n)       return n_getfield(n,"prev")    end
+local function n_setprev(n,pp)    return n_setfield(n,"prev",pp) end
+local function n_getboth(n)       return n_getfield(n,"prev"),    n_getfield(n,"next")    end
+local function n_setboth(n,pp,nn) return n_setfield(n,"prev",pp), n_setfield(n,"next",nn) end
+
+nodes.getnext = n_getnext
+nodes.setnext = n_setnext
+nodes.getprev = n_getprev
+nodes.setprev = n_setprev
+nodes.getboth = n_getboth
+nodes.setboth = n_setboth
+
+local function n_setlink(...)
+    -- not that fast but not used often anyway
+    local h = nil
+    for i=1,select("#",...) do
+        local n = select(i,...)
+        if not n then
+            -- go on
+        elseif h then
+            n_setfield(h,"next",n)
+            n_setfield(n,"prev",h)
+        else
+            h = n
+        end
     end
+    return h
 end
 
-nodes.getwhd = node.getwhd
-nodes.setwhd = node.setwhd
+nodes.setlink = n_setlink
 
-nodes.is_char         = node.is_char
-nodes.ischar          = node.is_char
+nodes.getbox  = node.getbox or tex.getbox
+nodes.setbox  = node.setbox or tex.setbox
 
-nodes.is_glyph        = node.is_glyph
-nodes.isglyph         = node.is_glyph
-
-nodes.getbox          = node.getbox or tex.getbox
-nodes.setbox          = node.setbox or tex.setbox
-
 local n_flush_node    = nodes.flush
 local n_copy_node     = nodes.copy
 local n_copy_list     = nodes.copy_list

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -14,6 +14,7 @@
 local nodes        = nodes
 local tasks        = nodes.tasks
 local nuts         = nodes.nuts
+local tonut        = nodes.tonut
 
 nodes.processors   = nodes.processors or { }
 local processors   = nodes.processors
@@ -25,7 +26,6 @@
 
 do
 
-    local tonut   = nuts.tonut
     local isglyph = nuts.isglyph
     local getnext = nuts.getnext
 
@@ -178,9 +178,9 @@
 
     local texnest       = tex.nest
 
-    local getlist       = nodes.getlist
-    local setlist       = nodes.setlist
-    local getsubtype    = nodes.getsubtype
+    local getlist       = nuts.getlist
+    local setlist       = nuts.setlist
+    local getsubtype    = nuts.getsubtype
 
     local linelist_code = nodes.listcodes.line
 
@@ -191,12 +191,15 @@
             local whatever = texnest[texnest.ptr]
             if whatever then
                 local line = whatever.tail
-                if line and getsubtype(line) == linelist_code then
-                    local head = getlist(line)
-                    if head then
-                        local result = actions(head,groupcode,line)
-                        if result and result ~= head then
-                            setlist(line,result)
+                if line then
+                    line = tonut(line)
+                    if getsubtype(line) == linelist_code then
+                        local head = getlist(line)
+                        if head then
+                            local result = actions(head,groupcode,line)
+                            if result and result ~= head then
+                                setlist(line,result)
+                            end
                         end
                     end
                 end

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -627,12 +627,11 @@
 
 %localize%
 
-return function(head,groupcode,line)
-    local nuthead = tonut(head)
-    local nutline = tonut(line)
+-- we operate exclusively on nuts
 
+return function(nuthead,groupcode,nutline)
 %actions%
-    return tonode(nuthead)
+    return nuthead
 end
 ]],
 

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi	2019-03-24 21:21:32 UTC (rev 50573)
@@ -696,6 +696,30 @@
    apa:Advanced={Publicación en línea avanzada},
    apa:Retrieved={Obtenido de}] % {Disponible desde}]
 
+
+\setupbtxlabeltext
+  [sv]
+  [apa:number={nr.},
+   apa:edition={Utgåva},
+   apa:Editor=Redaktör,
+   apa:Editors=Redaktörer,
+   apa:Volume=Band,        
+   apa:Volumes=Band,
+   apa:nd={u.å.},                  % utan årtal
+   apa:supplement=Bilaga,          % Supplement
+   apa:MotionPicture=Spelfilm,     % ?
+   apa:Writer={Manusförfattare},   % Assuming for a movie
+   apa:Writers={Manusförfattare},  % 
+   apa:Producer=Producent,         % Assuming for a movie
+   apa:Producers=Producenter,      % 
+   apa:Director={Regissör},        % Assuming for a movie
+   apa:Directors={Regissörer},     % 
+   apa:Recordedby={Inspelad av},   % Assuming for a movie
+   apa:Author={Författare},
+   apa:Translator={Översättare},       
+   apa:Advanced={Avancerad onlinepublikation}, % ?
+   apa:Retrieved={Hämtad från}]
+
 % cite setups
 
 % The following differs from the default returning n.d. if year is empty

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps.mkvi	2019-03-24 21:21:32 UTC (rev 50573)
@@ -514,6 +514,20 @@
    aps:tobe={que se publicará},
    aps:unpublished={inédito}]
 
+\setupbtxlabeltext
+  [sv]
+  [aps:number={nr.},
+   aps:edition={Utgåva},
+   aps:Editor=Redaktör,
+   aps:Editors=Redaktörer,
+   aps:Volume=Band,
+   aps:Volumes=Band,
+   aps:supplement=Bilaga,
+   aps:inpress={under tryckning},
+   aps:tobe={att publiceras},
+   aps:unpublished={opublicerat}]
+
+
 % cite setups
 
 \startsetups btx:aps:nd

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-commands.mkvi	2019-03-24 21:21:32 UTC (rev 50573)
@@ -10,6 +10,6 @@
 \definebtxcommand\acro #1{\dontleavehmode{\smallcaps#1}}
 
 \let\<<
-\let\<>
+\let\>>
 
 \protect \endinput

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/publ-imp-default.mkvi	2019-03-24 21:21:32 UTC (rev 50573)
@@ -342,11 +342,11 @@
   [it]
   [\s!default:and=e,
    \s!default:number={nº},
-   \s!default:edition={ed.}, % edizione
+   \s!default:edition={ed.},      % edizione
    \s!default:Editor={A cura di},
    \s!default:Editors={A cura di},
-   \s!default:Volume={Vol.},  % Volume
-   \s!default:Volumes={Vol.}, % Volumi
+   \s!default:Volume={Vol.},      % Volume
+   \s!default:Volumes={Vol.},     % Volumi
    \s!default:others={et al.}]
 
 \setupbtxlabeltext
@@ -353,13 +353,25 @@
   [es]
   [\s!default:and=y,
    \s!default:number={nº},
-   \s!default:edition={ed.}, % edición
-   \s!default:Editor=Editor, % Ed./Eds.
+   \s!default:edition={ed.},   % edición
+   \s!default:Editor=Editor,   % Ed./Eds.
    \s!default:Editors=Editores,
    \s!default:Volume={Vol.},   % Volumen
    \s!default:Volumes={Vols.}, % Volúmenes
    \s!default:others={et al.}]
 
+\setupbtxlabeltext
+  [sv]
+  [\s!default:and=och,
+   \s!default:number={nr.},
+   \s!default:edition={Utgåva},
+   \s!default:Editor=Redaktör, 
+   \s!default:Editors=Redaktörer,
+   \s!default:Volume=Band,
+   \s!default:Volumes=Band,
+   \s!default:others={et al.}]
+
+
 % First some helpers:
 
 \starttexdefinition btx:default:composed-title

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv	2019-03-24 21:21:32 UTC (rev 50573)
@@ -717,7 +717,7 @@
    \global\s_spac_narrower_left  \zeropoint
    \global\s_spac_narrower_right \zeropoint
    \global\s_spac_narrower_middle\zeropoint
-   \edef\askednarrower{#1}
+   \edef\askednarrower{#1}%
    \ifx\askednarrower\v!reverse
      \ifconditional\s_spac_narrower_last_swap
        \leftskip \s_spac_narrower_right_last

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/symb-ini.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/symb-ini.mkiv	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/symb-ini.mkiv	2019-03-24 21:21:32 UTC (rev 50573)
@@ -44,9 +44,23 @@
 %D \stoptyping
 
 \installcorenamespace{symbol}
+\installcorenamespace{symbols}
 \installcorenamespace{symbolset}
 \installcorenamespace{symboldefault}
 
+%D For now we only have one option.
+
+\installparameterhandler\??symbols {symbols}
+\installsetuphandler    \??symbols {symbols}
+
+\appendtoks
+   \doifelse{\symbolsparameter\c!stylealternative}\v!math
+     \settrue\setfalse\prefermathovertextchar
+\to \everysetupsymbols
+
+\setupsymbols
+  [\c!stylealternative=\v!text]
+
 \let\currentsymbol   \empty
 \let\currentsymbolset\empty
 

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -114,7 +114,7 @@
 -- we don't want this overhead for single messages (not that there are that
 -- many; we could have a special weak table)
 
-if runningtex then
+if runningtex and texio then
 
     if texio.setescape then
         texio.setescape(0) -- or (false)

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -204,7 +204,6 @@
 function margins.save(t)
     setmetatable(t,defaults)
     local content  = takebox(t.number)
-    setprop(content,"specialcontent","margindata")
     local location = t.location
     local category = t.category
     local inline   = t.inline
@@ -220,6 +219,7 @@
         report_margindata("ignoring empty margin data %a",location or "unknown")
         return
     end
+    setprop(content,"specialcontent","margindata")
     local store
     if inline then
         store = inlinestore

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -14,10 +14,14 @@
 -- flac files). In Lua 5.3 we can probably do this better. Some code will move
 -- here.
 
+-- We could comment those that are in fio and sio.
+
 utilities       = utilities or { }
 local files     = { }
 utilities.files = files
 
+-- we could have a gc method that closes but files auto close anyway
+
 local zerobased = { }
 
 function files.open(filename,zb)
@@ -249,7 +253,7 @@
 
 if bit32 then
 
-    local rshift  = bit32.rshift
+    local rshift = bit32.rshift
 
     function files.writecardinal2(f,n)
         local a = char(n % 256)
@@ -258,6 +262,35 @@
         f:write(b,a)
     end
 
+    function files.writecardinal4(f,n)
+        local a = char(n % 256)
+        n = rshift(n,8)
+        local b = char(n % 256)
+        n = rshift(n,8)
+        local c = char(n % 256)
+        n = rshift(n,8)
+        local d = char(n % 256)
+        f:write(d,c,b,a)
+    end
+
+    function files.writecardinal2le(f,n)
+        local a = char(n % 256)
+        n = rshift(n,8)
+        local b = char(n % 256)
+        f:write(a,b)
+    end
+
+    function files.writecardinal4le(f,n)
+        local a = char(n % 256)
+        n = rshift(n,8)
+        local b = char(n % 256)
+        n = rshift(n,8)
+        local c = char(n % 256)
+        n = rshift(n,8)
+        local d = char(n % 256)
+        f:write(a,b,c,d)
+    end
+
 else
 
     local floor = math.floor
@@ -269,17 +302,35 @@
         f:write(b,a)
     end
 
-end
+    function files.writecardinal4(f,n)
+        local a = char(n % 256)
+        n = floor(n/256)
+        local b = char(n % 256)
+        n = floor(n/256)
+        local c = char(n % 256)
+        n = floor(n/256)
+        local d = char(n % 256)
+        f:write(d,c,b,a)
+    end
 
-function files.writecardinal4(f,n)
-    local a = char(n % 256)
-    n = rshift(n,8)
-    local b = char(n % 256)
-    n = rshift(n,8)
-    local c = char(n % 256)
-    n = rshift(n,8)
-    local d = char(n % 256)
-    f:write(d,c,b,a)
+    function files.writecardinal2le(f,n)
+        local a = char(n % 256)
+        n = floor(n/256)
+        local b = char(n % 256)
+        f:write(a,b)
+    end
+
+    function files.writecardinal4le(f,n)
+        local a = char(n % 256)
+        n = floor(n/256)
+        local b = char(n % 256)
+        n = floor(n/256)
+        local c = char(n % 256)
+        n = floor(n/256)
+        local d = char(n % 256)
+        f:write(a,b,c,d)
+    end
+
 end
 
 function files.writestring(f,s)
@@ -292,31 +343,43 @@
 
 if fio and fio.readcardinal1 then
 
-    files.readcardinal1  = fio.readcardinal1
-    files.readcardinal2  = fio.readcardinal2
-    files.readcardinal3  = fio.readcardinal3
-    files.readcardinal4  = fio.readcardinal4
-    files.readinteger1   = fio.readinteger1
-    files.readinteger2   = fio.readinteger2
-    files.readinteger3   = fio.readinteger3
-    files.readinteger4   = fio.readinteger4
-    files.readfixed2     = fio.readfixed2
-    files.readfixed4     = fio.readfixed4
-    files.read2dot14     = fio.read2dot14
-    files.setposition    = fio.setposition
-    files.getposition    = fio.getposition
+    files.readcardinal1   = fio.readcardinal1
+    files.readcardinal2   = fio.readcardinal2
+    files.readcardinal3   = fio.readcardinal3
+    files.readcardinal4   = fio.readcardinal4
 
-    files.readbyte       = files.readcardinal1
-    files.readsignedbyte = files.readinteger1
-    files.readcardinal   = files.readcardinal1
-    files.readinteger    = files.readinteger1
+    files.readcardinal1le = fio.readcardinal1le or files.readcardinal1le
+    files.readcardinal2le = fio.readcardinal2le or files.readcardinal2le
+    files.readcardinal3le = fio.readcardinal3le or files.readcardinal3le
+    files.readcardinal4le = fio.readcardinal4le or files.readcardinal4le
 
-    local skipposition   = fio.skipposition
-    files.skipposition   = skipposition
+    files.readinteger1    = fio.readinteger1
+    files.readinteger2    = fio.readinteger2
+    files.readinteger3    = fio.readinteger3
+    files.readinteger4    = fio.readinteger4
 
-    files.readbytes      = fio.readbytes
-    files.readbytetable  = fio.readbytetable
+    files.readinteger1le  = fio.readinteger1le or files.readinteger1le
+    files.readinteger2le  = fio.readinteger2le or files.readinteger2le
+    files.readinteger3le  = fio.readinteger3le or files.readinteger3le
+    files.readinteger4le  = fio.readinteger4le or files.readinteger4le
 
+    files.readfixed2      = fio.readfixed2
+    files.readfixed4      = fio.readfixed4
+    files.read2dot14      = fio.read2dot14
+    files.setposition     = fio.setposition
+    files.getposition     = fio.getposition
+
+    files.readbyte        = files.readcardinal1
+    files.readsignedbyte  = files.readinteger1
+    files.readcardinal    = files.readcardinal1
+    files.readinteger     = files.readinteger1
+
+    local skipposition    = fio.skipposition
+    files.skipposition    = skipposition
+
+    files.readbytes       = fio.readbytes
+    files.readbytetable   = fio.readbytetable
+
     function files.skipshort(f,n)
         skipposition(f,2*(n or 1))
     end
@@ -327,6 +390,30 @@
 
 end
 
+if fio and fio.writecardinal1 then
+
+    files.writecardinal1   = fio.writecardinal1
+    files.writecardinal2   = fio.writecardinal2
+    files.writecardinal3   = fio.writecardinal3
+    files.writecardinal4   = fio.writecardinal4
+
+    files.writecardinal1le = fio.writecardinal1le
+    files.writecardinal2le = fio.writecardinal2le
+    files.writecardinal3le = fio.writecardinal3le
+    files.writecardinal4le = fio.writecardinal4le
+
+    files.writeinteger1    = fio.writeinteger1 or fio.writecardinal1
+    files.writeinteger2    = fio.writeinteger2 or fio.writecardinal2
+    files.writeinteger3    = fio.writeinteger3 or fio.writecardinal3
+    files.writeinteger4    = fio.writeinteger4 or fio.writecardinal4
+
+    files.writeinteger1le  = files.writeinteger1le or fio.writecardinal1le
+    files.writeinteger2le  = files.writeinteger2le or fio.writecardinal2le
+    files.writeinteger3le  = files.writeinteger3le or fio.writecardinal3le
+    files.writeinteger4le  = files.writeinteger4le or fio.writecardinal4le
+
+end
+
 if fio and fio.readcardinaltable then
 
     files.readcardinaltable = fio.readcardinaltable

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -29,6 +29,12 @@
     end
 end
 
+function streams.getstring(f)
+    if f then
+        return f[1]
+    end
+end
+
 function streams.close()
     -- dummy
 end
@@ -137,7 +143,7 @@
     return 0x100 * a + b
 end
 
-function streams.readcardinal2LE(f)
+function streams.readcardinal2le(f)
     local i = f[2]
     local j = i + 1
     f[2] = j + 1
@@ -217,6 +223,14 @@
     return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
 end
 
+function streams.readcardinal4le(f)
+    local i = f[2]
+    local j = i + 3
+    f[2] = j + 1
+    local d, c, b, a = byte(f[1],i,j)
+    return 0x1000000 * a + 0x10000 * b + 0x100 * c + d
+end
+
 function streams.readinteger4(f)
     local i = f[2]
     local j = i + 3

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-mime.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-mime.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-mime.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -3,8 +3,8 @@
 
 local type, tostring = type, tostring
 
-local mime        = require("mime.core")
-local ltn12       = ltn12 or require("ltn12")
+local mime  = mime  or package.loaded.mime  or require("mime.core")
+local ltn12 = ltn12 or package.loaded.ltn12 or require("ltn12")
 
 local filtercycle = ltn12.filter.cycle
 

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-socket.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-socket.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/util-soc-imp-socket.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -5,7 +5,7 @@
 local min = math.min
 local format = string.format
 
-local socket      = require("socket.core")
+local socket      = socket or package.loaded.socket or require("socket.core")
 
 local connect     = socket.connect
 local tcp4        = socket.tcp4

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/util-str.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/util-str.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -14,7 +14,6 @@
 local load, dump = load, string.dump
 local tonumber, type, tostring, next, setmetatable = tonumber, type, tostring, next, setmetatable
 local unpack, concat = table.unpack, table.concat
-local unpack, concat = table.unpack, table.concat
 local P, V, C, S, R, Ct, Cs, Cp, Carg, Cc = lpeg.P, lpeg.V, lpeg.C, lpeg.S, lpeg.R, lpeg.Ct, lpeg.Cs, lpeg.Cp, lpeg.Carg, lpeg.Cc
 local patterns, lpegmatch = lpeg.patterns, lpeg.match
 local utfchar, utfbyte, utflen = utf.char, utf.byte, utf.len

Modified: trunk/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -311,7 +311,8 @@
     end
 end
 
--- best keep [%q] keys (as we have some in older applications i.e. saving user data
+-- best keep [%q] keys (as we have some in older applications i.e. saving user data (otherwise
+-- we also need to check for reserved words)
 
 local f_hashed_string   = formatters["[%q]=%q,"]
 local f_hashed_number   = formatters["[%q]=%s,"]

Modified: trunk/Master/texmf-dist/tex/context/interface/mkiv/i-context.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/context/interface/mkiv/i-readme.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua
===================================================================
--- trunk/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/context/modules/mkiv/m-chart.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -864,8 +864,8 @@
     for i=1,#data do
         local cell = data[i]
         if not autofocus or autofocus[cell.name] then -- offsets probably interfere with autofocus
-            local x = cell.x
-            local y = cell.y
+            local x = cell.realx -- was bug: .x
+            local y = cell.realy -- was bug: .y
             if minx == 0 or x < minx then minx = x end
             if miny == 0 or y < miny then miny = y end
             if minx == 0 or x > maxx then maxx = x end

Added: trunk/Master/texmf-dist/tex/context/sample/third/aristotle-grc.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/aristotle-grc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/aristotle-grc.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,13 @@
+\startlanguage[grc]
+Λόγος δέ ἐστι φωνὴ σημαντική, ἧς τῶν μερῶν τι σημαντικόν ἐστι
+κεχωρισμένον, ὡς φάσις ἀλλ᾽ οὐχ ὡς κατάφασις. λέγω δέ, οἷον ἄνθρωπος
+σημαίνει τι, ἀλλ᾽ οὐχ ὅτι ἔστιν ἢ οὐκ ἔστιν (ἀλλ᾽ ἔσται κατάφασις ἢ
+ἀπόφασις ἐάν τι προστεθῇ)· ἀλλ᾽ οὐχ ἡ τοῦ ἀνθρώπου συλλαβὴ μία· οὐδὲ
+γὰρ ἐν τῷ μῦς τὸ υς σημαντικόν, ἀλλὰ φωνή ἐστι νῦν μόνον. ἐν δὲ τοῖς
+διπλοῖς σημαίνει μέν, ἀλλ᾽ οὐ καθ᾽ αὑτό, ὥσπερ εἴρηται. ἔστι δὲ λόγος
+ἅπας μὲν σημαντικός, οὐχ ὡς ὄργανον δέ, ἀλλ᾽ ὥσπερ εἴρηται κατὰ
+συνθήκην· ἀποφαντικὸς δὲ οὐ πᾶς, ἀλλ᾽ ἐν ᾧ τὸ ἀληθεύειν ἢ ψεύδεσθαι
+ὑπάρχει· οὐκ ἐν ἅπασι δὲ ὑπάρχει, οἷον ἡ εὐχὴ λόγος μέν, ἀλλ᾽ οὔτ᾽
+ἀληθὴς οὔτε ψευδής. οἱ μὲν οὖν ἄλλοι ἀφείσθωσαν, —ῥητορικῆς γὰρ ἢ
+ποιητικῆς οἰκειοτέρα ἡ σκέψις,— ὁ δὲ ἀποφαντικὸς τῆς νῦν θεωρίας.
+\stoplanguage


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/aristotle-grc.tex
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/capek-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/capek-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/capek-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,13 @@
+Tak vám jednou byl jeden chudý pán neboli člověk, on se vlastně jmenoval
+František Král, ale tak mu říkali jenom tehdy, když ho sebral strážník a
+dovedl ho na komisařství pro potulku, kde ho zapsali do takové tlusté knihy
+a nechali ho přespat na pryčně a ráno ho zase poslali dál; na policii mu
+tedy říkali František Král, ale ostatní lidé ho jmenovali všelijak jinak:
+ten vandrák, ten šupák, ten tulák, ten pobuda, ten lajdák, ten otrapa, ten
+hadrník, ten trhan, ten obejda, ten lenoch, ten chudák, ten jindyvyjduum,
+ten člověk, ten kdovíkdo, ten poběhlík, ten krajánek, ten štvanec, ten
+vošlapa, ten revertent, ten vagabund, ten darmošlap, ten budižkničemu, ten
+hlad, ten hunt, ten holota a ještě mnoho jiných jmen mu dávali; kdyby každé
+to názvisko platilo aspoň korunu, mohl by si za ně koupit žluté boty a možná
+že i klobouk, ale takhle si za to nekoupil nic a měl jenom to, co mu lidé
+dali. 


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/capek-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/capek-vlnka-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/capek-vlnka-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/capek-vlnka-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,13 @@
+Tak vám jednou byl jeden chudý pán neboli člověk, on se vlastně jmenoval
+František Král, ale tak mu říkali jenom tehdy, když ho sebral strážník
+a~dovedl ho na komisařství pro potulku, kde ho zapsali do takové tlusté knihy
+a~nechali ho přespat na pryčně a~ráno ho zase poslali dál; na policii mu
+tedy říkali František Král, ale ostatní lidé ho jmenovali všelijak jinak:
+ten vandrák, ten šupák, ten tulák, ten pobuda, ten lajdák, ten otrapa, ten
+hadrník, ten trhan, ten obejda, ten lenoch, ten chudák, ten jindyvyjduum,
+ten člověk, ten kdovíkdo, ten poběhlík, ten krajánek, ten štvanec, ten
+vošlapa, ten revertent, ten vagabund, ten darmošlap, ten budižkničemu, ten
+hlad, ten hunt, ten holota a~ještě mnoho jiných jmen mu dávali; kdyby každé
+to názvisko platilo aspoň korunu, mohl by si za ně koupit žluté boty a~možná
+že i~klobouk, ale takhle si za to nekoupil nic a~měl jenom to, co mu lidé
+dali. 


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/capek-vlnka-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/dequincey.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/dequincey.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/dequincey.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,5 @@
+For if once a man indulges himself in murder, very soon he comes to
+think little of robbing; and from robbing he comes next to drinking and
+Sabbath--breaking, and from that to incivility and procrastination.
+Once begin upon this downward path, you never know where you are to
+stop.


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/dequincey.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,22 @@
+Čeho jsem si zvlášť všímal při prohlížení knih, je typografické jejich
+zhotovení, technické provedení knihtiskařem, které po mém soudu je základem
+dobré knižní úpravy. A tu nelze upřít, že řemeslná stránka je dosud stránkou
+slabou většiny našich knih. Často až překvapí rozpor mezi péčí, kterou
+věnoval umělec výzdobě knihy, a ledabylostí, s jakou ji tiskárna zhotovila.
+Bývá to podivná harmonie: výzdoba umělecká a sazba i tisk jako denních
+novin. Nejsou to malé závody, jichž výrobkům lze vytknouti tuto řemeslnou
+chybu, i přední veliké tiskárny zhotovují takto >>krásné<< knihy. Stačí
+prohlédnouti si podrobněji reprodukce v tomto díle, abychom se přesvědčili, 
+že to tvrzení není přehnané.
+
+Přece však lze pozorovati potěšitelný obrat k lepšímu: některé české
+knihtiskárny se chlubí už správně vysazenými a dobře vytištěnými knihami.
+Sice dosud jest málo impressí, které takto jeví úctu a vážnost k svému
+černému umění, obracejíce knihtisk k jeho staré lásce, knize, a věnujíce
+její vkusné úpravě čas, píči a píli; na prstech jedné ruky by je spočetl.
+Nepochybuji však, že jich přibude, vždyť ničím nemůže se knihtiskárna
+lépe doporučiti než svojí firmou na dokonale, krásně upravené knize, která
+je rozkoší oku a potěšením duši, a ještě po letech a desetiletích, kdy
+dávno upadnou v zapomnění drobné akcidence, zůstane v knihovnách jako svědek
+odborné vyspělosti knihtiskárny, schopnosti jejích pracovníků
+a prozíravosti i vkusu principála nebo řiditele závodu.


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-vlnka-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-vlnka-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-vlnka-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,23 @@
+
+Čeho jsem si zvlášť všímal při prohlížení knih, je typografické jejich
+zhotovení, technické provedení knihtiskařem, které po mém soudu je základem
+dobré knižní úpravy. A~tu nelze upřít, že řemeslná stránka je dosud stránkou
+slabou většiny našich knih. Často až překvapí rozpor mezi péčí, kterou
+věnoval umělec výzdobě knihy, a~ledabylostí, s~jakou ji tiskárna zhotovila.
+Bývá to podivná harmonie: výzdoba umělecká a~sazba i~tisk jako denních
+novin. Nejsou to malé závody, jichž výrobkům lze vytknouti tuto řemeslnou
+chybu, i~přední veliké tiskárny zhotovují takto >>krásné<< knihy. Stačí
+prohlédnouti si podrobněji reprodukce v~tomto díle, abychom se přesvědčili, 
+že to tvrzení není přehnané.
+
+Přece však lze pozorovati potěšitelný obrat k~lepšímu: některé české
+knihtiskárny se chlubí už správně vysazenými a~dobře vytištěnými knihami.
+Sice dosud jest málo impressí, které takto jeví úctu a~vážnost k~svému
+černému umění, obracejíce knihtisk k~jeho staré lásce, knize, a~věnujíce
+její vkusné úpravě čas, píči a~píli; na prstech jedné ruky by je spočetl.
+Nepochybuji však, že jich přibude, vždyť ničím nemůže se knihtiskárna
+lépe doporučiti než svojí firmou na dokonale, krásně upravené knize, která
+je rozkoší oku a~potěšením duši, a~ještě po letech a~desetiletích, kdy
+dávno upadnou v~zapomnění drobné akcidence, zůstane v~knihovnách jako svědek
+odborné vyspělosti knihtiskárny, schopnosti jejích pracovníků
+a~prozíravosti i~vkusu principála nebo řiditele závodu.


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/dyrynk-vlnka-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/kollar-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/kollar-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/kollar-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,31 @@
+
+Aj zde leží zem ta před okem mým slzy ronícím,
+někdy kolébka, nyní národu mého rakev.
+Stoj noho! posvátná místa jsou, kamkoli kráčíš,
+k obloze, Tatry synu, vznes se vyvýše pohled,
+neb raději k velikému prichyl tomu tam se dubisku,
+jenž vzdoruje zhoubným až dosaváde časům.
+Však času ten horší je člověk, jenž berlu železnou
+v těchto krajích na tvou, Slavie, šíji chopil.
+Horší, nežli divé války, hromu, ohně divější,
+zaslepenec na své když zlobu plémě kydá.
+Ó věkové dávní, jako noc vůkol mne ležící,
+ó krajino, všeliké slávy i hanby obraz!
+Od Labe zrádného k rovinám až Visly nevěrné,
+od Dunaje k hltným Baltu celého pěnám:
+Krásnohlasy zmužilých Slavjanů kde se někdy ozýval,
+aj oněmělť už, byv k ourazu zášti, jazyk.
+A kdo se loupeže té, volající vzhůru, dopustil?
+Kdo zhanobil v jednom národu lidstvo celé?
+Zardi se závistná Teutonie, sousedo Slávy,
+tvé vin těchto počet spáchaly někdy ruky!
+Neb krve nikde tolik nevylil černidla že žádný
+nepřítel, co vylil k záhubě Slávy Němec.
+Sám svobody kdo hoden, svobodu zná vážiti každou,
+ten kdo do pout jímá otroky, sám je otrok.
+Nechť ruky, nechť by jazyk v okovy své vázal otrocké,
+jedno to, neb nezná šetřiti práva jiných.
+Ten, kdo trůny bořil, lidskou krev darmo vyléval,
+po světě nešťastnou války pochodni nosil:
+ten porobu slušnou, buď Goth, buď Skytha zasloužil,
+ne kdo divé chválil příkladem ordě pokoj.


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/kollar-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/kollar-vlnka-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/kollar-vlnka-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/kollar-vlnka-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,30 @@
+Aj zde leží zem ta před okem mým slzy ronícím,
+někdy kolébka, nyní národu mého rakev.
+Stoj noho! posvátná místa jsou, kamkoli kráčíš,
+k~obloze, Tatry synu, vznes se vyvýše pohled,
+neb raději k~velikému prichyl tomu tam se dubisku,
+jenž vzdoruje zhoubným až dosaváde časům.
+Však času ten horší je člověk, jenž berlu železnou
+v~těchto krajích na tvou, Slavie, šíji chopil.
+Horší, nežli divé války, hromu, ohně divější,
+zaslepenec na své když zlobu plémě kydá.
+Ó věkové dávní, jako noc vůkol mne ležící,
+ó krajino, všeliké slávy i~hanby obraz!
+Od Labe zrádného k~rovinám až Visly nevěrné,
+od Dunaje k~hltným Baltu celého pěnám:
+Krásnohlasy zmužilých Slavjanů kde se někdy ozýval,
+aj oněmělť už, byv k~ourazu zášti, jazyk.
+A~kdo se loupeže té, volající vzhůru, dopustil?
+Kdo zhanobil v~jednom národu lidstvo celé?
+Zardi se závistná Teutonie, sousedo Slávy,
+tvé vin těchto počet spáchaly někdy ruky!
+Neb krve nikde tolik nevylil černidla že žádný
+nepřítel, co vylil k~záhubě Slávy Němec.
+Sám svobody kdo hoden, svobodu zná vážiti každou,
+ten kdo do pout jímá otroky, sám je otrok.
+Nechť ruky, nechť by jazyk v~okovy své vázal otrocké,
+jedno to, neb nezná šetřiti práva jiných.
+Ten, kdo trůny bořil, lidskou krev darmo vyléval,
+po světě nešťastnou války pochodni nosil:
+ten porobu slušnou, buď Goth, buď Skytha zasloužil,
+ne kdo divé chválil příkladem ordě pokoj.


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/kollar-vlnka-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/komensky-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/komensky-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/komensky-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,33 @@
+Nejkrásnějším dílem Božím je svět, všeliké neviditelné Božské věcí viditelné
+ukazující. Nejkrásnější je ale naše duše, jíž je dáno, myšlením zobrazovat
+ve svém nitru svět i věci veškery. Nejkrásnější je řeč, jejíž pomocí
+vmalováváme všeliké obrazy své duše v duši druhého. Nejkrásnější je písmo,
+jímž zachycujeme a natrvalo upevňujeme řeč, samu o sobě prchavou a
+pomíjející, a jímž jako bychom ji zadržovali, aby trvala. Nejkrásnější jsou
+knihy, písmem ladně sestavené, jimiž zpodobenou moudrost posíláme lidem,
+místně či časově vzdáleným, ba dokonce i pozdnímu potomstvu. Nejkrásnějším
+darem Božím je vynález tiskových liter, jimž se knihy nesmírně rychle
+rozmnožují. 
+
+Sazeč, maje před sebou kasu, naplněnou kovovými literkami, uloženými v
+přihrádkách, dívá se do rukopisu, postaveného na vidlici tak, aby pohodlně
+viděl, v levé ruce sázítko, pravou rukou vybírá (z přihrádek) literky a
+skládá je do sázítka v slova: když naplní sloupec, přenáší je na desku.
+Jakmile pak je naplněn počet sloupců pro jednu stranu archu, rozdělí je
+příložkami, ováže je a stáhne železnými rámy, aby se nerozpadly; a tím se
+podle svého mínění sví povinnosti zhostil.
+
+A tak tito všichni pracujíce vzájemně vykonávající jakoby hračkou
+podivuhodné dílo, lidem kdysi nepochopitelné, jen když mají všichni to, čeho
+je přitom potření, jednak odborné znalosti zbystřené praxí, jednak vytrvalou
+pozornost a píli. Znalosti: poněvadž třebaže je tiskařství řemeslem, je
+nejsubtilnějším uměním, skládajícím se z přečetných maličkostí, na něž nutno
+dávat dobrý pozor. Pozornost a píli: poněvadž zde, kde se stýká tolik
+maličkostí, velmi snadno se něco přihodí, co by dílo rušilo, kdyby se
+nebdělo.
+
+Tolik ve všeobecnosti o tom, jak se tisknou knihy vůbec. Jestliže by se
+naskytla otázka, jak vznikají knihy dobré, bude třeba říci, že je žádoucí za
+prvé rozumně sepsaný rukopis, hodný světla a nikoli tmy; na druhém místě
+elegantní typy; na třetím čistý papír; na čtvrtém pak pozorná práce, aby vše
+až do poslední čárky bylo zřetelné, rozlišené a správné.


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/komensky-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/komensky-vlnka-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/komensky-vlnka-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/komensky-vlnka-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,33 @@
+Nejkrásnějším dílem Božím je svět, všeliké neviditelné Božské věcí viditelné
+ukazující. Nejkrásnější je ale naše duše, jíž je dáno, myšlením zobrazovat
+ve svém nitru svět i~věci veškery. Nejkrásnější je řeč, jejíž pomocí
+vmalováváme všeliké obrazy své duše v~duši druhého. Nejkrásnější je písmo,
+jímž zachycujeme a~natrvalo upevňujeme řeč, samu o~sobě prchavou
+a~pomíjející, a~jímž jako bychom ji zadržovali, aby trvala. Nejkrásnější jsou
+knihy, písmem ladně sestavené, jimiž zpodobenou moudrost posíláme lidem,
+místně či časově vzdáleným, ba dokonce i~pozdnímu potomstvu. Nejkrásnějším
+darem Božím je vynález tiskových liter, jimž se knihy nesmírně rychle
+rozmnožují. 
+
+Sazeč, maje před sebou kasu, naplněnou kovovými literkami, uloženými
+v~přihrádkách, dívá se do rukopisu, postaveného na vidlici tak, aby pohodlně
+viděl, v~levé ruce sázítko, pravou rukou vybírá (z~přihrádek) literky
+a~skládá je do sázítka v~slova: když naplní sloupec, přenáší je na desku.
+Jakmile pak je naplněn počet sloupců pro jednu stranu archu, rozdělí je
+příložkami, ováže je a~stáhne železnými rámy, aby se nerozpadly; a~tím se
+podle svého mínění sví povinnosti zhostil.
+
+A~tak tito všichni pracujíce vzájemně vykonávající jakoby hračkou
+podivuhodné dílo, lidem kdysi nepochopitelné, jen když mají všichni to, čeho
+je přitom potřebí, jednak odborné znalosti zbystřené praxí, jednak vytrvalou
+pozornost a~píli. Znalosti: poněvadž třebaže je tiskařství řemeslem, je
+nejsubtilnějším uměním, skládajícím se z~přečetných maličkostí, na něž nutno
+dávat dobrý pozor. Pozornost a~píli: poněvadž zde, kde se stýká tolik
+maličkostí, velmi snadno se něco přihodí, co by dílo rušilo, kdyby se
+nebdělo.
+
+Tolik ve všeobecnosti o~tom, jak se tisknou knihy vůbec. Jestliže by se
+naskytla otázka, jak vznikají knihy dobré, bude třeba říci, že je žádoucí za
+prvé rozumně sepsaný rukopis, hodný světla a~nikoli tmy; na druhém místě
+elegantní typy; na třetím čistý papír; na čtvrtém pak pozorná práce, aby vše
+až do poslední čárky bylo zřetelné, rozlišené a~správné.


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/komensky-vlnka-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/krdel-sk.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/krdel-sk.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/krdel-sk.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,7 @@
+
+KŔDEĽ ŠŤASTNÝCH ĎATĽOV UČÍ PRI ÚSTÍ VÁHU MĹKVÉHO KOŇA OBHRÝZAŤ KÔRU A ŽRAŤ ČERSTVÉ MÄSO.
+
+Kŕdeľ šťastných ďatľov učí pri ústí Váhu mĺkveho koňa obhrýzať kôru a žrať čerstvé mäso.
+
+0123456789 :;!?()[]\{\} -/--/--- ÖÜŮŘ öüůř 
+


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/krdel-sk.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/context/sample/third/kun-cz.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/sample/third/kun-cz.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/context/sample/third/kun-cz.tex	2019-03-24 21:21:32 UTC (rev 50573)
@@ -0,0 +1,7 @@
+
+ŽLUŤOUČKÝ KŮŇ ÚPĚL ĎÁBELSKÉ ÓDY,
+
+žluťoučký kůň úpěl ďábelské ódy.
+
+0123456789 :;!?()[]\{\} -/--/--- ŕĺľäöü ŔĹĽÄÖÜ 
+


Property changes on: trunk/Master/texmf-dist/tex/context/sample/third/kun-cz.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -70,82 +70,78 @@
 nodes.glyphcodes   = glyphcodes
 nodes.disccodes    = disccodes
 
-local flush_node   = node.flush_node
-local remove_node  = node.remove
-local traverse_id  = node.traverse_id
-
 nodes.handlers.protectglyphs   = node.protect_glyphs   -- beware: nodes!
 nodes.handlers.unprotectglyphs = node.unprotect_glyphs -- beware: nodes!
 
-function nodes.remove(head, current, free_too)
-   local t = current
-   head, current = remove_node(head,current)
-   if t then
-        if free_too then
-            flush_node(t)
-            t = nil
-        else
-            t.next, t.prev = nil, nil
-        end
-   end
-   return head, current, t
-end
+-- These are now gone in generic as they are context specific.
 
-function nodes.delete(head,current)
-    return nodes.remove(head,current,true)
-end
+-- local flush_node   = node.flush_node
+-- local remove_node  = node.remove
+-- local traverse_id  = node.traverse_id
+--
+-- function nodes.remove(head, current, free_too)
+--    local t = current
+--    head, current = remove_node(head,current)
+--    if t then
+--         if free_too then
+--             flush_node(t)
+--             t = nil
+--         else
+--             t.next, t.prev = nil, nil
+--         end
+--    end
+--    return head, current, t
+-- end
+--
+-- function nodes.delete(head,current)
+--     return nodes.remove(head,current,true)
+-- end
 
-local getfield = node.getfield
-local setfield = node.setfield
+----- getfield = node.getfield
+----- setfield = node.setfield
 
-nodes.getfield = getfield
-nodes.setfield = setfield
+-----.getfield = getfield
+-----.setfield = setfield
+-----.getattr  = getfield
+-----.setattr  = setfield
 
-nodes.getattr  = getfield
-nodes.setattr  = setfield
+-----.tostring             = node.tostring or tostring
+-----.copy                 = node.copy
+-----.copy_node            = node.copy
+-----.copy_list            = node.copy_list
+-----.delete               = node.delete
+-----.dimensions           = node.dimensions
+-----.end_of_math          = node.end_of_math
+-----.flush_list           = node.flush_list
+-----.flush_node           = node.flush_node
+-----.flush                = node.flush_node
+-----.free                 = node.free
+-----.insert_after         = node.insert_after
+-----.insert_before        = node.insert_before
+-----.hpack                = node.hpack
+-----.new                  = node.new
+-----.tail                 = node.tail
+-----.traverse             = node.traverse
+-----.traverse_id          = node.traverse_id
+-----.slide                = node.slide
+-----.vpack                = node.vpack
 
--- being lazy ... just copy a bunch ... not all needed in generic but we assume
--- nodes to be kind of private anyway
+-----.first_glyph          = node.first_glyph
+-----.has_glyph            = node.has_glyph or node.first_glyph
+-----.current_attr         = node.current_attr
+-----.has_field            = node.has_field
+-----.usedlist             = node.usedlist
+-----.protrusion_skippable = node.protrusion_skippable
+-----.write                = node.write
 
-nodes.tostring             = node.tostring or tostring
-nodes.copy                 = node.copy
-nodes.copy_node            = node.copy
-nodes.copy_list            = node.copy_list
-nodes.delete               = node.delete
-nodes.dimensions           = node.dimensions
-nodes.end_of_math          = node.end_of_math
-nodes.flush_list           = node.flush_list
-nodes.flush_node           = node.flush_node
-nodes.flush                = node.flush_node
-nodes.free                 = node.free
-nodes.insert_after         = node.insert_after
-nodes.insert_before        = node.insert_before
-nodes.hpack                = node.hpack
-nodes.new                  = node.new
-nodes.tail                 = node.tail
-nodes.traverse             = node.traverse
-nodes.traverse_id          = node.traverse_id
-nodes.slide                = node.slide
-nodes.vpack                = node.vpack
+-----.has_attribute        = node.has_attribute
+-----.set_attribute        = node.set_attribute
+-----.unset_attribute      = node.unset_attribute
 
-nodes.first_glyph          = node.first_glyph
-nodes.has_glyph            = node.has_glyph or node.first_glyph
+-----.protect_glyphs       = node.protect_glyphs
+-----.unprotect_glyphs     = node.unprotect_glyphs
+-----.mlist_to_hlist       = node.mlist_to_hlist
 
-nodes.current_attr         = node.current_attr
-nodes.has_field            = node.has_field
-nodes.last_node            = node.last_node
-nodes.usedlist             = node.usedlist
-nodes.protrusion_skippable = node.protrusion_skippable
-nodes.write                = node.write
-
-nodes.has_attribute        = node.has_attribute
-nodes.set_attribute        = node.set_attribute
-nodes.unset_attribute      = node.unset_attribute
-
-nodes.protect_glyphs       = node.protect_glyphs
-nodes.unprotect_glyphs     = node.unprotect_glyphs
-nodes.mlist_to_hlist       = node.mlist_to_hlist
-
 -- in generic code, at least for some time, we stay nodes, while in context
 -- we can go nuts (e.g. experimental); this split permits us us keep code
 -- used elsewhere stable but at the same time play around in context

Modified: trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua	2019-03-24 21:15:46 UTC (rev 50572)
+++ trunk/Master/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua	2019-03-24 21:21:32 UTC (rev 50573)
@@ -1,6 +1,6 @@
 -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
 -- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date  : 03/05/19 15:40:37
+-- merge date  : 03/21/19 21:39:34
 
 do -- begin closure to overcome local limits and interference
 
@@ -120,7 +120,6 @@
  ffi.number=tonumber
 end
 if LUAVERSION>5.3 then
- collectgarbage("generational")
 end
 
 end -- closure
@@ -2677,41 +2676,46 @@
 function file.reslash(str)
  return str and lpegmatch(reslasher,str)
 end
-function file.is_writable(name)
- if not name then
- elseif lfs.isdir(name) then
-  name=name.."/m_t_x_t_e_s_t.tmp"
-  local f=io.open(name,"wb")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
+if lfs.isreadablefile and lfs.iswritablefile then
+ file.is_readable=lfs.isreadablefile
+ file.is_writable=lfs.iswritablefile
+else
+ function file.is_writable(name)
+  if not name then
+  elseif lfs.isdir(name) then
+   name=name.."/m_t_x_t_e_s_t.tmp"
+   local f=io.open(name,"wb")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
+  elseif lfs.isfile(name) then
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    return true
+   end
+  else
+   local f=io.open(name,"ab")
+   if f then
+    f:close()
+    os.remove(name)
+    return true
+   end
   end
- elseif lfs.isfile(name) then
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   return true
+  return false
+ end
+ local readable=P("r")*Cc(true)
+ function file.is_readable(name)
+  if name then
+   local a=attributes(name)
+   return a and lpegmatch(readable,a.permissions) or false
+  else
+   return false
   end
- else
-  local f=io.open(name,"ab")
-  if f then
-   f:close()
-   os.remove(name)
-   return true
-  end
  end
- return false
 end
-local readable=P("r")*Cc(true)
-function file.is_readable(name)
- if name then
-  local a=attributes(name)
-  return a and lpegmatch(readable,a.permissions) or false
- else
-  return false
- end
-end
 file.isreadable=file.is_readable 
 file.iswritable=file.is_writable 
 function file.size(name)
@@ -3070,7 +3074,6 @@
 local load,dump=load,string.dump
 local tonumber,type,tostring,next,setmetatable=tonumber,type,tostring,next,setmetatable
 local unpack,concat=table.unpack,table.concat
-local unpack,concat=table.unpack,table.concat
 local P,V,C,S,R,Ct,Cs,Cp,Carg,Cc=lpeg.P,lpeg.V,lpeg.C,lpeg.S,lpeg.R,lpeg.Ct,lpeg.Cs,lpeg.Cp,lpeg.Carg,lpeg.Cc
 local patterns,lpegmatch=lpeg.patterns,lpeg.match
 local utfchar,utfbyte,utflen=utf.char,utf.byte,utf.len
@@ -4099,6 +4102,32 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=rshift(n,8)
+  local b=char(n%256)
+  n=rshift(n,8)
+  local c=char(n%256)
+  n=rshift(n,8)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 else
  local floor=math.floor
  function files.writecardinal2(f,n)
@@ -4107,17 +4136,33 @@
   local b=char(n%256)
   f:write(b,a)
  end
+ function files.writecardinal4(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(d,c,b,a)
+ end
+ function files.writecardinal2le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  f:write(a,b)
+ end
+ function files.writecardinal4le(f,n)
+  local a=char(n%256)
+  n=floor(n/256)
+  local b=char(n%256)
+  n=floor(n/256)
+  local c=char(n%256)
+  n=floor(n/256)
+  local d=char(n%256)
+  f:write(a,b,c,d)
+ end
 end
-function files.writecardinal4(f,n)
- local a=char(n%256)
- n=rshift(n,8)
- local b=char(n%256)
- n=rshift(n,8)
- local c=char(n%256)
- n=rshift(n,8)
- local d=char(n%256)
- f:write(d,c,b,a)
-end
 function files.writestring(f,s)
  f:write(char(byte(s,1,#s)))
 end
@@ -4129,10 +4174,18 @@
  files.readcardinal2=fio.readcardinal2
  files.readcardinal3=fio.readcardinal3
  files.readcardinal4=fio.readcardinal4
+ files.readcardinal1le=fio.readcardinal1le or files.readcardinal1le
+ files.readcardinal2le=fio.readcardinal2le or files.readcardinal2le
+ files.readcardinal3le=fio.readcardinal3le or files.readcardinal3le
+ files.readcardinal4le=fio.readcardinal4le or files.readcardinal4le
  files.readinteger1=fio.readinteger1
  files.readinteger2=fio.readinteger2
  files.readinteger3=fio.readinteger3
  files.readinteger4=fio.readinteger4
+ files.readinteger1le=fio.readinteger1le or files.readinteger1le
+ files.readinteger2le=fio.readinteger2le or files.readinteger2le
+ files.readinteger3le=fio.readinteger3le or files.readinteger3le
+ files.readinteger4le=fio.readinteger4le or files.readinteger4le
  files.readfixed2=fio.readfixed2
  files.readfixed4=fio.readfixed4
  files.read2dot14=fio.read2dot14
@@ -4153,6 +4206,24 @@
   skipposition(f,4*(n or 1))
  end
 end
+if fio and fio.writecardinal1 then
+ files.writecardinal1=fio.writecardinal1
+ files.writecardinal2=fio.writecardinal2
+ files.writecardinal3=fio.writecardinal3
+ files.writecardinal4=fio.writecardinal4
+ files.writecardinal1le=fio.writecardinal1le
+ files.writecardinal2le=fio.writecardinal2le
+ files.writecardinal3le=fio.writecardinal3le
+ files.writecardinal4le=fio.writecardinal4le
+ files.writeinteger1=fio.writeinteger1 or fio.writecardinal1
+ files.writeinteger2=fio.writeinteger2 or fio.writecardinal2
+ files.writeinteger3=fio.writeinteger3 or fio.writecardinal3
+ files.writeinteger4=fio.writeinteger4 or fio.writecardinal4
+ files.writeinteger1le=files.writeinteger1le or fio.writecardinal1le
+ files.writeinteger2le=files.writeinteger2le or fio.writecardinal2le
+ files.writeinteger3le=files.writeinteger3le or fio.writecardinal3le
+ files.writeinteger4le=files.writeinteger4le or fio.writecardinal4le
+end
 if fio and fio.readcardinaltable then
  files.readcardinaltable=fio.readcardinaltable
  files.readintegertable=fio.readintegertable
@@ -4737,67 +4808,8 @@
 nodes.nodecodes=nodecodes
 nodes.glyphcodes=glyphcodes
 nodes.disccodes=disccodes
-local flush_node=node.flush_node
-local remove_node=node.remove
-local traverse_id=node.traverse_id
 nodes.handlers.protectglyphs=node.protect_glyphs   
-nodes.handlers.unprotectglyphs=node.unprotect_glyphs 
-function nodes.remove(head,current,free_too)
-   local t=current
-   head,current=remove_node(head,current)
-   if t then
-  if free_too then
-   flush_node(t)
-   t=nil
-  else
-   t.next,t.prev=nil,nil
-  end
-   end
-   return head,current,t
-end
-function nodes.delete(head,current)
- return nodes.remove(head,current,true)
-end
-local getfield=node.getfield
-local setfield=node.setfield
-nodes.getfield=getfield
-nodes.setfield=setfield
-nodes.getattr=getfield
-nodes.setattr=setfield
-nodes.tostring=node.tostring or tostring
-nodes.copy=node.copy
-nodes.copy_node=node.copy
-nodes.copy_list=node.copy_list
-nodes.delete=node.delete
-nodes.dimensions=node.dimensions
-nodes.end_of_math=node.end_of_math
-nodes.flush_list=node.flush_list
-nodes.flush_node=node.flush_node
-nodes.flush=node.flush_node
-nodes.free=node.free
-nodes.insert_after=node.insert_after
-nodes.insert_before=node.insert_before
-nodes.hpack=node.hpack
-nodes.new=node.new
-nodes.tail=node.tail
-nodes.traverse=node.traverse
-nodes.traverse_id=node.traverse_id
-nodes.slide=node.slide
-nodes.vpack=node.vpack
-nodes.first_glyph=node.first_glyph
-nodes.has_glyph=node.has_glyph or node.first_glyph
-nodes.current_attr=node.current_attr
-nodes.has_field=node.has_field
-nodes.last_node=node.last_node
-nodes.usedlist=node.usedlist
-nodes.protrusion_skippable=node.protrusion_skippable
-nodes.write=node.write
-nodes.has_attribute=node.has_attribute
-nodes.set_attribute=node.set_attribute
-nodes.unset_attribute=node.unset_attribute
-nodes.protect_glyphs=node.protect_glyphs
-nodes.unprotect_glyphs=node.unprotect_glyphs
-nodes.mlist_to_hlist=node.mlist_to_hlist
+nodes.handlers.unprotectglyphs=node.unprotect_glyphs
 local direct=node.direct
 local nuts={}
 nodes.nuts=nuts
@@ -30089,7 +30101,7 @@
 end
 function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replacement)
  local stop=getnext(start)
- local font=getfont(start)
+ local font=getfont(start) 
  local last=start
  while stop do
   local char=ischar(stop,font)
@@ -33242,7 +33254,7 @@
  if foundname=="" then
   foundname=fonts.names.getfilename(fullname,"afm") or ""
  end
- if foundname=="" and afm.autoprefixed then
+ if fullname and foundname=="" and afm.autoprefixed then
   local encoding,shortname=match(fullname,"^(.-)%-(.*)$") 
   if encoding and shortname and fonts.encodings.known[encoding] then
    shortname=findbinfile(shortname,'afm') or "" 



More information about the tex-live-commits mailing list