texlive[61260] trunk: l3build (9dec21)

commits+karl at tug.org commits+karl at tug.org
Thu Dec 9 22:05:14 CET 2021


Revision: 61260
          http://tug.org/svn/texlive?view=revision&revision=61260
Author:   karl
Date:     2021-12-09 22:05:14 +0100 (Thu, 09 Dec 2021)
Log Message:
-----------
l3build (9dec21)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/l3build/l3build.lua
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Master/texmf-dist/doc/latex/l3build/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/l3build/README.md
    trunk/Master/texmf-dist/doc/latex/l3build/l3build.pdf
    trunk/Master/texmf-dist/doc/man/man1/l3build.1
    trunk/Master/texmf-dist/doc/man/man1/l3build.man1.pdf
    trunk/Master/texmf-dist/scripts/l3build/l3build-aux.lua
    trunk/Master/texmf-dist/scripts/l3build/l3build-check.lua
    trunk/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
    trunk/Master/texmf-dist/scripts/l3build/l3build-install.lua
    trunk/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua
    trunk/Master/texmf-dist/scripts/l3build/l3build-variables.lua
    trunk/Master/texmf-dist/scripts/l3build/l3build.lua
    trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx

Modified: trunk/Build/source/texk/texlive/linked_scripts/l3build/l3build.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/l3build/l3build.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Build/source/texk/texlive/linked_scripts/l3build/l3build.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -25,7 +25,7 @@
 --]]
 
 -- Version information
-release_date = "2021-12-06"
+release_date = "2021-12-09"
 
 -- File operations are aided by the LuaFileSystem module
 local lfs = require("lfs")
@@ -133,8 +133,8 @@
   checkconfigs = options["config"] or checkconfigs
 end
 
-if options["target"] == "check" then
-  if #checkconfigs > 1 then
+if #checkconfigs > 1 then
+  if options["target"] == "check" then
     local errorlevel = 0
     local opts = options
     local failed = { }
@@ -196,6 +196,13 @@
       -- Avoid running the 'main' set of tests twice
       exit(0)
     end
+  elseif options["target"] == "clean" then
+    local failure
+    for i = 1, #checkconfigs do
+      opts["config"] = {checkconfigs[i]}
+      failure = 0 ~= call({"."}, "clean", opts) or failure
+    end
+    exit(failure and 1 or 0)
   end
 end
 if #checkconfigs == 1 and

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2021-12-09 21:05:14 UTC (rev 61260)
@@ -1,12 +1,14 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 60693 2021-10-04 02:24:25Z preining $
+# $Id: tlmgr.pl 61236 2021-12-06 22:13:25Z karl $
 #
 # Copyright 2008-2021 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
-my $svnrev = '$Revision: 60693 $';
-my $datrev = '$Date: 2021-10-04 04:24:25 +0200 (Mon, 04 Oct 2021) $';
+use strict; use warnings;
+
+my $svnrev = '$Revision: 61236 $';
+my $datrev = '$Date: 2021-12-06 23:13:25 +0100 (Mon, 06 Dec 2021) $';
 my $tlmgrrevision;
 my $tlmgrversion;
 my $prg;
@@ -85,7 +87,6 @@
 use File::Spec;
 use Pod::Usage;
 use Getopt::Long qw(:config no_autoabbrev permute);
-use strict;
 
 use TeXLive::TLConfig;
 use TeXLive::TLPDB;
@@ -10239,7 +10240,7 @@
 distribution (L<https://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 60693 2021-10-04 02:24:25Z preining $
+$Id: tlmgr.pl 61236 2021-12-06 22:13:25Z karl $
 =cut
 
 # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Master/texmf-dist/doc/latex/l3build/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/l3build/CHANGELOG.md	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/doc/latex/l3build/CHANGELOG.md	2021-12-09 21:05:14 UTC (rev 61260)
@@ -7,6 +7,16 @@
 
 ## [Unreleased]
 
+## [2021-12-09]
+
+### Added
+- Support for pre-constructed TDS-style sources (variable `tdsdirs`)
+- Support for injection of tokens using `specialformats`
+
+### Changed
+- If multiple configurations are present, let `l3build clean` run
+  on all of them by default. (issue #214)
+
 ## [2021-12-06]
 
 ### Fixed
@@ -18,7 +28,7 @@
 - Documentation improvements
 - Use `checkengines[1]` as the default for `stdengine`
 - Add sanity check for `TEXMFHOME` value
-- Double \ when writing the curl options, so that \ 
+- Double \ when writing the curl options, so that \
   does not need to be doubled in note and announcement texts.
 
 ### Fixed
@@ -543,7 +553,8 @@
 - Rationalise short option names: removed `-d`, `-E`, `-r`
 - Target `cmdcheck`: specific to LaTeX kernel work
 
-[Unreleased]: https://github.com/latex3/l3build/compare/2021-12-06...HEAD
+[Unreleased]: https://github.com/latex3/l3build/compare/2021-12-09...HEAD
+[2021-12-09]: https://github.com/latex3/l3build/compare/2021-12-06...2021-12-09
 [2021-12-06]: https://github.com/latex3/l3build/compare/2021-11-29...2021-12-06
 [2021-11-29]: https://github.com/latex3/l3build/compare/2021-11-24...2021-11-29
 [2021-11-24]: https://github.com/latex3/l3build/compare/2021-11-12...2021-11-24

Modified: trunk/Master/texmf-dist/doc/latex/l3build/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/l3build/README.md	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/doc/latex/l3build/README.md	2021-12-09 21:05:14 UTC (rev 61260)
@@ -1,7 +1,7 @@
 l3build: a testing and building system for LaTeX
 =================================================
 
-Release 2021-12-06
+Release 2021-12-09
 
 Overview
 --------

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

Modified: trunk/Master/texmf-dist/doc/man/man1/l3build.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/l3build.1	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/doc/man/man1/l3build.1	2021-12-09 21:05:14 UTC (rev 61260)
@@ -1,4 +1,4 @@
-.TH l3build 1 "2021-12-06"
+.TH l3build 1 "2021-12-09"
 .SH NAME
 l3build \- Checking and building packages
 .SH SYNOPSIS

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

Modified: trunk/Master/texmf-dist/scripts/l3build/l3build-aux.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/l3build/l3build-aux.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/scripts/l3build/l3build-aux.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -166,3 +166,16 @@
   end
   return 0
 end
+
+-- Construct a localtexmf including any tdsdirs
+-- Needed for checking and typesetting, hence global
+function localtexmf()
+  local paths = ""
+  for src,_ in pairs(tdsdirs) do
+    paths = paths .. os_pathsep .. abspath(src) .. "//"
+  end
+  if texmfdir and texmfdir ~= "" and direxists(texmfdir) then
+    paths = paths .. os_pathsep .. abspath(texmfdir) .. "//"
+  end
+  return paths
+end

Modified: trunk/Master/texmf-dist/scripts/l3build/l3build-check.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/l3build/l3build-check.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/scripts/l3build/l3build-check.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -719,6 +719,7 @@
   cp(lvtfile, fileexists(testfiledir .. "/" .. lvtfile)
     and testfiledir or unpackdir, testdir)
   local checkopts = checkopts
+  local tokens = ""
   engine = engine or stdengine
   local binary = engine
   local format = gsub(engine,"tex$",checkformat)
@@ -730,6 +731,8 @@
       binary    = engine_info.binary  or binary
       format    = engine_info.format  or format
       checkopts = engine_info.options or checkopts
+      tokens    = engine_info.tokens and (' "' .. engine_info.tokens .. '" ')
+                    or tokens
     end
   end
   -- Finalise format string
@@ -742,10 +745,10 @@
   end
   -- Special casing for ConTeXt
   local function setup(file)
-    return " -jobname=" .. name .. " " .. ' "\\input ' .. file .. '" '
+    return " -jobname=" .. name .. tokens .. ' "\\input ' .. file .. '" '
   end
   if match(checkformat,"^context$") then
-    function setup(file) return ' "' .. file .. '" '  end
+    function setup(file) return tokens .. ' "' .. file .. '" '  end
   end
   local basename = testdir .. "/" .. name
   local gen_file = basename .. test_type.generated
@@ -764,19 +767,15 @@
   -- Ensure there is no stray .log file
   rmfile(testdir,name .. logext)
   local errlevels = {}
-  local localtexmf = ""
-  if texmfdir and texmfdir ~= "" and direxists(texmfdir) then
-    localtexmf = os_pathsep .. abspath(texmfdir) .. "//"
-  end
   for i = 1, checkruns do
     errlevels[i] = run(
       testdir,
       -- No use of localdir here as the files get copied to testdir:
       -- avoids any paths in the logs
-      os_setenv .. " TEXINPUTS=." .. localtexmf
+      os_setenv .. " TEXINPUTS=." .. localtexmf()
         .. (checksearch and os_pathsep or "")
         .. os_concat ..
-      os_setenv .. " LUAINPUTS=." .. localtexmf
+      os_setenv .. " LUAINPUTS=." .. localtexmf()
         .. (checksearch and os_pathsep or "")
         .. os_concat ..
       -- Avoid spurious output from (u)pTeX

Modified: trunk/Master/texmf-dist/scripts/l3build/l3build-ctan.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/l3build/l3build-ctan.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/scripts/l3build/l3build-ctan.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -33,17 +33,28 @@
 
 -- Copy files to the main CTAN release directory
 function copyctan()
-  mkdir(ctandir .. "/" .. ctanpkg)
+  local pkgdir = ctandir .. "/" .. ctanpkg
+  mkdir(pkgdir)
+
+  -- Handle pre-formed sources: do two passes to avoid any cleandir() issues
+  for _,dest in pairs(tdsdirs) do
+    mkdir(pkgdir .. "/" .. dest)
+  end
+  for src,dest in pairs(tdsdirs) do
+    cp("*",src,pkgdir .. "/" .. dest)
+  end
+
+  -- Now deal with the one-at-a-time files
   local function copyfiles(files,source)
     if source == currentdir or flatten then
       for _,filetype in pairs(files) do
-        cp(filetype,source,ctandir .. "/" .. ctanpkg)
+        cp(filetype,source,pkgdir)
       end
     else
       for _,filetype in pairs(files) do
         for _,p in ipairs(tree(source,filetype)) do
           local path = dirname(p.src)
-          local ctantarget = ctandir .. "/" .. ctanpkg .. "/"
+          local ctantarget = pkgdir .. "/"
             .. source .. "/" .. path
           mkdir(ctantarget)
           cp(p.src,source,ctantarget)
@@ -57,8 +68,9 @@
   end
   copyfiles(sourcefiles,sourcefiledir)
   for _,file in pairs(textfiles) do
-    cp(file, textfiledir, ctandir .. "/" .. ctanpkg)
+    cp(file, textfiledir, pkgdir)
   end
+
 end
 
 function bundlectan()

Modified: trunk/Master/texmf-dist/scripts/l3build/l3build-install.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/l3build/l3build-install.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/scripts/l3build/l3build-install.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -32,6 +32,7 @@
 local gsub  = string.gsub
 local lower = string.lower
 local match = string.match
+local format = string.format
 
 local insert = table.insert
 
@@ -107,6 +108,23 @@
     errorlevel = zapdir(path)
     if errorlevel ~= 0 then return errorlevel end
   end
+  -- We remove all directories which contain at least one ordinary file in the source tree
+  for src, dest in pairs(tdsdirs) do
+    dest = dest .. '/'
+    local skipdir
+    for _, p in ipairs(tree(src, '**')) do
+      local src = p.src:sub(2) -- Skip the first '.'
+      if skipdir and src:sub(1, #skipdir) ~= skipdir then
+        skipdir = nil
+      end
+      if (not skipdir) and (not direxists(p.cwd)) then
+        skipdir = dirname(src)
+        errorlevel = zapdir(dest .. skipdir)
+        if errorlevel ~= 0 then return errorlevel end
+        skipdir = skipdir .. '/'
+      end
+    end
+  end
   return 0
 end
 
@@ -287,6 +305,26 @@
     + create_install_map(unpackdir,"makeindex",{makeindexfiles},module)
     + create_install_map(unpackdir,"scripts",{scriptfiles},module)
 
+  for src, dest in pairs(tdsdirs) do
+    dest = target .. '/' .. dest
+    insert(installmap,
+      {file = '*', source = src, dest = dest})
+    dest = dest .. '/'
+    local skipdir
+    for _, p in ipairs(tree(src, '**')) do
+      local src = p.src:sub(2) -- Skip the first '.'
+      if skipdir and src:sub(1, #skipdir) ~= skipdir then
+        skipdir = nil
+      end
+      if (not skipdir) and (not direxists(p.cwd)) then
+        skipdir = dirname(src)
+        errorlevel = cleandir(dest .. skipdir)
+        if errorlevel ~= 0 then return errorlevel end
+        skipdir = skipdir .. '/'
+      end
+    end
+  end
+
   if errorlevel ~= 0 then return errorlevel end
 
   -- Files are all copied in one shot: this ensures that cleandir()

Modified: trunk/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/scripts/l3build/l3build-typesetting.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -54,11 +54,7 @@
   vars = vars or {}
   -- Allow for local texmf files
   local env = os_setenv .. " TEXMFCNF=." .. os_pathsep
-  local localtexmf = ""
-  if texmfdir and texmfdir ~= "" and direxists(texmfdir) then
-    localtexmf = os_pathsep .. abspath(texmfdir) .. "//"
-  end
-  local envpaths = "." .. localtexmf .. os_pathsep
+  local envpaths = "." .. localtexmf() .. os_pathsep
     .. abspath(localdir) .. os_pathsep
     .. dir .. (typesetsearch and os_pathsep or "")
   -- Deal with spaces in paths

Modified: trunk/Master/texmf-dist/scripts/l3build/l3build-variables.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/l3build/l3build-variables.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/scripts/l3build/l3build-variables.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -229,6 +229,7 @@
 
 -- Non-standard installation locations
 tdslocations = tdslocations or { }
+tdsdirs = tdsdirs or {}
 
 -- Upload settings
 curlexe  = curlexe  or "curl"

Modified: trunk/Master/texmf-dist/scripts/l3build/l3build.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/l3build/l3build.lua	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/scripts/l3build/l3build.lua	2021-12-09 21:05:14 UTC (rev 61260)
@@ -25,7 +25,7 @@
 --]]
 
 -- Version information
-release_date = "2021-12-06"
+release_date = "2021-12-09"
 
 -- File operations are aided by the LuaFileSystem module
 local lfs = require("lfs")
@@ -133,8 +133,8 @@
   checkconfigs = options["config"] or checkconfigs
 end
 
-if options["target"] == "check" then
-  if #checkconfigs > 1 then
+if #checkconfigs > 1 then
+  if options["target"] == "check" then
     local errorlevel = 0
     local opts = options
     local failed = { }
@@ -196,6 +196,13 @@
       -- Avoid running the 'main' set of tests twice
       exit(0)
     end
+  elseif options["target"] == "clean" then
+    local failure
+    for i = 1, #checkconfigs do
+      opts["config"] = {checkconfigs[i]}
+      failure = 0 ~= call({"."}, "clean", opts) or failure
+    end
+    exit(failure and 1 or 0)
   end
 end
 if #checkconfigs == 1 and

Modified: trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx	2021-12-09 21:04:51 UTC (rev 61259)
+++ trunk/Master/texmf-dist/source/latex/l3build/l3build.dtx	2021-12-09 21:05:14 UTC (rev 61260)
@@ -161,6 +161,7 @@
 \luavarset{manifestfile}        {"MANIFEST.md"} {Filename to use for the manifest file}
 \luavarseparator
 \luavarset{tdslocations}{\{ \}}{Map for non-standard file installations}
+\luavarset{tdsdirs}{\{ \}}{List of ready-to-use source locations}
 \luavarseparator
 \luavarset{uploadconfig}        {\meta{table}} {Metadata to describe the package for CTAN (see Table~\ref{tab:upload-setup})}
 \luavarset{uploadconfig.pkg}{ctanpkg}{Name of the CTAN package}
@@ -236,7 +237,7 @@
 %    }^^A
 % }
 %
-% \date{Released 2021-12-06}
+% \date{Released 2021-12-09}
 %
 % \maketitle
 % \tableofcontents
@@ -774,6 +775,22 @@
 % A series of example layouts and matching |build.lua| files are available from
 % \url{https://github.com/latex3/l3build/tree/master/examples}.
 %
+% For more complex layouts in which sources are laid out in TDS format and
+% should be used directly, the table \var{tdsdirs} is available. Each entry
+% is a source directory and the matching installation target, for example
+% \begin{Verbatim}
+%   tdsdirs = {sources = "tex"}
+% \end{Verbatim}
+%  This would enable a directory \texttt{sources} in the development area to
+%  be used for testing and typesetting, and for it to be installed into the
+%  \texttt{tex} tree when building a release. When this method is used, the
+%  sources are \emph{not} copied into the local tree: like \var{texmfdir},
+%  they are added directly to the areas accessible during a testing or
+%  typesetting run. When using this approach, the files listed in
+%  \var{typesetfiles} \emph{must} still be included in \var{docfiles}:
+%  they have to be directly visible to \pkg{l3build}, not found by
+%  \texttt{kpsewhich} searching.
+%
 % \subsection{Non-standard formats/binaries}
 %
 % The standard approach used by \pkg{l3build} is to use a combination
@@ -799,6 +816,9 @@
 %   xetex  = {binary = "texexec", format = "", options = "--xetex"}
 % }
 % \end{verbatim}
+% Additional tokens can also be injected before the loading of a test file using
+% the |tokens| entry: this might for example be used to select a graphics driver
+% with a DVI-based route.
 %
 % \subsection{Output normalisation}
 % \label{sec:norm}



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