[yocto] [RFC refactor 02/21] Remove shell type from ShellSession constructor

Ioana Grigoropol ioanax.grigoropol at intel.com
Wed Jun 5 10:00:03 PDT 2013


- ShellSession is only used with shellType SHELL_BASH and thus the need to keep an extra argument is not needed
- When running commands using RemoteHelper, a shell is created per command. Its type is determined by using the IShellServiceSubSystem implementation from the target.

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol at intel.com>
---
 .../src/org/yocto/bc/bitbake/ShellSession.java     |   14 +-------------
 .../src/org/yocto/bc/ui/Activator.java             |    2 +-
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
index e8ed384..bc962f7 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/ShellSession.java
@@ -33,14 +33,6 @@ import org.yocto.remote.utils.YoctoCommand;
  *
  */
 public class ShellSession {
-	/**
-	 * Bash shell
-	 */
-	public static final int SHELL_TYPE_BASH = 1;
-	/**
-	 * sh shell
-	 */
-	public static final int SHELL_TYPE_SH = 2;
 	private volatile boolean interrupt = false;
 	/**
 	 * String used to isolate command execution
@@ -86,14 +78,10 @@ public class ShellSession {
 		this.projectInfo = projectInfo;
 	}
 
-	public ShellSession(ProjectInfo pInfo, int shellType, IHostFile root, String initCmd) throws IOException {
+	public ShellSession(ProjectInfo pInfo, IHostFile root, String initCmd) throws IOException {
 		this.projectInfo = pInfo;
 		this.root = root;
 		this.initCmd  = initCmd;
-		if (shellType == SHELL_TYPE_SH) {
-			shellPath = "/bin/sh";
-		}
-		shellPath  = "/bin/bash";
 
 		initializeShell(new NullProgressMonitor());
 	}
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/Activator.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/Activator.java
index dc2e858..c11b674 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/Activator.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/Activator.java
@@ -191,7 +191,7 @@ public class Activator extends AbstractUIPlugin {
 		
 		if (ss == null) {
 			IHostFile remoteHostFile = RemoteHelper.getRemoteHostFile(projInfo.getConnection(), absolutePath.getPath(), monitor);
-			ss = new ShellSession(projInfo, ShellSession.SHELL_TYPE_BASH, remoteHostFile, ProjectInfoHelper.getInitScriptPath(absolutePath));
+			ss = new ShellSession(projInfo, remoteHostFile, ProjectInfoHelper.getInitScriptPath(absolutePath));
 		}
 		
 		return ss;
-- 
1.7.9.5




More information about the yocto mailing list