[latex3-commits] [git/LaTeX3-latex3-l3build] main: Return PDFs to appropriate subdir (fixes #209) (824953b)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Nov 24 17:55:01 CET 2021


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

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

commit 824953b2c5dae2bb257ae5d8e82bb80056342b03
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Nov 24 16:55:01 2021 +0000

    Return PDFs to appropriate subdir (fixes #209)


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

824953b2c5dae2bb257ae5d8e82bb80056342b03
 CHANGELOG.md            |  1 +
 l3build-typesetting.lua | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a4aa732..16ca9f7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Fixed
 - Incorrect line in `manifest` target (see #195)
+- Placement of PDF files in subdirectory locations (issue #209)
 
 ## [2021-11-24]
 
diff --git a/l3build-typesetting.lua b/l3build-typesetting.lua
index 1d44a2b..d6d3981 100644
--- a/l3build-typesetting.lua
+++ b/l3build-typesetting.lua
@@ -141,9 +141,7 @@ local function typesetpdf(file,dir)
     print(" ! Compilation failed")
     return errorlevel
   end
-  local pdfname = name .. pdfext
-  rm(docfiledir,pdfname)
-  return cp(pdfname,dir,docfiledir)
+  return 0
 end
 
 function typeset(file,dir,exe)
@@ -211,7 +209,8 @@ function doc(files)
   local done = {}
   for _,typesetfiles in ipairs({typesetdemofiles,typesetfiles}) do
     for _,glob in pairs(typesetfiles) do
-      for _,p in ipairs(tree(typesetdir,glob)) do
+      local destpath,globstub = splitpath(glob)
+      for _,p in ipairs(tree(typesetdir,globstub)) do
         local path,srcname = splitpath(p.cwd)
         local name = jobname(srcname)
         if not done[name] then
@@ -233,6 +232,9 @@ function doc(files)
               return errorlevel
             else
               done[name] = true
+              local pdfname = jobname(srcname) .. pdfext
+              rm(pdfname,destpath)
+              cp(pdfname,path,destpath)
             end
           end
         end





More information about the latex3-commits mailing list.