diff options
author | Norbert Preining <norbert@preining.info> | 2019-11-28 03:01:37 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-11-28 03:01:37 +0000 |
commit | 747dfc2fd42b7dbdc60bb83a91392d4960b1f48e (patch) | |
tree | fca18e41029be2cf7744f813ffc1844e2dc7594a /macros/latex/contrib/l3build/l3build-install.lua | |
parent | 5142daa13e19b32afa064863e039da3afaf06e83 (diff) |
CTAN sync 201911280301
Diffstat (limited to 'macros/latex/contrib/l3build/l3build-install.lua')
-rw-r--r-- | macros/latex/contrib/l3build/l3build-install.lua | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/macros/latex/contrib/l3build/l3build-install.lua b/macros/latex/contrib/l3build/l3build-install.lua index 77338b67a0..1007d2ed1b 100644 --- a/macros/latex/contrib/l3build/l3build-install.lua +++ b/macros/latex/contrib/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 |