Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel LeBerre2010-04-22 20:13:59 +0000
committerDaniel LeBerre2010-04-22 20:13:59 +0000
commit195b4b0aaa025ad5c1406a7daa06e82e623a75be (patch)
tree166c713e3e1e50eb711768c1ccf1b432a11e0af7 /bundles
parent145eb4d702d4805bd3db267eab136a1ff5bf4cfb (diff)
downloadrt.equinox.p2-195b4b0aaa025ad5c1406a7daa06e82e623a75be.tar.gz
rt.equinox.p2-195b4b0aaa025ad5c1406a7daa06e82e623a75be.tar.xz
rt.equinox.p2-195b4b0aaa025ad5c1406a7daa06e82e623a75be.zip
Bug 307789 - Better message when installing target stuff into IDE
Patch from Thomas Watson
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties2
3 files changed, 22 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java
index 4b3e7f89b..72b9e11b5 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java
@@ -30,6 +30,8 @@ public class Messages extends NLS {
public static String Director_Task_Resolving_Dependencies;
public static String Director_Unsatisfied_Dependencies;
public static String Director_error_applying_configuration;
+ public static String Director_For_Target;
+ public static String Director_For_Target_Unselect_Required;
public static String Explanation_alreadyInstalled;
public static String Explanation_from;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
index d92964abf..7fea137f2 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
@@ -17,6 +17,8 @@ import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
+import org.eclipse.equinox.internal.p2.director.Explanation.MissingIU;
+import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.query.UpdateQuery;
import org.eclipse.equinox.internal.p2.rollback.FormerState;
import org.eclipse.equinox.internal.provisional.p2.director.*;
@@ -127,6 +129,22 @@ public class SimplePlanner implements IPlanner {
private IStatus convertExplanationToStatus(Set<Explanation> explanations) {
if (explanations == null)
return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_Unsatisfied_Dependencies);
+
+ // hack to create a useful message when a user installs something intended for a target platform into the IDE
+ ArrayList<IStatus> forTargets = new ArrayList<IStatus>(0);
+ for (Explanation next : explanations) {
+ if (next instanceof Explanation.MissingIU) {
+ Explanation.MissingIU missingIU = (MissingIU) next;
+ if (missingIU.req instanceof IRequiredCapability && "A.PDE.Target.Platform".equals(((IRequiredCapability) missingIU.req).getNamespace())) //$NON-NLS-1$
+ forTargets.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, missingIU.getUserReadableName(missingIU.iu)));
+ }
+ }
+ if (forTargets.size() > 0) {
+ // add a blurb about disabling 'include required software'. The following line could be removed if bug 309863 is fixed
+ forTargets.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Director_For_Target_Unselect_Required));
+ // return a multi status with all the IUs that require A.PDE.Target.Platform
+ return new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, forTargets.toArray(new IStatus[forTargets.size()]), Messages.Director_For_Target, null);
+ }
MultiStatus root = new MultiStatus(DirectorActivator.PI_DIRECTOR, 1, Messages.Director_Unsatisfied_Dependencies, null);
//try to find a more specific root message if possible
String specificMessage = null;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
index e52f3df51..f05266c81 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties
@@ -16,6 +16,8 @@ Director_Task_Resolving_Dependencies=Calculating requirements and dependencies.
Director_Unsatisfied_Dependencies=\
Cannot complete the install because some dependencies are not satisfiable
Director_error_applying_configuration=Unexpected failure applying configuration after for the installer plan execution.
+Director_For_Target = The following software cannot be installed because it is intended for use only in Plug-in Development Environment (PDE) target platforms. Please deselect these items and retry the operation.
+Director_For_Target_Unselect_Required = If provisioning a target platform then try disabling the option ''Include required software''
Explanation_alreadyInstalled=Software currently installed: {0}
Explanation_from=From: {0}

Back to the top