Re: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap
Hi Jessica, I double checked and everything applies correctly on jzhang/windows-build. The option --keep-cr expects to receive a patch who's line terminator is carriage return, maybe in the process of saving applying the patches these line terminators get removed somehow? I can send you the patches on email as an attachment and you can download them as such and apply them onto windows-build branch in order to prevent any alterations to the files. Thanks, Ioana -Original Message- From: Zhang, Jessica Sent: Saturday, December 08, 2012 1:01 AM To: Grigoropol, IoanaX; yocto@yoctoproject.org Subject: RE: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Hi Ioana, Seems the patch won't apply even with the --keep-cr flag. This is against jzhang/windows-build branch. Can you double check? Thanks, Jessica git am --keep-cr ~/mbox/\[yocto\]_\[PATCH_7_8\]_convert_CRLF_line_terminators_to_CR_only.mbox Applying: convert CRLF line terminators to CR only /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:79: trailing whitespace. public FiniteStateWizard() { /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:81: trailing whitespace. /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:96: trailing whitespace. /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:101: trailing whitespace. super.createPageControls(pageContainer); /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:112: trailing whitespace. error: patch failed: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizard.java:1 error: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizard.java: patch does not apply error: patch failed: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizardPage.java:1 error: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizardPage.java: patch does not apply Patch failed at 0001 convert CRLF line terminators to CR only When you have resolved this problem run git am --resolved. If you would prefer to skip this patch, instead run git am --skip. To restore the original branch and stop patching run git am --abort. -Original Message- From: Grigoropol, IoanaX Sent: Thursday, December 06, 2012 6:02 AM To: Zhang, Jessica; yocto@yoctoproject.org Subject: RE: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Hi Jessica, There seems to be a bit of a mix-up on the new branch in the order of the patches were applied. Also, some files modified under Linux have CRLF ending instead of CR. Can you please rebase the branch (the new one or the old one) to commit ec4fcf7b478f59e190d9b9fe9b56e44971c4f66c, and then apply the set of 8 patches I resent to the mailing list ? Bare in mind that the patch before last (that converts from CRLF to CR) will not apply unless applied with option --keep-cr. Thanks, Ioana -Original Message- From: Zhang, Jessica Sent: Thursday, December 06, 2012 1:12 AM To: Grigoropol, IoanaX; yocto@yoctoproject.org Subject: RE: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Hi Ioana, None of your patches of today apply so there seems to be some rebase issue. Also, I've added headless build support changes for windows BC plugin, so can you rebase against jzhang/windows-build and resubmit the patch series? Thanks, Jessica -Original Message- From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On Behalf Of Ioana Grigoropol Sent: Wednesday, December 05, 2012 2:41 AM To: yocto@yoctoproject.org Subject: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Signed-off-by: Ioana Grigoropol ioanax.grigoro...@intel.com --- .../remote/utils/YoctoHostShellProcessAdapter.java | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java index 9ab43cf..2dba0a6 100644 --- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShe +++ llProcessAdapter.java @@ -34,6 +34,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private Semaphore sem; + public YoctoHostShellProcessAdapter(IHostShell hostShell, ProcessStreamBuffer processStreamBuffer, CommandResponseHandler commandResponseHandler) throws IOException { super(hostShell); this.processStreamBuffer = processStreamBuffer; @@ -41,7 +42,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { this.calculator = new GitCalculatePercentage(); this.sem = new Semaphore(1); this.command
Re: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap
Hi Ioana, Seems the patch won't apply even with the --keep-cr flag. This is against jzhang/windows-build branch. Can you double check? Thanks, Jessica git am --keep-cr ~/mbox/\[yocto\]_\[PATCH_7_8\]_convert_CRLF_line_terminators_to_CR_only.mbox Applying: convert CRLF line terminators to CR only /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:79: trailing whitespace. public FiniteStateWizard() { /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:81: trailing whitespace. /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:96: trailing whitespace. /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:101: trailing whitespace. super.createPageControls(pageContainer); /home/jzhang/eclipse-poky-windows/.git/rebase-apply/patch:112: trailing whitespace. error: patch failed: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizard.java:1 error: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizard.java: patch does not apply error: patch failed: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizardPage.java:1 error: plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/FiniteStateWizardPage.java: patch does not apply Patch failed at 0001 convert CRLF line terminators to CR only When you have resolved this problem run git am --resolved. If you would prefer to skip this patch, instead run git am --skip. To restore the original branch and stop patching run git am --abort. -Original Message- From: Grigoropol, IoanaX Sent: Thursday, December 06, 2012 6:02 AM To: Zhang, Jessica; yocto@yoctoproject.org Subject: RE: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Hi Jessica, There seems to be a bit of a mix-up on the new branch in the order of the patches were applied. Also, some files modified under Linux have CRLF ending instead of CR. Can you please rebase the branch (the new one or the old one) to commit ec4fcf7b478f59e190d9b9fe9b56e44971c4f66c, and then apply the set of 8 patches I resent to the mailing list ? Bare in mind that the patch before last (that converts from CRLF to CR) will not apply unless applied with option --keep-cr. Thanks, Ioana -Original Message- From: Zhang, Jessica Sent: Thursday, December 06, 2012 1:12 AM To: Grigoropol, IoanaX; yocto@yoctoproject.org Subject: RE: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Hi Ioana, None of your patches of today apply so there seems to be some rebase issue. Also, I've added headless build support changes for windows BC plugin, so can you rebase against jzhang/windows-build and resubmit the patch series? Thanks, Jessica -Original Message- From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On Behalf Of Ioana Grigoropol Sent: Wednesday, December 05, 2012 2:41 AM To: yocto@yoctoproject.org Subject: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Signed-off-by: Ioana Grigoropol ioanax.grigoro...@intel.com --- .../remote/utils/YoctoHostShellProcessAdapter.java | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java index 9ab43cf..2dba0a6 100644 --- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShe +++ llProcessAdapter.java @@ -34,6 +34,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private Semaphore sem; + public YoctoHostShellProcessAdapter(IHostShell hostShell, ProcessStreamBuffer processStreamBuffer, CommandResponseHandler commandResponseHandler) throws IOException { super(hostShell); this.processStreamBuffer = processStreamBuffer; @@ -41,7 +42,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { this.calculator = new GitCalculatePercentage(); this.sem = new Semaphore(1); this.command = ; - this.commandMonitors = new HashMap(); + this.commandMonitors = new HashMapString, IProgressMonitor(); } public String getLastCommand() { @@ -50,7 +51,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { public synchronized void setLastCommand(String lastCommand) { try { - // there are still some processes that might take a long time and if we do not wait for them, + // there are still some processes that might take a long time and if +we do not wait for them, // then the semaphore will not be released, because an interrupted exception will occur
Re: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap
Hi Jessica, Have you applied the three patches I have sent before these ones ? There are related to updating the progress bars in the Bitbake project recipe as well as regarding the validation of new project location and name ([PATCH 0/3] [eclipse-poky] Eclipse plugin on Windows - fixes for progress update on wizards input validation). Thanks, Ioana -Original Message- From: Zhang, Jessica Sent: Thursday, December 06, 2012 1:12 AM To: Grigoropol, IoanaX; yocto@yoctoproject.org Subject: RE: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Hi Ioana, None of your patches of today apply so there seems to be some rebase issue. Also, I've added headless build support changes for windows BC plugin, so can you rebase against jzhang/windows-build and resubmit the patch series? Thanks, Jessica -Original Message- From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On Behalf Of Ioana Grigoropol Sent: Wednesday, December 05, 2012 2:41 AM To: yocto@yoctoproject.org Subject: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Signed-off-by: Ioana Grigoropol ioanax.grigoro...@intel.com --- .../remote/utils/YoctoHostShellProcessAdapter.java | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java index 9ab43cf..2dba0a6 100644 --- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShe +++ llProcessAdapter.java @@ -34,6 +34,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private Semaphore sem; + public YoctoHostShellProcessAdapter(IHostShell hostShell, ProcessStreamBuffer processStreamBuffer, CommandResponseHandler commandResponseHandler) throws IOException { super(hostShell); this.processStreamBuffer = processStreamBuffer; @@ -41,7 +42,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { this.calculator = new GitCalculatePercentage(); this.sem = new Semaphore(1); this.command = ; - this.commandMonitors = new HashMap(); + this.commandMonitors = new HashMapString, IProgressMonitor(); } public String getLastCommand() { @@ -50,7 +51,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { public synchronized void setLastCommand(String lastCommand) { try { - // there are still some processes that might take a long time and if we do not wait for them, + // there are still some processes that might take a long time and if +we do not wait for them, // then the semaphore will not be released, because an interrupted exception will occur Thread.sleep(2000); isFinished = false; @@ -70,6 +71,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private class GitCalculatePercentage implements ICalculatePercentage { final Pattern pattern = Pattern.compile(^Receiving objects:\\s*(\\d+)%.*); + @Override public float calWorkloadDone(String info) throws IllegalArgumentException { Matcher m = pattern.matcher(info.trim()); if(m.matches()) { @@ -88,13 +90,16 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { } private void updateMonitor(final int work){ + Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (getMonitor() != null) { getMonitor().worked(work); } } + }); } @@ -124,7 +129,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { updateMonitor(delta); reportedWorkload += delta; } - + if (reportedWorkload == RemoteHelper.TOTALWORKLOAD) doneMonitor(); } @@ -152,8 +157,9 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { continue; } setCommandPrompt(value); + if (commandPrompt != null endChar != null command != null processStreamBuffer
Re: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap
Hi Jessica, There seems to be a bit of a mix-up on the new branch in the order of the patches were applied. Also, some files modified under Linux have CRLF ending instead of CR. Can you please rebase the branch (the new one or the old one) to commit ec4fcf7b478f59e190d9b9fe9b56e44971c4f66c, and then apply the set of 8 patches I resent to the mailing list ? Bare in mind that the patch before last (that converts from CRLF to CR) will not apply unless applied with option --keep-cr. Thanks, Ioana -Original Message- From: Zhang, Jessica Sent: Thursday, December 06, 2012 1:12 AM To: Grigoropol, IoanaX; yocto@yoctoproject.org Subject: RE: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Hi Ioana, None of your patches of today apply so there seems to be some rebase issue. Also, I've added headless build support changes for windows BC plugin, so can you rebase against jzhang/windows-build and resubmit the patch series? Thanks, Jessica -Original Message- From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On Behalf Of Ioana Grigoropol Sent: Wednesday, December 05, 2012 2:41 AM To: yocto@yoctoproject.org Subject: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Signed-off-by: Ioana Grigoropol ioanax.grigoro...@intel.com --- .../remote/utils/YoctoHostShellProcessAdapter.java | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java index 9ab43cf..2dba0a6 100644 --- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShe +++ llProcessAdapter.java @@ -34,6 +34,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private Semaphore sem; + public YoctoHostShellProcessAdapter(IHostShell hostShell, ProcessStreamBuffer processStreamBuffer, CommandResponseHandler commandResponseHandler) throws IOException { super(hostShell); this.processStreamBuffer = processStreamBuffer; @@ -41,7 +42,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { this.calculator = new GitCalculatePercentage(); this.sem = new Semaphore(1); this.command = ; - this.commandMonitors = new HashMap(); + this.commandMonitors = new HashMapString, IProgressMonitor(); } public String getLastCommand() { @@ -50,7 +51,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { public synchronized void setLastCommand(String lastCommand) { try { - // there are still some processes that might take a long time and if we do not wait for them, + // there are still some processes that might take a long time and if +we do not wait for them, // then the semaphore will not be released, because an interrupted exception will occur Thread.sleep(2000); isFinished = false; @@ -70,6 +71,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private class GitCalculatePercentage implements ICalculatePercentage { final Pattern pattern = Pattern.compile(^Receiving objects:\\s*(\\d+)%.*); + @Override public float calWorkloadDone(String info) throws IllegalArgumentException { Matcher m = pattern.matcher(info.trim()); if(m.matches()) { @@ -88,13 +90,16 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { } private void updateMonitor(final int work){ + Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (getMonitor() != null) { getMonitor().worked(work); } } + }); } @@ -124,7 +129,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { updateMonitor(delta); reportedWorkload += delta; } - + if (reportedWorkload == RemoteHelper.TOTALWORKLOAD) doneMonitor(); } @@ -152,8 +157,9 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { continue
[yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap
Signed-off-by: Ioana Grigoropol ioanax.grigoro...@intel.com --- .../remote/utils/YoctoHostShellProcessAdapter.java | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java index 9ab43cf..2dba0a6 100644 --- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java @@ -34,6 +34,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private Semaphore sem; + public YoctoHostShellProcessAdapter(IHostShell hostShell, ProcessStreamBuffer processStreamBuffer, CommandResponseHandler commandResponseHandler) throws IOException { super(hostShell); this.processStreamBuffer = processStreamBuffer; @@ -41,7 +42,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { this.calculator = new GitCalculatePercentage(); this.sem = new Semaphore(1); this.command = ; - this.commandMonitors = new HashMap(); + this.commandMonitors = new HashMapString, IProgressMonitor(); } public String getLastCommand() { @@ -50,7 +51,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { public synchronized void setLastCommand(String lastCommand) { try { - // there are still some processes that might take a long time and if we do not wait for them, + // there are still some processes that might take a long time and if we do not wait for them, // then the semaphore will not be released, because an interrupted exception will occur Thread.sleep(2000); isFinished = false; @@ -70,6 +71,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private class GitCalculatePercentage implements ICalculatePercentage { final Pattern pattern = Pattern.compile(^Receiving objects:\\s*(\\d+)%.*); + @Override public float calWorkloadDone(String info) throws IllegalArgumentException { Matcher m = pattern.matcher(info.trim()); if(m.matches()) { @@ -88,13 +90,16 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { } private void updateMonitor(final int work){ + Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (getMonitor() != null) { getMonitor().worked(work); } } + }); } @@ -124,7 +129,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { updateMonitor(delta); reportedWorkload += delta; } - + if (reportedWorkload == RemoteHelper.TOTALWORKLOAD) doneMonitor(); } @@ -152,8 +157,9 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { continue; } setCommandPrompt(value); + if (commandPrompt != null endChar != null command != null processStreamBuffer != null - value.startsWith(commandPrompt) value.endsWith(endChar) + value.startsWith(commandPrompt) value.endsWith(endChar) !value.endsWith(command) processStreamBuffer.getLastOutputLineContaining(command) != null /* waitForOutput*/) { sem.release(); isFinished = true; @@ -165,7 +171,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { this.commandResponseHandler.response(value, false); } } - + } private void setCommandPrompt(String value) { if (commandPrompt == null) { @@ -178,7 +184,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { commandPrompt = value.substring(0, end); endChar = PROMPT_USER_CH; } -
Re: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap
Hi Ioana, None of your patches of today apply so there seems to be some rebase issue. Also, I've added headless build support changes for windows BC plugin, so can you rebase against jzhang/windows-build and resubmit the patch series? Thanks, Jessica -Original Message- From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On Behalf Of Ioana Grigoropol Sent: Wednesday, December 05, 2012 2:41 AM To: yocto@yoctoproject.org Subject: [yocto] [PATCH] Fix incompatibility with jre1.6 support for typed HashMap Signed-off-by: Ioana Grigoropol ioanax.grigoro...@intel.com --- .../remote/utils/YoctoHostShellProcessAdapter.java | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java index 9ab43cf..2dba0a6 100644 --- a/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShellProcessAdapter.java +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/remote/utils/YoctoHostShe +++ llProcessAdapter.java @@ -34,6 +34,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private Semaphore sem; + public YoctoHostShellProcessAdapter(IHostShell hostShell, ProcessStreamBuffer processStreamBuffer, CommandResponseHandler commandResponseHandler) throws IOException { super(hostShell); this.processStreamBuffer = processStreamBuffer; @@ -41,7 +42,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { this.calculator = new GitCalculatePercentage(); this.sem = new Semaphore(1); this.command = ; - this.commandMonitors = new HashMap(); + this.commandMonitors = new HashMapString, IProgressMonitor(); } public String getLastCommand() { @@ -50,7 +51,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { public synchronized void setLastCommand(String lastCommand) { try { - // there are still some processes that might take a long time and if we do not wait for them, + // there are still some processes that might take a long time and if +we do not wait for them, // then the semaphore will not be released, because an interrupted exception will occur Thread.sleep(2000); isFinished = false; @@ -70,6 +71,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { private class GitCalculatePercentage implements ICalculatePercentage { final Pattern pattern = Pattern.compile(^Receiving objects:\\s*(\\d+)%.*); + @Override public float calWorkloadDone(String info) throws IllegalArgumentException { Matcher m = pattern.matcher(info.trim()); if(m.matches()) { @@ -88,13 +90,16 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { } private void updateMonitor(final int work){ + Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (getMonitor() != null) { getMonitor().worked(work); } } + }); } @@ -124,7 +129,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { updateMonitor(delta); reportedWorkload += delta; } - + if (reportedWorkload == RemoteHelper.TOTALWORKLOAD) doneMonitor(); } @@ -152,8 +157,9 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter { continue; } setCommandPrompt(value); + if (commandPrompt != null endChar != null command != null processStreamBuffer != null - value.startsWith(commandPrompt) value.endsWith(endChar) + value.startsWith(commandPrompt) value.endsWith(endChar) !value.endsWith(command) processStreamBuffer.getLastOutputLineContaining(command) != null /* waitForOutput*/) { sem.release(); isFinished = true; @@ -165,7 +171,7 @@ public class YoctoHostShellProcessAdapter extends HostShellProcessAdapter