summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/l3build/l3build-file-functions.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-04-19 20:06:46 +0000
committerKarl Berry <karl@freefriends.org>2022-04-19 20:06:46 +0000
commit4fcc4e64faf655e862a459d645a48f84f420b79a (patch)
tree086db1ee4d396da2be5dcf7bcf724c36dfe471da /Master/texmf-dist/scripts/l3build/l3build-file-functions.lua
parent5327114add0a1ae842998ad1a45403ce9f5e9f33 (diff)
l3build (19apr22)
git-svn-id: svn://tug.org/texlive/trunk@63079 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/l3build/l3build-file-functions.lua')
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-file-functions.lua18
1 files changed, 12 insertions, 6 deletions
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