Blame SOURCES/eclipse-fix-dropins.patch

dc388e
--- 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
dc388e
+++ 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
dc388e
@@ -44,6 +44,7 @@
dc388e
 
dc388e
 public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
dc388e
 
dc388e
+	private static final String PROP_IGNORE_USER_CONFIGURATION = "eclipse.ignoreUserConfiguration"; //$NON-NLS-1$
dc388e
 	private static final String SIMPLE_PROFILE_REGISTRY_INTERNAL = "_simpleProfileRegistry_internal_"; //$NON-NLS-1$
dc388e
 	private static final String PROFILE_REGISTRY = "profile registry"; //$NON-NLS-1$
dc388e
 	private static final String PROFILE_PROPERTIES_FILE = "state.properties"; //$NON-NLS-1$
dc388e
@@ -274,6 +275,14 @@
dc388e
 					//fragments support - remeber the property
dc388e
 					internalSetProfileStateProperty(profile, profile.getTimestamp(), SIMPLE_PROFILE_REGISTRY_INTERNAL + getExtTimeStamp(), getExtTimeStamp());
dc388e
 					agent.registerService(SERVICE_SHARED_INSTALL_NEW_TIMESTAMP, Long.toString(profile.getTimestamp()));
dc388e
+
dc388e
+					// this looks like a hack, but:
dc388e
+					// (1) SimpleConfigurationImpl keeps returning master configuration as long as the property is set
dc388e
+					// (2) SimpleConfigurationImpl sets the propery after it drops user configuration
dc388e
+					// therefore dropins reconciliation can't load dropins plugins installed into user configuration
dc388e
+					// after the user configuration has been dropped.
dc388e
+					// It is necessary to unset this property.
dc388e
+					//System.setProperty(PROP_IGNORE_USER_CONFIGURATION, "processed_and_unset"); //$NON-NLS-1$ //$NON-NLS-2$
dc388e
 				} else {
dc388e
 					//This is the first time we create the shared profile. Tag it as such and also remember the timestamp of the base
dc388e
 					internalSetProfileStateProperty(profile, profile.getTimestamp(), IProfile.STATE_PROP_SHARED_INSTALL, IProfile.STATE_SHARED_INSTALL_VALUE_INITIAL);
dc388e
@@ -307,6 +316,13 @@
dc388e
 		if (agent.getService(SERVICE_SHARED_INSTALL_NEW_TIMESTAMP) != null)
dc388e
 			return false;
dc388e
 
dc388e
+		// if the property is set by OSGI, and there is no new timestamp (because of the previous condition)
dc388e
+		// ignore current profile. This will happen only once, because SERVICE_SHARED_INSTALL_NEW_TIMESTAMP
dc388e
+		// is set during profile reset.
dc388e
+		if ("true".equals(System.getProperty(PROP_IGNORE_USER_CONFIGURATION))) { //$NON-NLS-1$ //$NON-NLS-2$
dc388e
+			System.setProperty(PROP_IGNORE_USER_CONFIGURATION, "processed_and_unset"); //$NON-NLS-1$ //$NON-NLS-2$
dc388e
+			return true;
dc388e
+		}
dc388e
 		String baseTimestamp = getBaseTimestamp(profile.getProfileId());
dc388e
 		String extTimestamp = getExtTimeStamp();
dc388e
 		if (baseTimestamp == null) {
dc388e
--- rt.equinox.p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java.orig	2019-09-13 14:45:20.806922186 +0100
dc388e
+++ rt.equinox.p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java	2019-09-13 14:46:41.124689025 +0100
dc388e
@@ -560,6 +560,7 @@
dc388e
 
dc388e
 		// get all IUs from all our repos
dc388e
 		IQueryResult<IInstallableUnit> allIUs = getAllIUsFromRepos();
dc388e
+		HashSet<IInstallableUnit> removedFromAllIUs = new HashSet<IInstallableUnit>();
dc388e
 		for (Iterator<IInstallableUnit> iter = allIUs.iterator(); iter.hasNext();) {
dc388e
 			final IInstallableUnit iu = iter.next();
dc388e
 			IInstallableUnit existing = profileIUs.get(iu);
dc388e
@@ -573,6 +574,7 @@
dc388e
 				// (and more expensive) way to find this out is to do an IU profile property query.
dc388e
 				if (two == null) {
dc388e
 					// the IU is already installed so don't mark it as a dropin now - see bug 404619.
dc388e
+					removedFromAllIUs.add(iu);
dc388e
 					iter.remove();
dc388e
 					continue;
dc388e
 				}
dc388e
@@ -614,7 +616,7 @@
dc388e
 			}
dc388e
 			// if the IU from the profile is in the "all available" list, then it is already added
dc388e
 			// otherwise if it isn't in the repo then we have to remove it from the profile.
dc388e
-			if (!all.contains(iu))
dc388e
+			if (!all.contains(iu) && !removedFromAllIUs.contains(iu))
dc388e
 				toRemove.add(iu);
dc388e
 		}
dc388e
 
dc388e
@@ -787,7 +789,8 @@
dc388e
 			if (!installerPlanStatus.isOK())
dc388e
 				return installerPlanStatus;
dc388e
 
dc388e
-			applyConfiguration(true);
dc388e
+			if (isReconciliationApplicationRunning())
dc388e
+				applyConfiguration(true);
dc388e
 		}
dc388e
 		return engine.perform(plan, phaseSet, monitor);
dc388e
 	}
dc388e
--- rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationWizard.java.orig	2019-09-13 14:42:54.512346840 +0100
dc388e
+++ rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/MigrationWizard.java	2019-09-13 14:43:12.003296065 +0100
dc388e
@@ -158,8 +158,7 @@
dc388e
 
dc388e
 	@Override
dc388e
 	public boolean performCancel() {
dc388e
-		String[] buttons = new String[] { IDialogConstants.YES_LABEL, ProvUIMessages.MigrationPage_LATER_BUTTON,
dc388e
-				IDialogConstants.NO_LABEL };
dc388e
+		String[] buttons = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL };
dc388e
 		MessageDialog dialog = new MessageDialog(getShell(), ProvUIMessages.MigrationPage_CONFIRMATION_TITLE, null,
dc388e
 				ProvUIMessages.MigrationPage_CONFIRMATION_DIALOG, MessageDialog.QUESTION, buttons, 2);
dc388e