[Esbox-commits] r1911 - branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core

eswartz at garage.maemo.org eswartz at garage.maemo.org
Fri Jul 31 17:45:52 EEST 2009


Author: eswartz
Date: 2009-07-31 17:45:46 +0300 (Fri, 31 Jul 2009)
New Revision: 1911

Modified:
   branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
Log:
Fix unexpected behavior of cancelling when unmount fails when trying to shut down SB1; use error status instead

Modified: branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java	2009-07-30 18:27:32 UTC (rev 1910)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java	2009-07-31 14:45:46 UTC (rev 1911)
@@ -22,7 +22,6 @@
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.*;
 import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
-import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
 import org.maemo.esbox.internal.api.scratchbox.core.commands.ICommand;
 import org.maemo.esbox.internal.api.scratchbox.core.commands.ICommandAbstractor;
 import org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDK;
@@ -875,9 +874,10 @@
 					new IStreamMonitor[] { unmountErrorSniffer },
 					multiStatus, monitor);
 			if (unmountErrorSniffer.unmountFailed()) {
-				reporter.log(Activator.createErrorStatus("Unmounting appeared to fail.  It's not safe to continue.",
-						null));
-				monitor.setCanceled(true);
+				IStatus status = Activator.createErrorStatus("Unmounting appeared to fail.  It's not safe to continue.",
+						null);
+				reporter.log(status);
+				multiStatus.add(status);
 			}
 			if (monitor.isCanceled())
 				return Status.CANCEL_STATUS;
@@ -950,7 +950,7 @@
 		
 		IProgressReporter reporter = new StringBuilderProgressReporter(true);
 		
-		IStatus status = shutdown(getMachine(), getInstallRoot(), monitor, reporter);
+		IStatus status = shutdown(getMachine(), getInstallRoot(), new SubProgressMonitor(monitor, 1), reporter);
 	
 		if (!monitor.isCanceled() && status.matches(IStatus.ERROR))
 			throw new MicaException("Problems during shutdown of " + getDisplayName(), 
@@ -1002,7 +1002,7 @@
 							forceShutdown(monitor);
 							return Status.OK_STATUS;
 						} catch (MicaException e) {
-							return Activator.createErrorStatus("Failed to restart " + getDisplayName(), e);
+							return Activator.createErrorStatus("Failed to shutdown " + getDisplayName(), e);
 						}
 					}
 					



More information about the Esbox-commits mailing list