[latex3-commits] [l3svn] 02/02: fix single file copy on windows

noreply at latex-project.org noreply at latex-project.org
Thu Nov 5 14:54:39 CET 2015


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit fc7f12522514a9bad9b751c6ad7cd2d24c540cd2
Author: XZS <d.f.fischer at web.de>
Date:   Thu Nov 5 13:28:16 2015 +0100

    fix single file copy on windows
    
    The windows xcopy command needs different parameters to copy files and
    directories. It also wants a target directory to be explicitly
    specified to place files correctly.
---
 l3build/l3build.lua |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/l3build/l3build.lua b/l3build/l3build.lua
index e52056b..19a180e 100644
--- a/l3build/l3build.lua
+++ b/l3build/l3build.lua
@@ -433,10 +433,17 @@ function cp(glob, source, dest)
   for _,i in ipairs(filelist(source, glob)) do
     local source = source .. "/" .. i
     if os_windows then
-      errorlevel = os.execute(
-          "xcopy /y /e /i" .. unix_to_win(source)
-            .. " " .. unix_to_win(dest) .. " > nul"
+      if lfs.attributes(source)["mode"] == "directory" then
+        errorlevel = os.execute(
+          "xcopy /y /e /i " .. unix_to_win(source) .. " "
+             .. unix_to_win(dest .. "/" .. i) .. " > nul"
         )
+      else
+        errorlevel = os.execute(
+          "xcopy /y " .. unix_to_win(source) .. " "
+             .. unix_to_win(dest) .. " > nul"
+        )
+      end
     else
       errorlevel = os.execute("cp -rf " .. source .. " " .. dest)
     end

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list