From 7fbd52bed03ac408b83a740e607ddcf94be29458 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 30 Sep 2019 21:51:15 +0000 Subject: l3build (30sep19) git-svn-id: svn://tug.org/texlive/trunk@52229 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/scripts/l3build/l3build-install.lua | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/scripts/l3build/l3build-install.lua') diff --git a/Master/texmf-dist/scripts/l3build/l3build-install.lua b/Master/texmf-dist/scripts/l3build/l3build-install.lua index d2222c8561e..77338b67a06 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-install.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-install.lua @@ -115,27 +115,36 @@ function install_files(target,full,dry_run) end dir = dir .. (subdir and ("/" .. subdir) or "") local filenames = { } + local sourcepaths = { } local paths = { } -- Generate a file list and include the directory for _,glob_table in pairs(files) do for _,glob in pairs(glob_table) do for file,_ in pairs(tree(source,glob)) do -- Just want the name - local file = gsub(file,"^%./","") + local path,filename = splitpath(file) + local sourcepath = "/" + if path == "." then + sourcepaths[filename] = source + else + path = gsub(path,"^%.","") + sourcepaths[filename] = source .. path + if not flattentds then sourcepath = path .. "/" end + end local matched = false for _,location in ipairs(tdslocations) do local path,glob = splitpath(location) local pattern = glob_to_pattern(glob) - if match(file,pattern) then + if match(filename,pattern) then insert(paths,path) - insert(filenames,path .. "/" .. file) + insert(filenames,path .. sourcepath .. filename) matched = true break end end if not matched then insert(paths,dir) - insert(filenames,dir .. "/" .. file) + insert(filenames,dir .. sourcepath .. filename) end end end @@ -155,7 +164,9 @@ function install_files(target,full,dry_run) print("- " .. file) else local path,file = splitpath(file) - errorlevel = cp(file,source,target .. "/" .. path) + local installpath = target .. "/" .. path + mkdir(installpath) + errorlevel = cp(file,sourcepaths[file],installpath) if errorlevel ~= 0 then return errorlevel end end end -- cgit v1.2.3