### Eclipse Workspace Patch 1.0 #P org.eclipse.equinox.p2.director Index: src/org/eclipse/equinox/internal/p2/director/Messages.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java,v retrieving revision 1.22 diff -u -r1.22 Messages.java --- src/org/eclipse/equinox/internal/p2/director/Messages.java 19 Apr 2010 06:18:18 -0000 1.22 +++ src/org/eclipse/equinox/internal/p2/director/Messages.java 20 Apr 2010 20:45:03 -0000 @@ -30,6 +30,8 @@ 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; Index: src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java,v retrieving revision 1.118 diff -u -r1.118 SimplePlanner.java --- src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java 19 Apr 2010 06:18:18 -0000 1.118 +++ src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java 20 Apr 2010 20:45:03 -0000 @@ -17,6 +17,8 @@ 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.*; @@ -124,6 +126,22 @@ private IStatus convertExplanationToStatus(Set 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 forTargets = new ArrayList(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; Index: src/org/eclipse/equinox/internal/p2/director/messages.properties =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties,v retrieving revision 1.27 diff -u -r1.27 messages.properties --- src/org/eclipse/equinox/internal/p2/director/messages.properties 19 Apr 2010 06:18:18 -0000 1.27 +++ src/org/eclipse/equinox/internal/p2/director/messages.properties 20 Apr 2010 20:45:03 -0000 @@ -16,6 +16,8 @@ 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}