[latex3-commits] [git/LaTeX3-latex3-latex3] master: \sys_shell_ren:nnn needs an auxiliary (938c5f9)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Jul 26 23:42:48 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/938c5f999cec3d6babf6a75503dc43bd3255a4e7

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

commit 938c5f999cec3d6babf6a75503dc43bd3255a4e7
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jul 26 22:42:48 2018 +0100

    \sys_shell_ren:nnn needs an auxiliary


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

938c5f999cec3d6babf6a75503dc43bd3255a4e7
 l3kernel/l3candidates.dtx               |   28 ++++++++++++++++++++--------
 l3kernel/testfiles/m3expl001.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl001.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl001.tlg        |    1 +
 l3kernel/testfiles/m3expl001.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl003.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl003.tlg        |    1 +
 l3kernel/testfiles/m3expl003.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |    1 +
 11 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 68c3cbe..74ece29 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -3128,6 +3128,7 @@
 % \end{macro}
 %
 % \begin{macro}{\sys_shell_ren:nnn}
+% \begin{macro}{\@@_shell_ren:nnn}
 %   The differences in syntax between Unix and Windows mean that it's not easy
 %   to provide |mv|: instead we go with |ren|-like syntax but with arguments
 %   set up to work with Unix too.
@@ -3136,20 +3137,31 @@
   {
     \sys_if_shell_unrestricted:T
       {
-        \sys_shell_now:x
+        \exp_not:N \tl_if_blank:n {#1}
+          { \exp_not:N \@@_shell_ren:nnn { . } }
+          { \exp_not:N \@@_shell_ren:nnn {#1} }
+            {#2} {#3}
+      }
+  }
+\cs_new_protected:Npx \@@_shell_ren:nnn #1#2#3
+  {
+    \sys_shell_now:x
+      {
+         \sys_if_platform_unix:T
           { 
-            \sys_if_platform_unix:T
-              { mv~-f~ \tl_to_str:n { #1 / #2 } ~ \tl_to_str:n { #1 / #3 } }
-            \sys_if_platform_windows:T
-              {
-                ren~ \exp_not:N \@@_path_to_win:n { #1 / #2 } ~
-                  \exp_not:N \tl_to_str:n {#3}
-              }
+            mv~-f~ \exp_not:N \tl_to_str:n { #1 / #2 } ~
+              \exp_not:N \tl_to_str:n { #1 / #3 }
+          }
+        \sys_if_platform_windows:T
+          {
+            ren~ \exp_not:N \@@_path_to_win:n { #1 / #2 } ~
+              \exp_not:N \tl_to_str:n {#3}
           }
       }
   }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\sys_shell_rm:n}
 %   Deletion: obviously a big health warning here!
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 90701c4..5c43488 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5856,6 +5856,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index d6b43f2..fc95b1e 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5890,6 +5890,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 885e024..9ac8da9 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5890,6 +5890,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index a2b4e5c..ab2b576 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5887,6 +5887,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 385185b..7121630 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5860,6 +5860,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 90701c4..5c43488 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5856,6 +5856,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index d6b43f2..fc95b1e 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5890,6 +5890,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 885e024..9ac8da9 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5890,6 +5890,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index a2b4e5c..ab2b576 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5887,6 +5887,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 385185b..7121630 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5860,6 +5860,7 @@ Defining \__sys_path_to_win:N on line ...
 Defining \sys_shell_cp:nn on line ...
 Defining \sys_shell_mkdir:n on line ...
 Defining \sys_shell_ren:nnn on line ...
+Defining \__sys_shell_ren:nnn on line ...
 Defining \sys_shell_rm:n on line ...
 Defining \sys_shell_rmdir:n on line ...
 Defining \tl_if_single_token_p:n on line ...





More information about the latex3-commits mailing list