You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2008/05/16 22:54:04 UTC

svn commit: r657204 - in /ant/ivy/core/trunk: doc/resolver/ssh.html src/java/org/apache/ivy/plugins/repository/ssh/Scp.java src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java

Author: maartenc
Date: Fri May 16 13:54:03 2008
New Revision: 657204

URL: http://svn.apache.org/viewvc?rev=657204&view=rev
Log:
Improved backwards compatibility with previous releases.

Modified:
    ant/ivy/core/trunk/doc/resolver/ssh.html
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java

Modified: ant/ivy/core/trunk/doc/resolver/ssh.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/resolver/ssh.html?rev=657204&r1=657203&r2=657204&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/resolver/ssh.html (original)
+++ ant/ivy/core/trunk/doc/resolver/ssh.html Fri May 16 13:54:03 2008
@@ -57,7 +57,7 @@
     <tr><td>port</td><td>The port to connect to</td>
         <td>No, defaults to 22</td></tr>
     <tr><td>publishPermissions</td><td>A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions of the published files. <span class="since">(since 2.0)</span>
-</td><td>No, defaults to 0600</td></tr>
+</td><td>No, defaults to scp standard behaviour</td></tr>
 </tbody>
 </table>
 <h1>Child elements</h1>

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java?rev=657204&r1=657203&r2=657204&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java Fri May 16 13:54:03 2008
@@ -300,7 +300,11 @@
         File f = new File(localFile);
         long remain = f.length();
 
-        String cline = "C" + mode + " " + remain + " " + remoteName + "\n";
+        String cMode = mode;
+        if (cMode == null) {
+            cMode = "0600";
+        }
+        String cline = "C" + cMode + " " + remain + " " + remoteName + "\n";
 
         os.write(cline.getBytes());
         os.flush();
@@ -492,7 +496,10 @@
             }
         }
 
-        String cmd = "scp -tp ";
+        String cmd = "scp -t ";
+        if (mode != null) {
+            cmd = cmd + "-p ";
+        }        
         if (remoteTargetDir != null && remoteTargetDir.length() > 0) {
             cmd = cmd + "-d " + remoteTargetDir;
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java?rev=657204&r1=657203&r2=657204&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java Fri May 16 13:54:03 2008
@@ -55,7 +55,7 @@
 
     private String createDirCommand = "mkdir";
     
-    private String publishPermissions = "0600";
+    private String publishPermissions = null;
 
     /**
      * create a new resource with lazy initializing