texlive[46706] Master/texmf-dist: l3build (21feb18)
commits+karl at tug.org
commits+karl at tug.org
Thu Feb 22 00:34:25 CET 2018
Revision: 46706
http://tug.org/svn/texlive?view=revision&revision=46706
Author: karl
Date: 2018-02-22 00:34:25 +0100 (Thu, 22 Feb 2018)
Log Message:
-----------
l3build (21feb18)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/l3build/README.md
trunk/Master/texmf-dist/doc/latex/l3build/l3build.pdf
trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx
trunk/Master/texmf-dist/tex/latex/l3build/l3build-check.lua
trunk/Master/texmf-dist/tex/latex/l3build/l3build-ctan.lua
trunk/Master/texmf-dist/tex/latex/l3build/l3build-file-functions.lua
trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua
Modified: trunk/Master/texmf-dist/doc/latex/l3build/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/l3build/README.md 2018-02-21 23:34:07 UTC (rev 46705)
+++ trunk/Master/texmf-dist/doc/latex/l3build/README.md 2018-02-21 23:34:25 UTC (rev 46706)
@@ -1,7 +1,7 @@
l3build: a testing and building system for LaTeX3
=================================================
-Release 2018/01/27
+Release 2018/02/20
Overview
--------
Modified: trunk/Master/texmf-dist/doc/latex/l3build/l3build.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx 2018-02-21 23:34:07 UTC (rev 46705)
+++ trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx 2018-02-21 23:34:25 UTC (rev 46706)
@@ -217,7 +217,7 @@
% }^^A
% }
%
-% \date{Released 2018/01/27}
+% \date{Released 2018/02/20}
%
% \maketitle
% \tableofcontents
@@ -1386,13 +1386,12 @@
% the |basename()|.
% \end{function}
%
-% \begin{function}{unix_to_win()}
+% \begin{function}{normalize_path()}
% \begin{syntax}
-% |unix_to_win(|\meta{path}|)|
+% |normalize_path(|\meta{path}|)|
% \end{syntax}
-% Returns a string comprising the \meta{path} with |/| characters replaced
-% by |\\| and thus suitable for use with Windows-specific commands which
-% require this form of path.
+% When called on Windows, returns a string comprising the \meta{path} with
+% |/| characters replaced by |\\|. In other cases returns the path unchanged.
% \end{function}
%
% \subsection{System-dependent strings}
Modified: trunk/Master/texmf-dist/tex/latex/l3build/l3build-check.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/l3build-check.lua 2018-02-21 23:34:07 UTC (rev 46705)
+++ trunk/Master/texmf-dist/tex/latex/l3build/l3build-check.lua 2018-02-21 23:34:25 UTC (rev 46706)
@@ -546,9 +546,9 @@
if not refpdffile then
return
end
- refpdffile = unix_to_win(refpdffile)
errorlevel = execute(
- os_cmpexe .. " " .. refpdffile .. " " .. pdffile .. " > " .. cmpfile
+ os_cmpexe .. " " .. normalize_path(refpdffile)
+ .. " " .. pdffile .. " > " .. cmpfile
)
if errorlevel == 0 then
os.remove(cmpfile)
@@ -578,12 +578,8 @@
-- This allows code sharing below: we only need the .tlg name in one place
tlgfile = luatlgfile
end
- errorlevel = execute(
- os_diffexe .. " "
- .. unix_to_win(tlgfile) .. " "
- .. unix_to_win(logfile) .. " > "
- .. unix_to_win(difffile)
- )
+ errorlevel = execute(os_diffexe .. " "
+ .. normalize_path(tlgfile .. " " .. logfile .. " > " .. difffile))
if errorlevel == 0 then
os.remove(difffile)
end
@@ -662,8 +658,8 @@
-- Ensure lines are of a known length
os_setenv .. " max_print_line=" .. maxprintline
.. os_concat ..
- realengine .. format .. " "
- .. checkopts .. " " .. asciiopt .. lvtfile
+ realengine .. format .. " -jobname=" .. name .. " "
+ .. asciiopt .. " " .. checkopts .. " \"\\input " .. lvtfile .. "\" "
.. (hide and (" > " .. os_null) or "")
.. os_concat ..
runtest_tasks(jobname(lvtfile))
Modified: trunk/Master/texmf-dist/tex/latex/l3build/l3build-ctan.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/l3build-ctan.lua 2018-02-21 23:34:07 UTC (rev 46705)
+++ trunk/Master/texmf-dist/tex/latex/l3build/l3build-ctan.lua 2018-02-21 23:34:25 UTC (rev 46706)
@@ -35,9 +35,10 @@
end
else
for _,filetype in pairs(files) do
- for _,file in pairs(tree(source,filetype)) do
- local path,file = splitpath(file)
- local ctantarget = ctandir .. "/" .. ctanpkg .. "/" .. path
+ for file,_ in pairs(tree(source,filetype)) do
+ local path = splitpath(file)
+ local ctantarget = ctandir .. "/" .. ctanpkg .. "/"
+ .. source .. "/" .. path
mkdir(ctantarget)
cp(file,source,ctantarget)
end
Modified: trunk/Master/texmf-dist/tex/latex/l3build/l3build-file-functions.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/l3build-file-functions.lua 2018-02-21 23:34:07 UTC (rev 46705)
+++ trunk/Master/texmf-dist/tex/latex/l3build/l3build-file-functions.lua 2018-02-21 23:34:25 UTC (rev 46706)
@@ -22,18 +22,32 @@
--]]
+local pairs = pairs
+local print = print
+local open = io.open
+
+local attributes = lfs.attributes
+local currentdir = lfs.currentdir
+local chdir = lfs.chdir
+local lfs_dir = lfs.dir
+
local execute = os.execute
local getenv = os.getenv
+local remove = os.remove
local os_time = os.time
local os_type = os.type
+local luatex_revision = status.luatex_revision
+local luatex_version = status.luatex_version
+
local match = string.match
local sub = string.sub
+local gmatch = string.gmatch
local gsub = string.gsub
+local insert = table.insert
-
-- Convert a file glob into a pattern for use by e.g. string.gub
-- Based on https://github.com/davidm/lua-glob-pattern
-- Simplified substantially: "[...]" syntax not supported as is not
@@ -132,9 +146,9 @@
os_diffexe = getenv("diffexe") or "fc /n"
os_grepexe = "findstr /r"
os_newline = "\n"
- if tonumber(status.luatex_version) < 100 or
- (tonumber(status.luatex_version) == 100
- and tonumber(status.luatex_revision) < 4) then
+ if tonumber(luatex_version) < 100 or
+ (tonumber(luatex_version) == 100
+ and tonumber(luatex_revision) < 4) then
os_newline = "\r\n"
end
os_null = "nul"
@@ -143,12 +157,24 @@
os_yes = "for /l %I in (1,1,200) do @echo y"
end
+-- Deal with the fact that Windows and Unix use different path separators
+local function unix_to_win(path)
+ return gsub(path, "/", "\\")
+end
+
+function normalize_path(path)
+ if os_type == "windows" then
+ return unix_to_win(path)
+ end
+ return path
+end
+
-- Return an absolute path from a relative one
function abspath(path)
- local oldpwd = lfs.currentdir()
- lfs.chdir(path)
- local result = lfs.currentdir()
- lfs.chdir(oldpwd)
+ local oldpwd = currentdir()
+ chdir(path)
+ local result = currentdir()
+ chdir(oldpwd)
return gsub(result, "\\", "/")
end
@@ -167,7 +193,7 @@
for i,_ in pairs(tree(source, glob)) do
local source = source .. "/" .. i
if os_type == "windows" then
- if lfs.attributes(source)["mode"] == "directory" then
+ if attributes(source)["mode"] == "directory" then
errorlevel = execute(
'xcopy /y /e /i "' .. unix_to_win(source) .. '" "'
.. unix_to_win(dest .. '/' .. i) .. '" > nul'
@@ -204,7 +230,7 @@
end
function fileexists(file)
- local f = io.open(file, "r")
+ local f = open(file, "r")
if f ~= nil then
f:close()
return true
@@ -222,14 +248,14 @@
pattern = glob_to_pattern(glob)
end
if direxists(path) then
- for entry in lfs.dir(path) do
+ for entry in lfs_dir(path) do
if pattern then
if match(entry, pattern) then
- table.insert(files, entry)
+ insert(files, entry)
end
else
if entry ~= "." and entry ~= ".." then
- table.insert(files, entry)
+ insert(files, entry)
end
end
end
@@ -248,10 +274,10 @@
return true
end
local function is_dir(file)
- return lfs.attributes(file)["mode"] == "directory"
+ return attributes(file)["mode"] == "directory"
end
local dirs = {["."] = cropdots(path)}
- for pattern, criterion in string.gmatch(cropdots(glob), "([^/]+)(/?)") do
+ for pattern, criterion in gmatch(cropdots(glob), "([^/]+)(/?)") do
local criterion = criterion == "/" and is_dir or always_true
function fill(path, dir, table)
for _, file in ipairs(filelist(dir, pattern)) do
@@ -341,7 +367,7 @@
-- Remove file
function rmfile(source, file)
- os.remove(source .. "/" .. file)
+ remove(source .. "/" .. file)
-- os.remove doesn't give a sensible errorlevel
return 0
end
@@ -362,16 +388,6 @@
return execute("cd " .. dir .. os_concat .. cmd)
end
--- Deal with the fact that Windows and Unix use different path separators
-function unix_to_win(path)
- if os_type == "windows" then
- return gsub(path, "/", "\\")
- else
- return path
- end
-end
-
-
-- Split a path into file and directory component
function splitpath(file)
local path, name = match(file, "^(.*)/([^/]*)$")
Modified: trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua 2018-02-21 23:34:07 UTC (rev 46705)
+++ trunk/Master/texmf-dist/tex/latex/l3build/l3build.lua 2018-02-21 23:34:25 UTC (rev 46706)
@@ -23,7 +23,7 @@
--]]
-- Version information
-release_date = "2018/01/27"
+release_date = "2018/02/20"
-- File operations are aided by the LuaFileSystem module
local lfs = require("lfs")
More information about the tex-live-commits
mailing list