From a249bad88a4acd5b5d3112eeed746258c9dce28d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 27 Nov 2019 22:05:41 +0000 Subject: l3build (27nov19) git-svn-id: svn://tug.org/texlive/trunk@52948 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/l3build/l3build-install.lua | 16 +++++++++++----- 1 file changed, 11 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 77338b67a06..1007d2ed1b4 100644 --- a/Master/texmf-dist/scripts/l3build/l3build-install.lua +++ b/Master/texmf-dist/scripts/l3build/l3build-install.lua @@ -105,6 +105,10 @@ function uninstall() end function install_files(target,full,dry_run) + + -- Needed so paths are only cleaned out once + local cleanpaths = { } + local function install_files(source,dir,files,subdir) subdir = subdir or moduledir -- For material associated with secondary tools (BibTeX, MakeIndex) @@ -155,8 +159,12 @@ function install_files(target,full,dry_run) if next(filenames) then if not dry_run then for _,path in pairs(paths) do - errorlevel = cleandir(target .. "/" .. path) - if errorlevel ~= 0 then return errorlevel end + local dir = target .. "/" .. path + if not cleanpaths[dir] then + errorlevel = cleandir(dir) + if errorlevel ~= 0 then return errorlevel end + end + cleanpaths[dir] = true end end for _,file in ipairs(filenames) do @@ -164,9 +172,7 @@ function install_files(target,full,dry_run) print("- " .. file) else local path,file = splitpath(file) - local installpath = target .. "/" .. path - mkdir(installpath) - errorlevel = cp(file,sourcepaths[file],installpath) + errorlevel = cp(file,sourcepaths[file],target .. "/" .. path) if errorlevel ~= 0 then return errorlevel end end end -- cgit v1.2.3