Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/c_1.0.0.jarbin0 -> 359 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/d_1.0.0.jarbin0 -> 374 bytes
6 files changed, 41 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
index 04056a5fb..7590cde43 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
@@ -20,7 +20,8 @@ Export-Package: org.eclipse.equinox.internal.p2.metadata;
org.eclipse.equinox.p2.ql,
org.eclipse.equinox.p2.ui,
org.eclipse.equinox.p2.touchpoint.eclipse,
- org.eclipse.equinox.p2.repository.tools",
+ org.eclipse.equinox.p2.repository.tools,
+ org.eclipse.equinox.p2.reconciler.dropins",
org.eclipse.equinox.internal.p2.metadata.expression;
x-friends:="org.eclipse.equinox.p2.artifact.repository,
org.eclipse.equinox.p2.directorywatcher,
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 067f8879c..131e3c8d1 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
@@ -8,7 +8,8 @@ Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.equinox.internal.p2.reconciler.dropins;x-internal:=true
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.equinox.p2.touchpoint.eclipse;bundle-version="1.0.0"
+ org.eclipse.equinox.p2.touchpoint.eclipse;bundle-version="1.0.0",
+ org.eclipse.equinox.p2.metadata
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
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/ProfileSynchronizer.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
index 001684fd9..337d41a86 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
@@ -10,6 +10,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.reconciler.dropins;
+import org.eclipse.equinox.p2.metadata.IRequirement;
+
import java.io.*;
import java.net.*;
import java.util.*;
@@ -18,6 +20,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.*;
import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.p2.extensionlocation.Constants;
+import org.eclipse.equinox.internal.p2.metadata.RequiredCapability;
import org.eclipse.equinox.internal.provisional.configurator.Configurator;
import org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
@@ -123,6 +126,15 @@ public class ProfileSynchronizer {
if (moveResult.getSeverity() == IStatus.ERROR || moveResult.getSeverity() == IStatus.CANCEL)
return moveResult;
+ if (!request.getRemovals().isEmpty()) {
+ Collection<IRequirement> requirements = new ArrayList<IRequirement>();
+ for (IInstallableUnit unit : request.getRemovals()) {
+ RequiredCapability req = new RequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, unit.getId(), new VersionRange(unit.getVersion(), true, unit.getVersion(), true), null, 0, 0, false, null);
+ requirements.add(req);
+ }
+ request.addExtraRequirements(requirements);
+ }
+
// now create a plan for the rest of the work and execute it
IStatus addRemoveResult = performAddRemove(request, context, monitor);
if (addRemoveResult.getSeverity() == IStatus.ERROR || addRemoveResult.getSeverity() == IStatus.CANCEL)
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java
index b43575d15..3b6a98fdf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/BasicTests.java
@@ -49,6 +49,7 @@ public class BasicTests extends AbstractReconcilerTest {
public static Test suite() {
TestSuite suite = new ReconcilerTestSuite();
suite.setName(BasicTests.class.getName());
+ suite.addTest(new BasicTests("testOneSessionInstallRemovalOfDependentFeatures"));
suite.addTest(new BasicTests("testNonSingleton"));
suite.addTest(new BasicTests("testSingleton"));
suite.addTest(new BasicTests("testDirectoryBasedPlugin"));
@@ -92,6 +93,7 @@ public class BasicTests extends AbstractReconcilerTest {
public void testMove1() {
// assert initial state
assertInitialized();
+ assertDoesNotExistInBundlesInfo("0.2", "a");
assertDoesNotExistInBundlesInfo("0.1", "b");
// add bundle to dropins
@@ -120,6 +122,29 @@ public class BasicTests extends AbstractReconcilerTest {
assertDoesNotExistInBundlesInfo("99.2", "b");
}
+ public void testOneSessionInstallRemovalOfDependentFeatures() {
+ assertInitialized();
+ assertDoesNotExistInBundlesInfo("0.1", "c");
+
+ // add bundle to dropins
+ File jar = getTestData("2.0", "testData/reconciler/installuninstall/c_1.0.0.jar");
+ add("2.1", "dropins", jar);
+
+ // reconcile
+ reconcile("3.0");
+ assertExistsInBundlesInfo("4.0", "c", "1.0.0", "c_1.0.0.jar");
+
+ //remove b, do not reconcile yet
+ remove("4.1", "dropins", jar.getName());
+
+ File jar2 = getTestData("4.2", "testData/reconciler/installuninstall/d_1.0.0.jar");
+ add("4.3", "dropins", jar2);
+
+ reconcile("5.0");
+ //b was removed. It should be uninstalled, too.
+ assertDoesNotExistInBundlesInfo("5.0", "c");
+ }
+
/*
* A depends on B
* - add B to dropins
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/c_1.0.0.jar b/bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/c_1.0.0.jar
new file mode 100644
index 000000000..ff8850e84
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/c_1.0.0.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/d_1.0.0.jar b/bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/d_1.0.0.jar
new file mode 100644
index 000000000..7a52425ce
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/d_1.0.0.jar
Binary files differ

Back to the top