summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/l3build/l3build-install.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/l3build/l3build-install.lua')
-rw-r--r--Master/texmf-dist/scripts/l3build/l3build-install.lua21
1 files changed, 16 insertions, 5 deletions
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