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