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 --- .../scripts/l3build/l3build-file-functions.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Master/texmf-dist/scripts/l3build/l3build-file-functions.lua') 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 -- cgit v1.2.3