texlive[59298] Master/texmf-dist: lualibs (21may21)

commits+karl at tug.org commits+karl at tug.org
Fri May 21 23:07:48 CEST 2021


Revision: 59298
          http://tug.org/svn/texlive?view=revision&revision=59298
Author:   karl
Date:     2021-05-21 23:07:48 +0200 (Fri, 21 May 2021)
Log Message:
-----------
lualibs (21may21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/lualibs/NEWS
    trunk/Master/texmf-dist/doc/luatex/lualibs/README.md
    trunk/Master/texmf-dist/doc/luatex/lualibs/lualibs.pdf
    trunk/Master/texmf-dist/source/luatex/lualibs/lualibs.dtx
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended-merged.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-number.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-package.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-url.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua
    trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs.lua

Modified: trunk/Master/texmf-dist/doc/luatex/lualibs/NEWS
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/lualibs/NEWS	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/doc/luatex/lualibs/NEWS	2021-05-21 21:07:48 UTC (rev 59298)
@@ -1,4 +1,6 @@
                         History of the lualibs package
+2021/05/20 v2.74/
+    * sync with Context current as of 2021/05/20.                        
 2020/12/30 v2.73/
     * sync with Context current as of 2020/12/30.
                         

Modified: trunk/Master/texmf-dist/doc/luatex/lualibs/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/lualibs/README.md	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/doc/luatex/lualibs/README.md	2021-05-21 21:07:48 UTC (rev 59298)
@@ -1,10 +1,10 @@
 # The Lualibs Package
 
-VERSION: 2.73
+VERSION: 2.74
 
-DATE: 2020-12-30
+DATE: 2021-05-20
 
-FONTLOADERDATE: 2020-12-30
+FONTLOADERDATE: 2021-05-20
 
 Lualibs is a collection of Lua modules useful for general programming.
 

Modified: trunk/Master/texmf-dist/doc/luatex/lualibs/lualibs.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/luatex/lualibs/lualibs.dtx
===================================================================
--- trunk/Master/texmf-dist/source/luatex/lualibs/lualibs.dtx	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/source/luatex/lualibs/lualibs.dtx	2021-05-21 21:07:48 UTC (rev 59298)
@@ -1,9 +1,9 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2009--2019 by
+% Copyright (C) 2009--2021 by
 %
 %       PRAGMA ADE / ConTeXt Development Team
-%       The LuaLaTeX Dev Team
+%       The LaTeX Project Team
 %
 % See ConTeXt's mreadme.pdf for the license.
 %
@@ -37,7 +37,7 @@
 \input docstrip.tex
 \Msg{************************************************************************}
 \Msg{* Installation}
-\Msg{* Package: lualibs 2020-12-30 v2.73 Lua additional functions.}
+\Msg{* Package: lualibs 2021-05-20 v2.74 Lua additional functions.}
 \Msg{************************************************************************}
 
 \keepsilent
@@ -48,9 +48,9 @@
 \preamble
 This is a generated file.
 
-Copyright (C) 2009--2019 by
+Copyright (C) 2009--2021 by
         PRAGMA ADE / ConTeXt Development Team
-        The LuaLaTeX Dev Team
+        The LaTeX Project Team
 
 See ConTeXt's mreadme.pdf for the license.
 
@@ -107,7 +107,7 @@
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{lualibs.drv}
-  [2020/12/30 v2.73 Lua Libraries.]
+  [2021/05/20 v2.74 Lua Libraries.]
 \documentclass{ltxdoc}
 \usepackage{fancyvrb,xspace}
 \usepackage[x11names]{xcolor}
@@ -115,8 +115,7 @@
 \def\primarycolor{DodgerBlue4}  %%-> rgb  16  78 139 | #104e8b
 \def\secondarycolor{Goldenrod4} %%-> rgb 139 105 200 | #8b6914
 %
-\usepackage[
-    bookmarks=true,
+\hypersetup{
    colorlinks=true,
     linkcolor=\primarycolor,
      urlcolor=\secondarycolor,
@@ -124,8 +123,8 @@
      pdftitle={The lualibs package},
    pdfsubject={Port of the ConTeXt Lua libraries},
     pdfauthor={Elie Roux & Philipp Gesang},
-  pdfkeywords={luatex, lualatex, unicode, opentype}
-]{hyperref}
+  pdfkeywords={luatex, lualatex, unicode, opentype}}
+
 \newcommand*\email[1]{\href{mailto:#1}{#1}}
 \usepackage{fontspec}
 \setmainfont[
@@ -208,10 +207,10 @@
 % \GetFileInfo{lualibs.drv}
 %
 % \title{The \identifier{lualibs} package}
-% \date{2020/12/30 v2.73}
+% \date{2021/05/20 v2.74}
 % \author{Élie Roux      · \email{elie.roux at telecom-bretagne.eu}\\
 %         Philipp Gesang · \email{phg at phi-gamma.net}\\
-%         The \LaTeX3 Project · \email{https://github.com/latex3/lualibs/}\\
+%         The \LaTeX{} Project · \email{https://github.com/latex3/lualibs/}\\
 %         }
 %
 % \maketitle
@@ -429,8 +428,8 @@
 
 lualibs.module_info = {
   name          = "lualibs",
-  version       = "2.73",       --TAGVERSION
-    date        = "2020-12-30", --TAGDATE
+  version       = "2.74",       --TAGVERSION
+    date        = "2021-05-20", --TAGDATE
   description   = "ConTeXt Lua standard libraries.",
   author        = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
   copyright     = "PRAGMA ADE / ConTeXt Development Team",
@@ -583,8 +582,8 @@
 
 local lualibs_basic_module = {
   name          = "lualibs-basic",
-  version       = "2.73",       --TAGVERSION
-  date          = "2020-12-30", --TAGDATE
+  version       = "2.74",       --TAGVERSION
+  date          = "2021-05-20", --TAGDATE
   description   = "ConTeXt Lua libraries -- basic collection.",
   author        = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
   copyright     = "PRAGMA ADE / ConTeXt Development Team",
@@ -665,8 +664,8 @@
 
 local lualibs_extended_module = {
   name          = "lualibs-extended",
-  version       = "2.73",       --TAGVERSION
-  date          = "2020-12-30", --TAGDATE
+  version       = "2.74",       --TAGVERSION
+  date          = "2021-05-20", --TAGDATE
   description   = "ConTeXt Lua libraries -- extended collection.",
   author        = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
   copyright     = "PRAGMA ADE / ConTeXt Development Team",

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic-merged.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -1,6 +1,6 @@
 -- merged file : lualibs-basic-merged.lua
 -- parent file : lualibs-basic.lua
--- merge date  : Wed Dec 30 17:55:54 2020
+-- merge date  : 2021-05-20 23:14
 
 do -- begin closure to overcome local limits and interference
 
@@ -133,7 +133,7 @@
  copyright="PRAGMA ADE / ConTeXt Development Team",
  license="see context related readme files"
 }
-local type=type
+local type,unpack=type,unpack
 local gsub,format,find=string.gsub,string.format,string.find
 local insert,remove=table.insert,table.remove
 local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match
@@ -163,6 +163,7 @@
  },
  methods={},
  sequence={
+  "reset loaded",
   "already loaded",
   "preload table",
   "qualified path",
@@ -179,6 +180,7 @@
 local builtin=helpers.builtin
 local extraluapaths={}
 local extralibpaths={}
+local checkedfiles={}
 local luapaths=nil 
 local libpaths=nil 
 local oldluapath=nil
@@ -312,10 +314,16 @@
 local function loadedaslib(resolved,rawname) 
  local base=gsub(rawname,"%.","_")
  local init="luaopen_"..gsub(base,"%.","_")
+ local data={ resolved,init,"" }
+ checkedfiles[#checkedfiles+1]=data
  if helpers.trace then
   helpers.report("calling loadlib with '%s' with init '%s'",resolved,init)
  end
- return package.loadlib(resolved,init)
+ local a,b,c=package.loadlib(resolved,init)
+ if not a and type(b)=="string" then
+  data[3]=string.fullstrip(b or "unknown error")
+ end
+ return a,b,c 
 end
 helpers.loadedaslib=loadedaslib
 local function loadedbypath(name,rawname,paths,islib,what)
@@ -354,6 +362,10 @@
  end
 end
 helpers.loadedbyname=loadedbyname
+methods["reset loaded"]=function(name)
+ checkedfiles={}
+ return false
+end
 methods["already loaded"]=function(name)
  return package.loaded[name]
 end
@@ -395,6 +407,9 @@
 methods["not loaded"]=function(name)
  if helpers.trace then
   helpers.report("unable to locate '%s'",name or "?")
+  for i=1,#checkedfiles do
+   helpers.report("checked file '%s', initializer '%s', message '%s'",unpack(checkedfiles[i]))
+  end
  end
  return nil
 end
@@ -2591,13 +2606,13 @@
 
 if not modules then modules={} end modules ['l-number']={
  version=1.001,
- comment="companion to luat-lib.mkiv",
+ comment="companion to luat-lib.mkxl",
  author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
  copyright="PRAGMA ADE / ConTeXt Development Team",
  license="see context related readme files"
 }
 local tostring,tonumber=tostring,tonumber
-local format,floor,match,rep=string.format,math.floor,string.match,string.rep
+local format,match,rep=string.format,string.match,string.rep
 local concat,insert=table.concat,table.insert
 local lpegmatch=lpeg.match
 local floor=math.floor
@@ -3371,7 +3386,7 @@
   elseif find(architecture,"x86_64",1,true) then
    platform="osx-64"
   elseif find(architecture,"arm64",1,true) then
-   platform="osx-64"
+   platform="osx-arm"
   else
    platform="osx-ppc"
   end
@@ -4698,7 +4713,6 @@
  license="see context related readme files"
 }
 utf=utf or {}
--- unicode=nil
 if not string.utfcharacters then
  local gmatch=string.gmatch
  function string.characters(str)

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-basic.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -7,9 +7,9 @@
 --  lualibs.dtx  (with options: `basic')
 --  This is a generated file.
 --  
---  Copyright (C) 2009--2019 by
+--  Copyright (C) 2009--2021 by
 --          PRAGMA ADE / ConTeXt Development Team
---          The LuaLaTeX Dev Team
+--          The LaTeX Project Team
 --  
 --  See ConTeXt's mreadme.pdf for the license.
 --  
@@ -29,8 +29,8 @@
 
 local lualibs_basic_module = {
   name          = "lualibs-basic",
-  version       = "2.73",       --TAGVERSION
-  date          = "2020-12-30", --TAGDATE
+  version       = "2.74",       --TAGVERSION
+  date          = "2021-05-20", --TAGDATE
   description   = "ConTeXt Lua libraries -- basic collection.",
   author        = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
   copyright     = "PRAGMA ADE / ConTeXt Development Team",

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended-merged.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended-merged.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended-merged.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -1,6 +1,6 @@
 -- merged file : lualibs-extended-merged.lua
 -- parent file : lualibs-extended.lua
--- merge date  : Wed Dec 30 17:55:44 2020
+-- merge date  : 2021-05-20 23:14
 
 do -- begin closure to overcome local limits and interference
 
@@ -54,25 +54,59 @@
  n=n*ptf
  if n%1==0 then
   return format("%ipt",n)
+ else
+  return lpegmatch(stripzeros,format("%.5fpt",n)) 
  end
- return lpegmatch(stripzeros,format("%.5fpt",n)) 
 end
+local function nupoints(n)
+ if n==0 then
+  return "0"
+ end
+ n=tonumber(n)
+ if not n or n==0 then
+  return "0"
+ end
+ n=n*ptf
+ if n%1==0 then
+  return format("%i",n)
+ else
+  return format("%.5f",n) 
+ end
+end
 local function basepoints(n)
  if n==0 then
-  return "0pt"
+  return "0bp"
  end
  n=tonumber(n)
  if not n or n==0 then
-  return "0pt"
+  return "0bp"
  end
  n=n*bpf
  if n%1==0 then
   return format("%ibp",n)
+ else
+  return lpegmatch(stripzeros,format("%.5fbp",n)) 
  end
- return lpegmatch(stripzeros,format("%.5fbp",n)) 
 end
+local function nubasepoints(n)
+ if n==0 then
+  return "0"
+ end
+ n=tonumber(n)
+ if not n or n==0 then
+  return "0"
+ end
+ n=n*bpf
+ if n%1==0 then
+  return format("%i",n)
+ else
+  return format("%.5f",n) 
+ end
+end
 number.points=points
+number.nupoints=nupoints
 number.basepoints=basepoints
+number.nubasepoints=nubasepoints
 local rubish=spaceortab^0*newline
 local anyrubish=spaceortab+newline
 local stripped=(spaceortab^1/"")*newline
@@ -350,7 +384,9 @@
  concat=table.concat,
  signed=number.signed,
  points=number.points,
+ nupoints=number.nupoints,
  basepoints=number.basepoints,
+ nubasepoints=number.nubasepoints,
  utfchar=utf.char,
  utfbyte=utf.byte,
  lpegmatch=lpeg.match,
@@ -545,10 +581,18 @@
  n=n+1
  return format("points(a%s)",n)
 end
+local format_P=function()
+ n=n+1
+ return format("nupoints(a%s)",n)
+end
 local format_b=function()
  n=n+1
  return format("basepoints(a%s)",n)
 end
+local format_B=function()
+ n=n+1
+ return format("nubasepoints(a%s)",n)
+end
 local format_t=function(f)
  n=n+1
  if f and f~="" then
@@ -701,7 +745,7 @@
 +V("n") 
 +V("N") 
 +V("k")
-+V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("b")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w") 
++V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("P")+V("b")+V("B")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w") 
 +V("W") 
 +V("a") 
 +V("A") 
@@ -739,7 +783,9 @@
  ["u"]=(prefix_any*P("u"))/format_u,
  ["U"]=(prefix_any*P("U"))/format_U,
  ["p"]=(prefix_any*P("p"))/format_p,
+ ["P"]=(prefix_any*P("P"))/format_P,
  ["b"]=(prefix_any*P("b"))/format_b,
+ ["B"]=(prefix_any*P("B"))/format_B,
  ["t"]=(prefix_tab*P("t"))/format_t,
  ["T"]=(prefix_tab*P("T"))/format_T,
  ["l"]=(prefix_any*P("l"))/format_l,
@@ -3312,10 +3358,8 @@
    timer.loadtime=timer.loadtime+loadtime
    timer.timing=0
    timer.starttime=0
-   return loadtime
   end
  end
- return 0
 end
 local function benchmarktimer(instance)
  local timer=timers[instance or "notimer"]

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-extended.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -7,9 +7,9 @@
 --  lualibs.dtx  (with options: `extended')
 --  This is a generated file.
 --  
---  Copyright (C) 2009--2019 by
+--  Copyright (C) 2009--2021 by
 --          PRAGMA ADE / ConTeXt Development Team
---          The LuaLaTeX Dev Team
+--          The LaTeX Project Team
 --  
 --  See ConTeXt's mreadme.pdf for the license.
 --  
@@ -30,8 +30,8 @@
 
 local lualibs_extended_module = {
   name          = "lualibs-extended",
-  version       = "2.73",       --TAGVERSION
-  date          = "2020-12-30", --TAGDATE
+  version       = "2.74",       --TAGVERSION
+  date          = "2021-05-20", --TAGDATE
   description   = "ConTeXt Lua libraries -- extended collection.",
   author        = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
   copyright     = "PRAGMA ADE / ConTeXt Development Team",

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -507,7 +507,7 @@
 
 -- todo: cache when string
 
-function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys
+function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys but we have a better one anyway
     local pattern
     local u = isutf and utf8char or 1
     if type(one) == "table" then

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-number.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-number.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-number.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -1,16 +1,13 @@
 if not modules then modules = { } end modules ['l-number'] = {
     version   = 1.001,
-    comment   = "companion to luat-lib.mkiv",
+    comment   = "companion to luat-lib.mkxl",
     author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
     copyright = "PRAGMA ADE / ConTeXt Development Team",
     license   = "see context related readme files"
 }
 
--- this module will be replaced when we have the bit library .. the number based sets
--- might go away
-
 local tostring, tonumber = tostring, tonumber
-local format, floor, match, rep = string.format, math.floor, string.match, string.rep
+local format, match, rep = string.format, string.match, string.rep
 local concat, insert = table.concat, table.insert
 local lpegmatch = lpeg.match
 local floor = math.floor
@@ -18,51 +15,6 @@
 number       = number or { }
 local number = number
 
--- begin obsolete code --
-
--- if bit32 then
---
---     local btest, bor = bit32.btest, bit32.bor
---
---     function number.bit(p)
---         return 2 ^ (p - 1) -- 1-based indexing
---     end
---
---     number.hasbit = btest
---     number.setbit = bor
---
---     function number.setbit(x,p) -- why not bor?
---         return btest(x,p) and x or x + p
---     end
---
---     function number.clearbit(x,p)
---         return btest(x,p) and x - p or x
---     end
---
--- else
---
---     -- http://ricilake.blogspot.com/2007/10/iterating-bits-in-lua.html
---
---     function number.bit(p)
---         return 2 ^ (p - 1) -- 1-based indexing
---     end
---
---     function number.hasbit(x, p) -- typical call: if hasbit(x, bit(3)) then ...
---         return x % (p + p) >= p
---     end
---
---     function number.setbit(x, p)
---         return (x % (p + p) >= p) and x or x + p
---     end
---
---     function number.clearbit(x, p)
---         return (x % (p + p) >= p) and x - p or x
---     end
---
--- end
-
--- end obsolete code --
-
 -- print(number.tobitstring(8))
 -- print(number.tobitstring(14))
 -- print(number.tobitstring(66))

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-os.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -359,7 +359,7 @@
         elseif find(architecture,"x86_64",1,true) then
             platform = "osx-64"
         elseif find(architecture,"arm64",1,true) then
-            platform = "osx-64"
+            platform = "osx-arm"
         else
             platform = "osx-ppc"
         end

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-package.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-package.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-package.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -16,7 +16,7 @@
 -- -- local mylib = require("libtest")
 -- -- local mysql = require("luasql.mysql")
 
-local type = type
+local type, unpack = type, unpack
 local gsub, format, find = string.gsub, string.format, string.find
 local insert, remove = table.insert, table.remove
 
@@ -70,6 +70,7 @@
     methods    = {
     },
     sequence   = {
+        "reset loaded",
         "already loaded",
         "preload table",
         "qualified path", -- beware, lua itself doesn't handle qualified paths (prepends ./)
@@ -91,6 +92,7 @@
 
 local extraluapaths = { }
 local extralibpaths = { }
+local checkedfiles  = { }
 local luapaths      = nil -- delayed
 local libpaths      = nil -- delayed
 local oldluapath    = nil
@@ -245,10 +247,17 @@
  -- so, we can do a require("foo/bar") and initialize bar
  -- local base = gsub(file.basename(rawname),"%.","_")
     local init = "luaopen_" .. gsub(base,"%.","_")
+    local data = { resolved, init, "" }
+    checkedfiles[#checkedfiles+1] = data
     if helpers.trace then
         helpers.report("calling loadlib with '%s' with init '%s'",resolved,init)
     end
-    return package.loadlib(resolved,init)
+    local a, b, c = package.loadlib(resolved,init)
+    if not a and type(b) == "string" then
+--         data[3] = gsub(b or "unknown error","[\n\r]","")
+        data[3] = string.fullstrip(b or "unknown error")
+    end
+    return a, b, c -- c can be 'init'
 end
 
 helpers.loadedaslib = loadedaslib
@@ -295,6 +304,12 @@
 
 helpers.loadedbyname = loadedbyname
 
+methods["reset loaded"] = function(name)
+    checkedfiles = { }
+    return false
+end
+
+
 methods["already loaded"] = function(name)
     return package.loaded[name]
 end
@@ -344,6 +359,9 @@
 methods["not loaded"] = function(name)
     if helpers.trace then
         helpers.report("unable to locate '%s'",name or "?")
+        for i=1,#checkedfiles do
+            helpers.report("checked file '%s', initializer '%s', message '%s'",unpack(checkedfiles[i]))
+        end
     end
     return nil
 end

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -129,10 +129,8 @@
             timer.loadtime  = timer.loadtime + loadtime
             timer.timing    = 0
             timer.starttime = 0
-            return loadtime
         end
     end
-    return 0
 end
 
 local function benchmarktimer(instance)

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-url.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-url.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-url.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -379,53 +379,53 @@
 -- print(url.barepath("/test"),url.barepath("test/"),url.barepath("/test/"),url.barepath("test"))
 -- print(url.barepath("/x/yz"),url.barepath("x/yz/"),url.barepath("/x/yz/"),url.barepath("x/yz"))
 
---~ print(url.filename("file:///c:/oeps.txt"))
---~ print(url.filename("c:/oeps.txt"))
---~ print(url.filename("file:///oeps.txt"))
---~ print(url.filename("file:///etc/test.txt"))
---~ print(url.filename("/oeps.txt"))
+-- print(url.filename("file:///c:/oeps.txt"))
+-- print(url.filename("c:/oeps.txt"))
+-- print(url.filename("file:///oeps.txt"))
+-- print(url.filename("file:///etc/test.txt"))
+-- print(url.filename("/oeps.txt"))
 
---~ from the spec on the web (sort of):
+-- from the spec on the web (sort of):
 
---~ local function test(str)
---~     local t = url.hashed(str)
---~     t.constructed = url.construct(t)
---~     print(table.serialize(t))
---~ end
+-- local function test(str)
+--     local t = url.hashed(str)
+--     t.constructed = url.construct(t)
+--     print(table.serialize(t))
+-- end
 
---~ inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
---~ inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
+-- inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
+-- inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
 
---~ test("sys:///./colo-rgb")
+-- test("sys:///./colo-rgb")
 
---~ test("/data/site/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733/figuur-cow.jpg")
---~ test("file:///M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("file:///q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("/data/site/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733/figuur-cow.jpg")
+-- test("file:///M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("file:///q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
 
---~ test("file:///cow%20with%20spaces")
---~ test("file:///cow%20with%20spaces.pdf")
---~ test("cow%20with%20spaces.pdf")
---~ test("some%20file")
---~ test("/etc/passwords")
---~ test("http://www.myself.com/some%20words.html")
---~ test("file:///c:/oeps.txt")
---~ test("file:///c|/oeps.txt")
---~ test("file:///etc/oeps.txt")
---~ test("file://./etc/oeps.txt")
---~ test("file:////etc/oeps.txt")
---~ test("ftp://ftp.is.co.za/rfc/rfc1808.txt")
---~ test("http://www.ietf.org/rfc/rfc2396.txt")
---~ test("ldap://[2001:db8::7]/c=GB?objectClass?one#what")
---~ test("mailto:John.Doe at example.com")
---~ test("news:comp.infosystems.www.servers.unix")
---~ test("tel:+1-816-555-1212")
---~ test("telnet://192.0.2.16:80/")
---~ test("urn:oasis:names:specification:docbook:dtd:xml:4.1.2")
---~ test("http://www.pragma-ade.com/spaced%20name")
+-- test("file:///cow%20with%20spaces")
+-- test("file:///cow%20with%20spaces.pdf")
+-- test("cow%20with%20spaces.pdf")
+-- test("some%20file")
+-- test("/etc/passwords")
+-- test("http://www.myself.com/some%20words.html")
+-- test("file:///c:/oeps.txt")
+-- test("file:///c|/oeps.txt")
+-- test("file:///etc/oeps.txt")
+-- test("file://./etc/oeps.txt")
+-- test("file:////etc/oeps.txt")
+-- test("ftp://ftp.is.co.za/rfc/rfc1808.txt")
+-- test("http://www.ietf.org/rfc/rfc2396.txt")
+-- test("ldap://[2001:db8::7]/c=GB?objectClass?one#what")
+-- test("mailto:John.Doe at example.com")
+-- test("news:comp.infosystems.www.servers.unix")
+-- test("tel:+1-816-555-1212")
+-- test("telnet://192.0.2.16:80/")
+-- test("urn:oasis:names:specification:docbook:dtd:xml:4.1.2")
+-- test("http://www.pragma-ade.com/spaced%20name")
 
---~ test("zip:///oeps/oeps.zip#bla/bla.tex")
---~ test("zip:///oeps/oeps.zip?bla/bla.tex")
+-- test("zip:///oeps/oeps.zip#bla/bla.tex")
+-- test("zip:///oeps/oeps.zip?bla/bla.tex")
 
---~ table.print(url.hashed("/test?test"))
+-- table.print(url.hashed("/test?test"))

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -70,28 +70,64 @@
     n = n * ptf
     if n % 1 == 0 then
         return format("%ipt",n)
+    else
+        return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
     end
-    return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
 end
 
+local function nupoints(n)
+    if n == 0 then
+        return "0"
+    end
+    n = tonumber(n)
+    if not n or n == 0 then
+        return "0"
+    end
+    n = n * ptf
+    if n % 1 == 0 then
+        return format("%i",n)
+    else
+        return format("%.5f",n) -- no strip
+    end
+end
+
 local function basepoints(n)
     if n == 0 then
-        return "0pt"
+        return "0bp"
     end
     n = tonumber(n)
     if not n or n == 0 then
-        return "0pt"
+        return "0bp"
     end
     n = n * bpf
     if n % 1 == 0 then
         return format("%ibp",n)
+    else
+        return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
     end
-    return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
 end
 
-number.points     = points
-number.basepoints = basepoints
+local function nubasepoints(n)
+    if n == 0 then
+        return "0"
+    end
+    n = tonumber(n)
+    if not n or n == 0 then
+        return "0"
+    end
+    n = n * bpf
+    if n % 1 == 0 then
+        return format("%i",n)
+    else
+        return format("%.5f",n) -- no strip
+    end
+end
 
+number.points       = points
+number.nupoints     = nupoints
+number.basepoints   = basepoints
+number.nubasepoints = nubasepoints
+
 -- str = " \n \ntest  \n test\ntest "
 -- print("["..string.gsub(string.collapsecrlf(str),"\n","+").."]")
 
@@ -357,7 +393,9 @@
 -- U+hexadecimal      %...u   character number
 -- U+HEXADECIMAL      %...U   character number
 -- points             %p      number (scaled points)
+-- nupoints           %P      number (scaled points) / without unit / always 5 decimals
 -- basepoints         %b      number (scaled points)
+-- nubasepoints       %B      number (scaled points) / without unit / always 5 decimals
 -- table concat       %...t   table
 -- table concat       %{.}t   table
 -- serialize          %...T   sequenced (no nested tables)
@@ -616,7 +654,9 @@
     concat          = table.concat,
     signed          = number.signed,
     points          = number.points,
+    nupoints        = number.nupoints,
     basepoints      = number.basepoints,
+    nubasepoints    = number.nubasepoints,
     utfchar         = utf.char,
     utfbyte         = utf.byte,
     lpegmatch       = lpeg.match,
@@ -879,11 +919,21 @@
     return format("points(a%s)",n)
 end
 
+local format_P = function()
+    n = n + 1
+    return format("nupoints(a%s)",n)
+end
+
 local format_b = function()
     n = n + 1
     return format("basepoints(a%s)",n)
 end
 
+local format_B = function()
+    n = n + 1
+    return format("nubasepoints(a%s)",n)
+end
+
 local format_t = function(f)
     n = n + 1
     if f and f ~= "" then
@@ -1125,7 +1175,7 @@
               --
               + V("r")
               + V("h") + V("H") + V("u") + V("U")
-              + V("p") + V("b")
+              + V("p") + V("P") + V("b") + V("B")
               + V("t") + V("T")
               + V("l") + V("L")
               + V("I")
@@ -1174,8 +1224,10 @@
     ["H"] = (prefix_any * P("H")) / format_H, -- %H => 0x0A1B2 (when - no 0x) was V
     ["u"] = (prefix_any * P("u")) / format_u, -- %u => u+0a1b2 (when - no u+)
     ["U"] = (prefix_any * P("U")) / format_U, -- %U => U+0A1B2 (when - no U+)
-    ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt / maybe: P (and more units)
-    ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp / maybe: B (and more units)
+    ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt
+    ["P"] = (prefix_any * P("P")) / format_P, -- %p => 12.345
+    ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp
+    ["B"] = (prefix_any * P("B")) / format_B, -- %b => 12.342
     ["t"] = (prefix_tab * P("t")) / format_t, -- %t => concat
     ["T"] = (prefix_tab * P("T")) / format_T, -- %t => sequenced
     ["l"] = (prefix_any * P("l")) / format_l, -- %l => boolean

Modified: trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs.lua	2021-05-21 21:07:32 UTC (rev 59297)
+++ trunk/Master/texmf-dist/tex/luatex/lualibs/lualibs.lua	2021-05-21 21:07:48 UTC (rev 59298)
@@ -7,9 +7,9 @@
 --  lualibs.dtx  (with options: `lualibs')
 --  This is a generated file.
 --  
---  Copyright (C) 2009--2019 by
+--  Copyright (C) 2009--2021 by
 --          PRAGMA ADE / ConTeXt Development Team
---          The LuaLaTeX Dev Team
+--          The LaTeX Project Team
 --  
 --  See ConTeXt's mreadme.pdf for the license.
 --  
@@ -25,8 +25,8 @@
 
 lualibs.module_info = {
   name          = "lualibs",
-  version       = "2.73",       --TAGVERSION
-    date        = "2020-12-30", --TAGDATE
+  version       = "2.74",       --TAGVERSION
+    date        = "2021-05-20", --TAGDATE
   description   = "ConTeXt Lua standard libraries.",
   author        = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
   copyright     = "PRAGMA ADE / ConTeXt Development Team",



More information about the tex-live-commits mailing list.