From 54371d50fc6a5abc2b07e926553d7ca9cccdff74 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 26 Jan 2016 23:00:51 +0000 Subject: l3 git-svn-id: svn://tug.org/texlive/trunk@39491 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/l3build/l3build.lua | 88 ++++++++++------------ .../tex/latex/l3build/regression-test.tex | 2 +- 2 files changed, 39 insertions(+), 51 deletions(-) (limited to 'Master/texmf-dist/tex/latex/l3build') diff --git a/Master/texmf-dist/tex/latex/l3build/l3build.lua b/Master/texmf-dist/tex/latex/l3build/l3build.lua index aac3a20ca20..e6766737673 100644 --- a/Master/texmf-dist/tex/latex/l3build/l3build.lua +++ b/Master/texmf-dist/tex/latex/l3build/l3build.lua @@ -1,6 +1,6 @@ --[[ - File l3build.lua (C) Copyright 2014-2015 The LaTeX3 Project + File l3build.lua (C) Copyright 2014-2016 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -17,8 +17,8 @@ --]] -- Version information: should be identical to that in l3build.dtx -release_date = "2015/12/20" -release_ver = "6326" +release_date = "2016/01/19" +release_ver = "6377" -- "module" is a deprecated function in Lua 5.2: as we want the name -- for other purposes, and it should eventually be 'free', simply @@ -149,6 +149,7 @@ makeindexopts = makeindexopts or "" -- Other required settings asciiengines = asciiengines or {"pdftex"} checkruns = checkruns or 1 +maxprintline = maxprintline or 79 packtdszip = packtdszip or false -- Not actually needed but clearer scriptname = scriptname or "build.lua" -- Script used in each directory typesetcmds = typesetcmds or "" @@ -189,11 +190,11 @@ function argparse() } local option_args = { - date = true , - engine = true , - halt = false, - help = false, - quiet = false, + date = true , + engine = true , + halt = false, + help = false, + quiet = false, version = true } -- arg[1] is a special case: must be a command or "-h"/"--help" @@ -213,7 +214,6 @@ function argparse() end -- An auxiliary to grab all file names into a table local function remainder(num) - local i local files = { } for i = num, #arg do table.insert(files, arg[i]) @@ -382,9 +382,6 @@ end -- operations 'natively'. -- Detect the operating system in use --- See http://www.lua.org/manual/5.2/manual.html#pdf-package.config for details --- of the string used here to pick up the operating system (Windows or --- 'not-Windows' -- Support items are defined here for cases where a single string can cover -- both Windows and Unix cases: more complex situations are handled inside -- the support functions @@ -564,7 +561,7 @@ function rmdir(dir) -- First, make sure it exists to avoid any errors mkdir(dir) if os_windows then - return os.execute("rmdir /s /q " .. unix_to_win(dir) ) + return os.execute("rmdir /s /q " .. unix_to_win(dir)) else return os.execute("rm -r " .. dir) end @@ -577,8 +574,7 @@ end -- Deal with the fact that Windows and Unix use different path separators function unix_to_win(path) - local path = string.gsub(path, "/", "\\") - return path + return string.gsub(path, "/", "\\") end -- @@ -731,6 +727,10 @@ end -- Convert the raw log file into one for comparison/storage: keeps only -- the 'business' part from the tests and removes system-dependent stuff function formatlog(logfile, newfile, engine) + local maxprintline = maxprintline + if engine == "luatex" or engine == "luajittex" then + maxprintline = maxprintline + 1 -- Deal with an out-by-one error + end local function killcheck(line) -- Skip lines containing file dates if string.match(line, "[^<]%d%d%d%d/%d%d/%d%d") then @@ -747,9 +747,14 @@ function formatlog(logfile, newfile, engine) return false end -- Substitutions to remove some non-useful changes - local function normalize(line, maxprintline) + local function normalize(line) + -- Zap line numbers from \show, \showbox, \box_show and the like: + -- do this before wrapping lines + line = string.gsub(line, "^l%.%d+ ", "l. ...") -- Allow for wrapped lines: preserve the content and wrap - if (string.len(line) == maxprintline) then + -- Skip lines that have an explicit marker for truncation + if string.len(line) == maxprintline and + not string.match(line, "%.%.%.$") then lastline = (lastline or "") .. line return "" end @@ -776,6 +781,8 @@ function formatlog(logfile, newfile, engine) end -- Zap map loading of map line = string.gsub(line, "%{%w?:?[%w/%-]*/pdftex%.map%}", "") + -- Deal with the fact that "(.aux)" may have still a leading space + line = string.gsub(line, "^ %(%.aux%)", "(.aux)") -- Merge all of .fd data into one line so will be removed later if string.match(line, "^ *%([%.%/%w]+%.fd[^%)]*$") then lastline = (lastline or "") .. line @@ -796,17 +803,6 @@ function formatlog(logfile, newfile, engine) for i = 0, 31 do line = string.gsub(line, string.char(i), "^^" .. string.char(64 + i)) end - -- Zap line numbers from \show, \showbox, \box_show and the like - -- Two stages as line wrapping alters some of them and restore the break - line = string.gsub(line, "^l%.%d+ ", "l. ...") - line = string.gsub( - line, - "%.%.%.l%.%d+ ( *)%}$", - "..." .. os_newline .. "l. ...%1}" - ) - -- Remove spaces at the start of lines: deals with the fact that LuaTeX - -- uses a different number to the other engines - line = string.gsub(line, "^%s+", "") -- Remove 'normal' direction information on boxes with (u)pTeX line = string.gsub(line, ",? yoko direction,?", "") -- A tidy-up to keep LuaTeX and other engines in sync @@ -821,12 +817,6 @@ function formatlog(logfile, newfile, engine) end return line end - local kpse = require("kpse") - kpse.set_program_name(engine) - local maxprintline = tonumber(kpse.expand_var("$max_print_line")) - if engine == "luatex" or engine == "luajittex" then - maxprintline = maxprintline + 1 -- Deal with an out-by-one error - end local lastline = "" local newlog = "" local prestart = true @@ -841,7 +831,7 @@ function formatlog(logfile, newfile, engine) elseif line == "TIMO" then skipping = false elseif not prestart and not skipping then - line = normalize(line, maxprintline) + line = normalize(line) if not string.match(line, "^ *$") and not killcheck(line) then newlog = newlog .. line .. os_newline end @@ -987,12 +977,9 @@ function formatlualog(logfile, newfile) -- Wrap some cases that can be picked out -- In some places LuaTeX does use max_print_line, then we -- get into issues with different wrapping approaches - local kpse = require("kpse") - kpse.set_program_name("luatex") - local maxprintline = tonumber(kpse.expand_var("$max_print_line")) - if (string.len(line) == maxprintline) then - return "", line - elseif (string.len(lastline) == maxprintline) then + if string.len(line) == maxprintline then + return "", lastline .. line + elseif string.len(lastline) == maxprintline then if string.match(line, "\\ETC%.%}$") then -- If the line wrapped at \ETC we might have lost a space return lastline @@ -1003,8 +990,13 @@ function formatlualog(logfile, newfile) else return lastline .. os_newline .. line, "" end + -- Return all of the text for a wrapped (multi)line + elseif string.len(lastline) > maxprintline then + return lastline .. line, "" end - return line, "" + -- Remove spaces at the start of lines: deals with the fact that LuaTeX + -- uses a different number to the other engines + return string.gsub(line, "^%s+", ""), "" end local newlog = "" local lastline = "" @@ -1097,7 +1089,7 @@ function runcheck(name, hide) -- Do additional log formatting if the engine is LuaTeX, there is no -- LuaTeX-specific .tlg file and the default engine is not LuaTeX if enginename == "luatex" - and tlgfile ~= name .. ".luatex" .. tlgext + and not string.match(tlgfile, "%.luatex" .. "%" .. tlgext) and stdengine ~= "luatex" and stdengine ~= "luajittex" then local luatlgfile = testdir .. "/" .. name .. ".luatex" .. tlgext @@ -1181,6 +1173,9 @@ function runtest(name, engine, hide, ext) -- Avoid spurious output from (u)pTeX os_setenv .. " GUESS_INPUT_KANJI_ENCODING=0" .. os_concat .. + -- Ensure lines are of a known length + os_setenv .. " max_print_line=" .. maxprintline + .. os_concat .. realengine .. format .. " " .. checkopts .. " " .. asciiopt .. lvtfile .. (hide and (" > " .. os_null) or "") @@ -1376,7 +1371,6 @@ function check(names) if names and next(names) then hide = false end - local i names = names or { } -- No names passed: find all test files if not next(names) then @@ -1394,7 +1388,6 @@ function check(names) end -- Actually run the tests print("Running checks on") - local name for _,name in ipairs(names) do print(" " .. name) local errlevel = runcheck(name, hide) @@ -1621,7 +1614,6 @@ function doc(files) -- Allow for command line selection of files local typeset = true if files and next(files) then - local k typeset = false for _,k in ipairs(files) do if k == stripext(j) then @@ -1666,7 +1658,6 @@ end function save(names) checkinit() local engines = optengines or {stdengine} - local name for _,name in pairs(names) do local engine for _,engine in pairs(engines) do @@ -1703,7 +1694,6 @@ end if versionform ~= "" and not setversion_update_line then if versionform == "ProvidesPackage" then function setversion_update_line(line, date, version) - local i -- No real regex so do it one type at a time for _,i in pairs({"Class", "File", "Package"}) do if string.match( @@ -1722,7 +1712,6 @@ if versionform ~= "" and not setversion_update_line then end elseif versionform == "ProvidesExplPackage" then function setversion_update_line(line, date, version) - local i -- No real regex so do it one type at a time for _,i in pairs({"Class", "File", "Package"}) do if string.match( @@ -1804,7 +1793,6 @@ function setversion() if optversion then version = optversion[1] or version end - local i, j for _,i in pairs(versionfiles) do for _,j in pairs(filelist(".", i)) do rewrite(j, date, version) diff --git a/Master/texmf-dist/tex/latex/l3build/regression-test.tex b/Master/texmf-dist/tex/latex/l3build/regression-test.tex index 40bddaeee44..96dc4320a58 100644 --- a/Master/texmf-dist/tex/latex/l3build/regression-test.tex +++ b/Master/texmf-dist/tex/latex/l3build/regression-test.tex @@ -14,7 +14,7 @@ %% Do not distribute a modified version of this file. %% %% -%% File l3build.dtx (C) Copyright 2014-2015 The LaTeX3 Project +%% File l3build.dtx (C) Copyright 2014-2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this -- cgit v1.2.3