diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler')
3 files changed, 22 insertions, 4 deletions
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; |