Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2009-03-06 15:07:00 -0500
committerSimon Kaegi2009-03-06 15:07:00 -0500
commitf2bb1f0d9f5d1772cd8c4188007a2e3f1ed6c4c2 (patch)
tree7b37ba5d8f92226a8176adb457930d008c90d819 /bundles/org.eclipse.equinox.p2.touchpoint.eclipse
parent277fd5efc3648a2556f6ee72e3696404e339ff3f (diff)
downloadrt.equinox.p2-f2bb1f0d9f5d1772cd8c4188007a2e3f1ed6c4c2.tar.gz
rt.equinox.p2-f2bb1f0d9f5d1772cd8c4188007a2e3f1ed6c4c2.tar.xz
rt.equinox.p2-f2bb1f0d9f5d1772cd8c4188007a2e3f1ed6c4c2.zip
Bug 262243 [eclipse] markStarted action should ignore OSGi fragment bundles
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java11
3 files changed, 21 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
index 81212bca7..cab713288 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
@@ -182,6 +182,11 @@ public class Util {
if (version == null)
return null;
bundleInfo.setVersion(version);
+
+ String fragmentHost = (String) headers.get(Constants.FRAGMENT_HOST);
+ if (fragmentHost != null)
+ bundleInfo.setFragment(true);
+
} catch (BundleException e) {
// unexpected
LogHelper.log(new Status(IStatus.ERROR, Activator.ID, e.getMessage(), e));
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java
index 52f8484a1..f963255a3 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/MarkStartedAction.java
@@ -50,6 +50,9 @@ public class MarkStartedAction extends ProvisioningAction {
if (bundleInfo == null)
return Util.createError(NLS.bind(Messages.failed_bundleinfo, iu));
+ if (bundleInfo.isFragment())
+ return Status.OK_STATUS;
+
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (bundles[i].equals(bundleInfo)) {
@@ -62,6 +65,10 @@ public class MarkStartedAction extends ProvisioningAction {
}
public IStatus undo(Map parameters) {
+ Boolean previousStarted = (Boolean) getMemento().get(ActionConstants.PARM_PREVIOUS_STARTED);
+ if (previousStarted == null)
+ return Status.OK_STATUS;
+
IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE);
Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR);
IInstallableUnit iu = (IInstallableUnit) parameters.get(EclipseTouchpoint.PARM_IU);
@@ -85,9 +92,7 @@ public class MarkStartedAction extends ProvisioningAction {
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (bundles[i].equals(bundleInfo)) {
- Boolean previousStarted = (Boolean) getMemento().get(ActionConstants.PARM_PREVIOUS_STARTED);
- if (previousStarted != null)
- bundles[i].setMarkedAsStarted(previousStarted.booleanValue());
+ bundles[i].setMarkedAsStarted(previousStarted.booleanValue());
break;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java
index 44cfc03c1..8a877802a 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/SetStartLevelAction.java
@@ -49,6 +49,9 @@ public class SetStartLevelAction extends ProvisioningAction {
if (bundleInfo == null)
return Util.createError(NLS.bind(Messages.failed_bundleinfo, iu));
+ if (bundleInfo.isFragment())
+ return Status.OK_STATUS;
+
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (bundles[i].equals(bundleInfo)) {
@@ -65,6 +68,10 @@ public class SetStartLevelAction extends ProvisioningAction {
}
public IStatus undo(Map parameters) {
+ Integer previousStartLevel = (Integer) getMemento().get(ActionConstants.PARM_PREVIOUS_START_LEVEL);
+ if (previousStartLevel == null)
+ return Status.OK_STATUS;
+
IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE);
Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR);
IInstallableUnit iu = (IInstallableUnit) parameters.get(EclipseTouchpoint.PARM_IU);
@@ -88,9 +95,7 @@ public class SetStartLevelAction extends ProvisioningAction {
BundleInfo[] bundles = manipulator.getConfigData().getBundles();
for (int i = 0; i < bundles.length; i++) {
if (bundles[i].equals(bundleInfo)) {
- Integer previousStartLevel = (Integer) getMemento().get(ActionConstants.PARM_PREVIOUS_START_LEVEL);
- if (previousStartLevel != null)
- bundles[i].setStartLevel(previousStartLevel.intValue());
+ bundles[i].setStartLevel(previousStartLevel.intValue());
break;
}
}

Back to the top