Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2009-03-07 15:58:16 +0000
committerDJ Houghton2009-03-07 15:58:16 +0000
commit676798d3e464d74bff2868224c0d2eda91101fc3 (patch)
treef64c9f4f5903502ea79f537b9ce37eb775702abf
parentbb7c847b01aee3e11cedb2f824ef93eb60ca3e6d (diff)
downloadrt.equinox.p2-676798d3e464d74bff2868224c0d2eda91101fc3.tar.gz
rt.equinox.p2-676798d3e464d74bff2868224c0d2eda91101fc3.tar.xz
rt.equinox.p2-676798d3e464d74bff2868224c0d2eda91101fc3.zip
Bug 267141 - [reconciler] Reconciliation application could return error code when the operation aborts
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Application.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java4
4 files changed, 23 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF
index ffe3f6c5f..cddea5581 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-SymbolicName: org.eclipse.equinox.p2.reconciler.dropins;singleton:=true
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Bundle-Version: 1.0.4.qualifier
+Bundle-Version: 1.0.5.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.reconciler.dropins.Activator
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
CDC-1.1/Foundation-1.1
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
index 6c6ce1f4b..1d61916c2 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2007, 2009 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -34,6 +34,7 @@ import org.osgi.service.packageadmin.PackageAdmin;
public class Activator implements BundleActivator {
+ static final String PROP_APPLICATION_STATUS = "org.eclipse.equinox.p2.reconciler.application.status"; //$NON-NLS-1$
public static final String ID = "org.eclipse.equinox.p2.reconciler.dropins"; //$NON-NLS-1$
private static final String DROPINS_DIRECTORY = "org.eclipse.equinox.p2.reconciler.dropins.directory"; //$NON-NLS-1$
private static final String DROPINS = "dropins"; //$NON-NLS-1$
@@ -400,6 +401,9 @@ public class Activator implements BundleActivator {
// create the profile synchronizer on all available repositories
ProfileSynchronizer synchronizer = new ProfileSynchronizer(profile, repositories);
IStatus result = synchronizer.synchronize(monitor);
+ if (ProfileSynchronizer.isReconciliationApplicationRunning()) {
+ System.getProperties().put(PROP_APPLICATION_STATUS, result);
+ }
if (!result.isOK() && !(result.getSeverity() == IStatus.CANCEL))
LogHelper.log(result);
}
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Application.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Application.java
index ddab617c2..c514d2843 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Application.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Application.java
@@ -1,12 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial implementation and ideas
+ ******************************************************************************/
package org.eclipse.equinox.internal.p2.reconciler.dropins;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
public class Application implements IApplication {
public Object start(IApplicationContext context) throws Exception {
- return null;
+ Object obj = System.getProperties().get(Activator.PROP_APPLICATION_STATUS);
+ // if we have a non-OK status return "unlucky" 13, otherwise return the OK return code
+ if (obj != null && (obj instanceof IStatus) && !((IStatus) obj).isOK())
+ return new Integer(13);
+ return IApplication.EXIT_OK;
}
public void stop() {
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
index efd593361..9fc39a191 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2007, 2009 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -396,7 +396,7 @@ public class ProfileSynchronizer {
}
}
- private boolean isReconciliationApplicationRunning() {
+ static boolean isReconciliationApplicationRunning() {
EnvironmentInfo info = (EnvironmentInfo) ServiceHelper.getService(Activator.getContext(), EnvironmentInfo.class.getName());
if (info == null)
return false;

Back to the top