From 4fcc4e64faf655e862a459d645a48f84f420b79a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 19 Apr 2022 20:06:46 +0000 Subject: l3build (19apr22) git-svn-id: svn://tug.org/texlive/trunk@63079 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/l3build/l3build-check.lua | 13 +++++++------ .../scripts/l3build/l3build-file-functions.lua | 18 ++++++++++++------ Master/texmf-dist/scripts/l3build/l3build-install.lua | 4 ++-- Master/texmf-dist/scripts/l3build/l3build.lua | 4 ++-- 4 files changed, 23 insertions(+), 16 deletions(-) (limited to 'Master/texmf-dist/scripts/l3build') diff --git a/Master/texmf-dist/scripts/l3build/l3build-check.lua b/Master/texmf-dist/scripts/l3build/l3build-check.lua index 94ffc671ef8..7b3191aa204 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-check.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-check.lua @@ -553,6 +553,7 @@ local function normalize_pdf(content) not match(line,"^%%%%%+") then line = gsub(line,"%/ID( ?)%[<[^>]+><[^>]+>]","/ID%1[]") line = gsub(line,"%/ID( ?)%[(%b())%2%]","/ID%1[]") + line = gsub(line,"GhostScript %d%.%d+%.?%d*","GhostScript ...") new_content = new_content .. line .. os_newline end end @@ -827,7 +828,7 @@ function runtest(name, engine, hide, ext, test_type, breakout) test_type.rewrite(gen_file,new_file,engine,errlevels) -- Store secondary files for this engine for _,filetype in pairs(auxfiles) do - for _,file in pairs(filelist(testdir, filetype)) do + for _,file in ipairs(filelist(testdir, filetype)) do if match(file,"^" .. name .. "%.[^.]+$") then local newname = gsub(file,"(%.[^.]+)$","." .. engine .. "%1") if fileexists(testdir .. "/" .. newname) then @@ -930,7 +931,7 @@ function check(names) excludepatterns[num_exclude] = glob_to_pattern(glob .. ext) end for _,glob in pairs(includetests) do - for _,name in pairs(filelist(testfiledir, glob .. ext)) do + for _,name in ipairs(filelist(testfiledir, glob .. ext)) do local exclude for i=1, num_exclude do if match(name, excludepatterns[i]) then @@ -942,7 +943,7 @@ function check(names) insert(names,jobname(name)) end end - for _,name in pairs(filelist(unpackdir, glob .. ext)) do + for _,name in ipairs(filelist(unpackdir, glob .. ext)) do local exclude for i=1, num_exclude do if not match(name, excludepatterns[i]) then @@ -1027,7 +1028,7 @@ end -- A short auxiliary to print the list of differences for check function checkdiff() print("\n Check failed with difference files") - for _,i in ipairs(filelist(testdir, "*" .. os_diffext)) do + for _,i in ipairs(ordered_filelist(testdir, "*" .. os_diffext)) do print(" - " .. testdir .. "/" .. i) end print("") @@ -1035,7 +1036,7 @@ end function showfailedlog(name) print("\nCheck failed with log file") - for _,i in ipairs(filelist(testdir, name..".log")) do + for _,i in ipairs(ordered_filelist(testdir, name..".log")) do print(" - " .. testdir .. "/" .. i) print("") local f = open(testdir .. "/" .. i,"r") @@ -1049,7 +1050,7 @@ end function showfaileddiff() print("\nCheck failed with difference file") - for _,i in ipairs(filelist(testdir, "*" .. os_diffext)) do + for _,i in ipairs(ordered_filelist(testdir, "*" .. os_diffext)) do print(" - " .. testdir .. "/" .. i) print("") local f = open(testdir .. "/" .. i,"r") diff --git a/Master/texmf-dist/scripts/l3build/l3build-file-functions.lua b/Master/texmf-dist/scripts/l3build/l3build-file-functions.lua index ca393335a18..841c05571ae 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-file-functions.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-file-functions.lua @@ -198,7 +198,7 @@ function escapepath(path) else path = gsub(path,"\\ ","[PATH-SPACE]") path = gsub(path," ","\\ ") - return gsub(path,"%[PATH-SPACE%]","\\ ") + return gsub(path,"%[PATH%-SPACE%]","\\ ") end end @@ -234,13 +234,13 @@ function cp(glob, source, dest) if os_type == "windows" then if direxists(p.cwd) then errorlevel = execute( - 'xcopy /y /e /i "' .. unix_to_win(p.cwd) .. '" "' - .. unix_to_win(dest .. '/' .. p.src) .. '" > nul' + 'xcopy /y /e /i "' .. unix_to_win(p.cwd) .. '" ' + .. unix_to_win(dest .. '/' .. escapepath(p.src)) .. ' > nul' ) and 0 or 1 else errorlevel = execute( - 'xcopy /y "' .. unix_to_win(p.cwd) .. '" "' - .. unix_to_win(dest .. '/') .. '" > nul' + 'xcopy /y "' .. unix_to_win(p.cwd) .. '" ' + .. unix_to_win(dest .. '/') .. ' > nul' ) and 0 or 1 end else @@ -250,7 +250,7 @@ function cp(glob, source, dest) if errorlevel ~=0 then return errorlevel end end errorlevel = execute( - "cp -RLf '" .. p.cwd .. "' '" .. dest .. "'" + "cp -RLf '" .. p.cwd .. "' " .. dest ) and 0 or 1 end if errorlevel ~=0 then @@ -283,6 +283,11 @@ function filelist(path, glob) end return files end +function ordered_filelist(...) + local files = filelist(...) + table.sort(files) + return files +end ---@class tree_entry_t ---@field src string path relative to the source directory @@ -367,6 +372,7 @@ function remove_duplicates(a) end function mkdir(dir) + dir = escapepath(dir) if os_type == "windows" then -- Windows (with the extensions) will automatically make directory trees -- but issues a warning if the dir already exists: avoid by including a test diff --git a/Master/texmf-dist/scripts/l3build/l3build-install.lua b/Master/texmf-dist/scripts/l3build/l3build-install.lua index 6a28463e653..baea5a9a425 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-install.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-install.lua @@ -52,9 +52,9 @@ function uninstall() local installdir = gethome() .. "/" .. dir if options["dry-run"] then local files = filelist(installdir) - if next(files) then + if files[1] then print("\n" .. "For removal from " .. installdir .. ":") - for _,file in pairs(filelist(installdir)) do + for _,file in ipairs(ordered_filelist(installdir)) do print("- " .. file) end end diff --git a/Master/texmf-dist/scripts/l3build/l3build.lua b/Master/texmf-dist/scripts/l3build/l3build.lua index 7556fb39d85..72d67d2e1c9 100755 --- a/Master/texmf-dist/scripts/l3build/l3build.lua +++ b/Master/texmf-dist/scripts/l3build/l3build.lua @@ -25,7 +25,7 @@ for those people who are interested. --]] -- Version information -release_date = "2022-04-12" +release_date = "2022-04-19" -- File operations are aided by the LuaFileSystem module local lfs = require("lfs") @@ -156,7 +156,7 @@ if #checkconfigs > 1 then if config ~= "build" then testdir = testdir .. "-" .. config end - for _,i in ipairs(filelist(testdir,"*" .. os_diffext)) do + for _,i in ipairs(ordered_filelist(testdir,"*" .. os_diffext)) do print(" - " .. testdir .. "/" .. i) end print("") -- cgit v1.2.3