[latex3-commits] [git/LaTeX3-latex3-l3build] master: Copy nested files into TDS (fixes #100) (bf4736f)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Sep 30 09:25:21 CEST 2019


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

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

commit bf4736fe3ff258349f9b179b6c765bb3c5295114
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Sep 30 08:23:29 2019 +0100

    Copy nested files into TDS (fixes #100)


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

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

diff --git a/CHANGELOG.md b/CHANGELOG.md
index dea2dd5..908c23b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,10 @@ this project uses date-based 'snapshot' version identifiers.
 
 - Additional notes on `texmfdir`
 
+### Fixed
+
+- Copy TDS files inside subdirectories (fixes #100)
+
 ## [2019-09-29]
 
 ### Fixed
diff --git a/l3build-install.lua b/l3build-install.lua
index d2222c8..bbe3225 100644
--- a/l3build-install.lua
+++ b/l3build-install.lua
@@ -115,27 +115,34 @@ 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)
+          if path == "." then
+            sourcepaths[filename] = source
+          else
+            path = gsub(path,"^%.","")
+            sourcepaths[filename] = source .. path
+          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 .. "/" .. filename)
               matched = true
               break
             end
           end
           if not matched then
             insert(paths,dir)
-            insert(filenames,dir .. "/" .. file)
+            insert(filenames,dir .. "/" .. filename)
           end
         end
       end





More information about the latex3-commits mailing list