[latex3-commits] [git/l3build] master: setversion wasn't deleting the backup file (6b3df39)

Will Robertson wspr81 at gmail.com
Tue Jan 2 04:12:21 CET 2018


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

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

commit 6b3df3908f4b6852aba19f0ac77df965440a5a41
Author: Will Robertson <wspr81 at gmail.com>
Date:   Tue Jan 2 11:12:21 2018 +0800

    setversion wasn't deleting the backup file
    
    due to a bad interaction between the output of `tree()` being fed into `filelist()`.
    this maybe isn't the best solution but it seems to fix the problem.


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

6b3df3908f4b6852aba19f0ac77df965440a5a41
 l3build.lua |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/l3build.lua b/l3build.lua
index aa5f6dd..cf45bc4 100644
--- a/l3build.lua
+++ b/l3build.lua
@@ -767,12 +767,19 @@ end
 -- Remove file(s) based on a glob
 function rm(source, glob)
   for _,i in ipairs(filelist(source, glob)) do
-    os_remove(source .. "/" .. i)
+    rmfile(source,i)
   end
   -- os_remove doesn't give a sensible errorlevel
   return 0
 end
 
+-- Remove file
+function rmfile(source, file)
+  os_remove(source .. "/" .. file)
+  -- os_remove doesn't give a sensible errorlevel
+  return 0
+end
+
 -- Remove a directory tree
 function rmdir(dir)
   -- First, make sure it exists to avoid any errors
@@ -2320,7 +2327,7 @@ function setversion()
       output(f)
       write(result)
       close(f)
-      rm(dir, file .. bakext)
+      rmfile(dir, file .. bakext)
     end
   end
   local date = options["date"] or os_date("%Y-%m-%d")





More information about the latex3-commits mailing list