[yocto] [eclipse-poky][branch:windows-build][PATCH 4/4] Customize Output processor for git clone command and fix message display

Ioana Grigoropol ioanax.grigoropol at intel.com
Thu May 23 07:38:35 PDT 2013


- in the particular case of creating a new bitbake project by cloning, the whole process is started from the context of the project wizard which is in charge of updating the monitor of the command
	- since the transfer is redirected to the RemoteHelper, somehow along the way the reference of the wizard monitor is lost and the messages are not displayed correctly
	- in order to fix this, the parsing is done locally inside the appropiate context & using a customization of the abstract OutputProcessor

Signed-off-by: Ioana Grigoropol <ioanax.grigoropol at intel.com>
---
 .../bc/remote/utils/YoctoRunnableWithProgress.java |   31 +++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoRunnableWithProgress.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoRunnableWithProgress.java
index 7eb7172..4005554 100644
--- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoRunnableWithProgress.java
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoRunnableWithProgress.java
@@ -80,7 +80,36 @@ public class YoctoRunnableWithProgress implements IRunnableWithProgress {
 			e.printStackTrace();
 		}
 	}
+	class YoctoRunnableOutputProcessor extends OutputProcessor{
 
+		public YoctoRunnableOutputProcessor(IProgressMonitor monitor,
+				IHostShell hostShell, CommandResponseHandler cmdHandler,
+				String task) {
+			super(monitor, hostShell, cmdHandler, task);
+		}
+		@Override
+		protected boolean isErrChStop(char ch) {
+			return (ch == '\n' || ch == '\r');
+		}
+
+		@Override
+		protected boolean isOutChStop(char ch) {
+			return (ch == '\n');
+		}
+
+		@Override
+		protected void processOutputBufferLine(char ch, String str) {
+			processBuffer.addOutputLine(str);
+		}
+
+		@Override
+		protected void processErrorBufferLine(char ch, String str) {
+			processBuffer.addOutputLine(str);
+			if (ch == '\r')
+				reportProgress(str);
+		}
+
+	}
 
 	class YoctoThread implements Runnable{
 		private IHost connection;
@@ -98,7 +127,7 @@ public class YoctoRunnableWithProgress implements IRunnableWithProgress {
 		public void run() {
 			try {
 				hostShell = RemoteHelper.runCommandRemote(this.connection, command, monitor);
-				command.setProcessBuffer(RemoteHelper.processOutput(monitor, hostShell, cmdHandler));
+				command.setProcessBuffer(new YoctoRunnableOutputProcessor(monitor, hostShell, cmdHandler, taskName).processOutput());
 			} catch (CoreException e) {
 				e.printStackTrace();
 			} catch (Exception e) {
-- 
1.7.9.5




More information about the yocto mailing list