[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Use io.popen to avoid os_yes (978df7a1)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Feb 21 09:03:35 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/978df7a1879c4edb833cc228c3bce9f82add325a

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

commit 978df7a1879c4edb833cc228c3bce9f82add325a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Feb 21 08:03:35 2020 +0000

    Use io.popen to avoid os_yes


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

978df7a1879c4edb833cc228c3bce9f82add325a
 base/build.lua | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/base/build.lua b/base/build.lua
index 4286b9c7..6faf1940 100644
--- a/base/build.lua
+++ b/base/build.lua
@@ -172,8 +172,7 @@ function bundleunpack ()
   end
   for _,i in ipairs (unpackfiles) do
     for _,j in ipairs (filelist (unpackdir, i)) do
-      os.execute (os_yes .. ">>" .. localdir .. "/yes")
-      errorlevel = os.execute (
+      local success = io.popen (
           -- Notice that os.execute is used from 'here' as this ensures that
           -- localdir points to the correct place: running 'inside'
           -- unpackdir would avoid the need for setting -output-directory
@@ -181,10 +180,11 @@ function bundleunpack ()
           -- of localdir w.r.t. unpackdir
           os_setenv .. " TEXINPUTS=" .. unpackdir .. os_concat ..
           unpackexe .. " " .. unpackopts .. " -output-directory=" .. unpackdir
-            .. " " .. unpackdir .. "/" .. j .. " < " .. localdir .. "/yes"
-        )
-      if errorlevel ~=0 then
-        return errorlevel
+            .. " " .. unpackdir .. "/" .. j,"w"
+        ):write(string.rep("y\n", 300)):close()
+      if not success then
+        print("DRAT")
+        return 1
       end
     end
   end





More information about the latex3-commits mailing list.