提交 fbda18e3 编写于 作者: J jglick

[FIXED HUDSON-5296] Remote launcher failed to print any of the commands it was...

[FIXED HUDSON-5296] Remote launcher failed to print any of the commands it was running to the listener the way the local launcher does.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@25870 71c3de6d-444a-0410-be80-ed276b4c234a
上级 ea21b64f
......@@ -710,7 +710,7 @@ public abstract class Launcher {
final InputStream in = ps.stdin==null ? null : new RemoteInputStream(ps.stdin);
final String workDir = ps.pwd==null ? null : ps.pwd.getRemote();
return new RemoteProc(getChannel().callAsync(new RemoteLaunchCallable(ps.commands, ps.envs, in, out, err, workDir)));
return new RemoteProc(getChannel().callAsync(new RemoteLaunchCallable(ps.commands, ps.envs, in, out, err, workDir, listener)));
}
public Channel launchChannel(String[] cmd, OutputStream err, FilePath _workDir, Map<String,String> envOverrides) throws IOException, InterruptedException {
......@@ -758,18 +758,20 @@ public abstract class Launcher {
private final OutputStream out;
private final OutputStream err;
private final String workDir;
private final TaskListener listener;
RemoteLaunchCallable(List<String> cmd, String[] env, InputStream in, OutputStream out, OutputStream err, String workDir) {
RemoteLaunchCallable(List<String> cmd, String[] env, InputStream in, OutputStream out, OutputStream err, String workDir, TaskListener listener) {
this.cmd = new ArrayList<String>(cmd);
this.env = env;
this.in = in;
this.out = out;
this.err = err;
this.workDir = workDir;
this.listener = listener;
}
public Integer call() throws IOException {
Launcher.ProcStarter ps = new LocalLauncher(TaskListener.NULL).launch();
Launcher.ProcStarter ps = new LocalLauncher(listener).launch();
ps.cmds(cmd).envs(env).stdin(in).stdout(out).stderr(err);
if(workDir!=null) ps.pwd(workDir);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册