[latex3-commits] [git/LaTeX3-latex3-l3build] master: Only clean out dirs once per install run (a6e7c87)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Nov 27 13:41:08 CET 2019


Repository : https://github.com/latex3/l3build
On branch  : master
Link       : https://github.com/latex3/l3build/commit/a6e7c87974ec257b6e5d0032fe74b3ed03e79de3

>---------------------------------------------------------------

commit a6e7c87974ec257b6e5d0032fe74b3ed03e79de3
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Nov 27 12:41:08 2019 +0000

    Only clean out dirs once per install run
    
    This shows up if you have mixed doc/source
    material and use the --full target.


>---------------------------------------------------------------

a6e7c87974ec257b6e5d0032fe74b3ed03e79de3
 CHANGELOG.md        |  4 ++++
 l3build-install.lua | 16 +++++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 29810c4..6486c63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,10 @@ this project uses date-based 'snapshot' version identifiers.
 
 - `\ASSERTSTR` no longer needs e-TeX
 
+### Fixed
+
+- Installation of files using the `--full` switch
+
 ## [2019-11-01]
 
 ### Added
diff --git a/l3build-install.lua b/l3build-install.lua
index 77338b6..1007d2e 100644
--- a/l3build-install.lua
+++ b/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





More information about the latex3-commits mailing list