[latex3-commits] [git/LaTeX3-latex3-l3build] master: Retain date lines and normalise to ....-..-.. (090ec0f)
Joseph Wright
joseph.wright at morningstar2.co.uk
Fri Sep 21 13:30:34 CEST 2018
Repository : https://github.com/latex3/l3build
On branch : master
Link : https://github.com/latex3/l3build/commit/090ec0f83babdbb93e64ffc428218cf2b7e29928
>---------------------------------------------------------------
commit 090ec0f83babdbb93e64ffc428218cf2b7e29928
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Sep 21 12:30:34 2018 +0100
Retain date lines and normalise to ....-..-..
Also note explicit removal of .fd lines.
This change *will require .tlg updates*, at least for LaTeX2e itself.
>---------------------------------------------------------------
090ec0f83babdbb93e64ffc428218cf2b7e29928
CHANGELOG.md | 7 +++++++
l3build-check.lua | 35 ++++++++++++++++++++---------------
l3build.dtx | 6 ++++--
3 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d168f93..b7fce20 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,13 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+
+- Normalise date lines to contain "...-..-.." rather than removing
+ (including normalising version data in such lines): note that
+ `.tlg` file updates may be required after this change
+- Explicitly exclude `.fd` file lines
+
## [2018-08-07]
### Changed
diff --git a/l3build-check.lua b/l3build-check.lua
index aff758f..e59f6ca 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -102,23 +102,23 @@ local function normalize_log(content,engine,errlevels)
maxprintline = maxprintline + 1 -- Deal with an out-by-one error
end
local function killcheck(line)
- -- Skip lines containing file dates
- if match(line, "[^<]%d%d%d%d/%d%d/%d%d")
- or match(line, "[^<]%d%d%d%d%-%d%d%-%d%d") then
- return true
- elseif
-- Skip \openin/\openout lines in web2c 7.x
-- As Lua doesn't allow "(in|out)", a slightly complex approach:
-- do a substitution to check the line is exactly what is required!
- match(
- gsub(line, "^\\openin", "\\openout"), "^\\openout%d%d? = "
- ) then
- return true
- end
+ if match(gsub(line, "^\\openin", "\\openout"), "^\\openout%d%d? = ") then
+ return true
+ end
return false
end
-- Substitutions to remove some non-useful changes
- local function normalize(line, lastline)
+ local function normalize(line,lastline,drop_fd)
+ if drop_fd then
+ if match(line," *%)") then
+ return "",""
+ else
+ return "","",true
+ end
+ end
-- Zap line numbers from \show, \showbox, \box_show and the like:
-- do this before wrapping lines
line = gsub(line, "^l%.%d+ ", "l. ...")
@@ -151,12 +151,16 @@ local function normalize_log(content,engine,errlevels)
line = gsub(line, pattern, "../%1")
end
end
+ -- Deal with dates
+ if match(line, "[^<]%d%d%d%d[/%-]%d%d[/%-]%d%d") then
+ line = gsub(line,"%d%d%d%d[/%-]%d%d[/%-]%d%d","....-..-..")
+ line = gsub(line,"v%d+%.?%d?%d?%w?","v...")
+ end
-- Deal with the fact that "(.aux)" may have still a leading space
line = gsub(line, "^ %(%.aux%)", "(.aux)")
- -- Merge all of .fd data into one line so will be removed later
+ -- Zap .fd lines: drop the first part, and skip to the end
if match(line, "^ *%([%.%/%w]+%.fd[^%)]*$") then
- lastline = (lastline or "") .. line
- return "", (lastline or "") .. line
+ return "","",true
end
-- TeX90/XeTeX knows only the smaller set of dimension units
line = gsub(line,
@@ -250,6 +254,7 @@ local function normalize_log(content,engine,errlevels)
return line, lastline
end
local lastline = ""
+ local drop_fd = false
local new_content = ""
local prestart = true
local skipping = false
@@ -264,7 +269,7 @@ local function normalize_log(content,engine,errlevels)
elseif match(line, "^%)?TIMO$") then
skipping = false
elseif not prestart and not skipping then
- line, lastline = normalize(line, lastline)
+ line, lastline, drop_fd = normalize(line, lastline,drop_fd)
if not match(line, "^ *$") and not killcheck(line) then
new_content = new_content .. line .. os_newline
end
diff --git a/l3build.dtx b/l3build.dtx
index 264f3b2..9e3dc0c 100644
--- a/l3build.dtx
+++ b/l3build.dtx
@@ -745,8 +745,8 @@
% \item Lines before the \cs{START}, after the \cs{END} and within
% \cs{OMIT}/\cs{TIMO} blocks
% \item Entirely blank lines, including those consisting only of spaces.
-% \item Lines containing file dates in format
-% \texttt{\meta{yyyy}/\meta{mm}/\meta{dd}}.
+% \item Lines related to loading |.fd| files (from \texttt{(\meta{name}.fd}
+% to the matching \texttt{)}).
% \item Lines starting \cs{openin} or \cs{openout}.
% \end{itemize}
% Modifications made in lines are:
@@ -762,6 +762,8 @@
% years due to a \TeX{} bug).
% \item Conversion of \texttt{on line \meta{number}} to \texttt{on line ..}
% to allow flexibility in changes to test files.
+% \item Conversion of file dates to \texttt{....-..-..}, and any version
+% numbers on the same lines to \texttt{v...}.
% \item Conversion of register numbers in assignment lines
% \texttt{\cs{\meta{register}}=\cs{\meta{type}}\meta{number}} to
% \texttt{\cs{\meta{type}}\meta{...}}
More information about the latex3-commits
mailing list