summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2012-07-10 07:35:24 (EDT)
committerPascal Rapicault2012-07-10 07:35:24 (EDT)
commitfd760bcb9b71263cce6970964de85a434a5a4d50 (patch)
tree8d704bc820732a9392e3af46323c133727b64839
parente066cc8029207bcba85498aae0c80d90030955fe (diff)
downloadrt.equinox.p2-fd760bcb9b71263cce6970964de85a434a5a4d50.zip
rt.equinox.p2-fd760bcb9b71263cce6970964de85a434a5a4d50.tar.gz
rt.equinox.p2-fd760bcb9b71263cce6970964de85a434a5a4d50.tar.bz2
Bug 251167 - [reconciler] Deleted dropins content remains in profilev20120710-113524
-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 04056a5..7590cde 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 067f887..131e3c8 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 001684f..337d41a 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 b43575d..3b6a98f 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 0000000..ff8850e
--- /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 0000000..7a52425
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/reconciler/installuninstall/d_1.0.0.jar
Binary files differ