[latex3-commits] [git/LaTeX3-latex3-l3build] main: Auto-create dir tree when copying on Unix (fd6b16f)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Feb 24 14:03:08 CET 2022


Repository : https://github.com/latex3/l3build
On branch  : main
Link       : https://github.com/latex3/l3build/commit/fd6b16fa2bf0f881a9bdbff3e90775af2a665a91

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

commit fd6b16fa2bf0f881a9bdbff3e90775af2a665a91
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Feb 24 13:02:53 2022 +0000

    Auto-create dir tree when copying on Unix


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

fd6b16fa2bf0f881a9bdbff3e90775af2a665a91
 CHANGELOG.md               | 2 ++
 l3build-file-functions.lua | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6a3f7f7..7ba3f0a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ this project uses date-based 'snapshot' version identifiers.
 ## [Unreleased]
 
 ### Fixed
+- Creation of subdirectories in TDS structures on Unix-like systems
+
 - use `form-string` rather than `form` for all curl fields to avoid
   misinterpreting leading `@` or `<` eg a description starting `<p>`
   
diff --git a/l3build-file-functions.lua b/l3build-file-functions.lua
index 4aa591d..9f6b908 100644
--- a/l3build-file-functions.lua
+++ b/l3build-file-functions.lua
@@ -1,6 +1,6 @@
 --[[
 
-File l3build-file-functions.lua Copyright (C) 2018-2021 The LaTeX Project
+File l3build-file-functions.lua Copyright (C) 2018-2022 The LaTeX Project
 
 It may be distributed and/or modified under the conditions of the
 LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -244,6 +244,11 @@ function cp(glob, source, dest)
         ) and 0 or 1
       end
     else
+      -- Ensure we get similar behavior on all platforms
+      if not direxists(dirname(dest)) then
+        errorlevel = mkdir(dirname(dest))
+      end
+      if errorlevel ~=0 then return errorlevel end
       errorlevel = execute(
         "cp -RLf '" .. p.cwd .. "' '" .. dest .. "'"
       ) and 0 or 1





More information about the latex3-commits mailing list.