Blame SOURCES/eclipse-fix-dropins.patch

10f0d1
--- rt.equinox.p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java.orig	2014-03-24 10:49:00.000000000 +0000
10f0d1
+++ rt.equinox.p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java	2014-03-24 15:39:32.122246214 +0000
10f0d1
@@ -39,6 +39,7 @@
10f0d1
 
10f0d1
 public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
10f0d1
 
10f0d1
+	private static final String PROP_IGNORE_USER_CONFIGURATION = "eclipse.ignoreUserConfiguration"; //$NON-NLS-1$
10f0d1
 	private static final String SIMPLE_PROFILE_REGISTRY_INTERNAL = "_simpleProfileRegistry_internal_"; //$NON-NLS-1$
10f0d1
 	private static final String PROFILE_REGISTRY = "profile registry"; //$NON-NLS-1$
10f0d1
 	private static final String PROFILE_PROPERTIES_FILE = "state.properties"; //$NON-NLS-1$
10f0d1
@@ -266,6 +267,14 @@
10f0d1
 					//fragments support - remeber the property
10f0d1
 					internalSetProfileStateProperty(profile, profile.getTimestamp(), SIMPLE_PROFILE_REGISTRY_INTERNAL + getExtTimeStamp(), getExtTimeStamp());
10f0d1
 					agent.registerService(SERVICE_SHARED_INSTALL_NEW_TIMESTAMP, Long.toString(profile.getTimestamp()));
10f0d1
+
10f0d1
+					// this looks like a hack, but:
10f0d1
+					// (1) SimpleConfigurationImpl keeps returning master configuration as long as the property is set
10f0d1
+					// (2) SimpleConfigurationImpl sets the propery after it drops user configuration
10f0d1
+					// therefore dropins reconciliation can't load dropins plugins installed into user configuration
10f0d1
+					// after the user configuration has been dropped.
10f0d1
+					// It is necessary to unset this property.
10f0d1
+					//System.setProperty(PROP_IGNORE_USER_CONFIGURATION, "processed_and_unset"); //$NON-NLS-1$ //$NON-NLS-2$
10f0d1
 				} else {
10f0d1
 					//This is the first time we create the shared profile. Tag it as such and also remember the timestamp of the base
10f0d1
 					internalSetProfileStateProperty(profile, profile.getTimestamp(), IProfile.STATE_PROP_SHARED_INSTALL, IProfile.STATE_SHARED_INSTALL_VALUE_INITIAL);
10f0d1
@@ -299,6 +308,13 @@
10f0d1
 		if (agent.getService(SERVICE_SHARED_INSTALL_NEW_TIMESTAMP) != null)
10f0d1
 			return false;
10f0d1
 
10f0d1
+		// if the property is set by OSGI, and there is no new timestamp (because of the previous condition)
10f0d1
+		// ignore current profile. This will happen only once, because SERVICE_SHARED_INSTALL_NEW_TIMESTAMP
10f0d1
+		// is set during profile reset.
10f0d1
+		if ("true".equals(System.getProperty(PROP_IGNORE_USER_CONFIGURATION))) { //$NON-NLS-1$ //$NON-NLS-2$
10f0d1
+			System.setProperty(PROP_IGNORE_USER_CONFIGURATION, "processed_and_unset"); //$NON-NLS-1$ //$NON-NLS-2$
10f0d1
+			return true;
10f0d1
+		}
10f0d1
 		String baseTimestamp = getBaseTimestamp(profile.getProfileId());
10f0d1
 		String extTimestamp = getExtTimeStamp();
10f0d1
 		if (baseTimestamp == null) {
10f0d1
--- rt.equinox.p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
10f0d1
+++ rt.equinox.p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
10f0d1
@@ -570,6 +570,7 @@
10f0d1
 
10f0d1
 		// get all IUs from all our repos 
10f0d1
 		IQueryResult<IInstallableUnit> allIUs = getAllIUsFromRepos();
10f0d1
+		HashSet<IInstallableUnit> removedFromAllIUs = new HashSet<IInstallableUnit>();
10f0d1
 		for (Iterator<IInstallableUnit> iter = allIUs.iterator(); iter.hasNext();) {
10f0d1
 			final IInstallableUnit iu = iter.next();
10f0d1
 			IInstallableUnit existing = profileIUs.get(iu);
10f0d1
@@ -583,6 +584,7 @@
10f0d1
 				// (and more expensive) way to find this out is to do an IU profile property query.
10f0d1
 				if (two == null) {
10f0d1
 					// the IU is already installed so don't mark it as a dropin now - see bug 404619.
10f0d1
+					removedFromAllIUs.add(iu);
10f0d1
 					iter.remove();
10f0d1
 					continue;
10f0d1
 				}
10f0d1
@@ -625,7 +627,7 @@
10f0d1
 			}
10f0d1
 			// if the IU from the profile is in the "all available" list, then it is already added
10f0d1
 			// otherwise if it isn't in the repo then we have to remove it from the profile.
10f0d1
-			if (!all.contains(iu))
10f0d1
+			if (!all.contains(iu) && !removedFromAllIUs.contains(iu))
10f0d1
 				toRemove.add(iu);
10f0d1
 		}
10f0d1
 
10f0d1
@@ -799,8 +801,8 @@
10f0d1
 			IStatus installerPlanStatus = engine.perform(plan.getInstallerPlan(), phaseSet, monitor);
10f0d1
 			if (!installerPlanStatus.isOK())
10f0d1
 				return installerPlanStatus;
10f0d1
-
10f0d1
-			applyConfiguration(true);
10f0d1
+			if (isReconciliationApplicationRunning())
10f0d1
+				applyConfiguration(true);
10f0d1
 		}
10f0d1
 		return engine.perform(plan, phaseSet, monitor);
10f0d1
 	}
10f0d1
--- rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationWizard.java	2013-06-10 09:33:20.000000000 +0200
10f0d1
+++ rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationWizard.java	2013-06-11 15:44:28.654682088 +0200
10f0d1
@@ -145,7 +145,7 @@
10f0d1
 	}
10f0d1
 
10f0d1
 	public boolean performCancel() {
10f0d1
-		String[] buttons = new String[] {IDialogConstants.YES_LABEL, ProvUIMessages.MigrationPage_LATER_BUTTON, IDialogConstants.NO_LABEL};
10f0d1
+		String[] buttons = new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL};
10f0d1
 		MessageDialog dialog = new MessageDialog(getShell(), ProvUIMessages.MigrationPage_CONFIRMATION_TITLE, null, ProvUIMessages.MigrationPage_CONFIRMATION_DIALOG, MessageDialog.QUESTION, buttons, 2);
10f0d1
 
10f0d1
 		return rememberCancellationDecision(dialog.open());