ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1239121 - in /ant/core/trunk: WHATSNEW manual/Tasks/sshexec.html src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
Date Wed, 01 Feb 2012 13:19:45 GMT
Author: bodewig
Date: Wed Feb  1 13:19:44 2012
New Revision: 1239121

URL: http://svn.apache.org/viewvc?rev=1239121&view=rev
Log:
support for pseudo-terminals in sshexec.  PR 52554

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/manual/Tasks/sshexec.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1239121&r1=1239120&r2=1239121&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Feb  1 13:19:44 2012
@@ -183,6 +183,9 @@ Other changes:
 
  * Initial support for Java 8.
 
+ * <sshexec> can optionally create a pseudo terminal (like ssh -t)
+   Bugzilla Report 52554.
+
 Changes from Ant 1.8.1 TO Ant 1.8.2
 ===================================
 

Modified: ant/core/trunk/manual/Tasks/sshexec.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/Tasks/sshexec.html?rev=1239121&r1=1239120&r2=1239121&view=diff
==============================================================================
--- ant/core/trunk/manual/Tasks/sshexec.html (original)
+++ ant/core/trunk/manual/Tasks/sshexec.html Wed Feb  1 13:19:44 2012
@@ -179,6 +179,12 @@ and won't work with versions of jsch ear
       <em>since Ant 1.8.3</em></td>
     <td align="center" valign="top">No</td>
   </tr>
+  <tr>
+    <td valign="top">usepty</td>
+    <td valign="top">Whether to allocate a pseudo-tty (like ssh -t).
+      <em>since Ant 1.8.3</em></td>
+    <td align="center" valign="top">No, defaults to false</td>
+  </tr>
 </table>
 
 <h3>Examples</h3>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java?rev=1239121&r1=1239120&r2=1239121&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java Wed Feb
 1 13:19:44 2012
@@ -65,6 +65,7 @@ public class SSHExec extends SSHBase {
     private String inputString = null;   // like <exec>
     private File inputFile = null;   // like <exec>
     private boolean append = false;   // like <exec>
+    private boolean usePty = false;
 
     private Resource commandResource = null;
 
@@ -172,6 +173,14 @@ public class SSHExec extends SSHBase {
     }
 
     /**
+     * Whether a pseudo-tty should be allocated.
+     * @since Apache Ant 1.8.3
+     */
+    public void setUsePty(boolean b) {
+        usePty = b;
+    }
+
+    /**
      * Execute the command on the remote host.
      *
      * @exception BuildException  Most likely a network error or bad parameter.
@@ -290,6 +299,7 @@ public class SSHExec extends SSHBase {
             if (istream != null) {
                 channel.setInputStream(istream);
             }
+            channel.setPty(usePty);
             channel.connect();
             // wait for it to finish
             thread =



Mime
View raw message