Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2010-04-21 01:00:53 +0000
committerPascal Rapicault2010-04-21 01:00:53 +0000
commit4433d1b65e73eff9f933c4b4ba19d266ab11589c (patch)
treefb2d9d2f5ae1079214150cee497d034422a858f8 /bundles/org.eclipse.equinox.p2.director
parent8d6ff75f692e7a90652156749a8f43e64816eadc (diff)
downloadrt.equinox.p2-4433d1b65e73eff9f933c4b4ba19d266ab11589c.tar.gz
rt.equinox.p2-4433d1b65e73eff9f933c4b4ba19d266ab11589c.tar.xz
rt.equinox.p2-4433d1b65e73eff9f933c4b4ba19d266ab11589c.zip
Bug 309890 - [planner] only invoke the explanation if the solution is unsat
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director')
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java5
2 files changed, 7 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
index dd6da9485..764200c64 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
@@ -158,6 +158,7 @@ public class Projector {
return !lastState.query(QueryUtil.createIUQuery(iu), null).isEmpty();
}
+ @SuppressWarnings("unchecked")
public void encode(IInstallableUnit entryPointIU, IInstallableUnit[] alreadyExistingRoots, IQueryable<IInstallableUnit> installedIUs, Collection<IInstallableUnit> newRoots, IProgressMonitor monitor) {
alreadyInstalledIUs = Arrays.asList(alreadyExistingRoots);
numberOfInstalledIUs = sizeOf(installedIUs);
@@ -1066,7 +1067,8 @@ public class Projector {
Tracing.debug("Unsatisfiable !"); //$NON-NLS-1$
Tracing.debug("Solver solution NOT found: " + (stop - start)); //$NON-NLS-1$
}
- result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Planner_Unsatisfiable_problem));
+ result = new MultiStatus(DirectorActivator.PI_DIRECTOR, SimplePlanner.UNSATISFIABLE, result.getChildren(), Messages.Planner_Unsatisfiable_problem, null);
+ result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, SimplePlanner.UNSATISFIABLE, Messages.Planner_Unsatisfiable_problem, null));
}
} catch (TimeoutException e) {
result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, Messages.Planner_Timeout));
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 bc34b2bb9..d92964abf 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
@@ -39,6 +39,9 @@ public class SimplePlanner implements IPlanner {
private static final String ID_IU_FOR_ACTIONS = "org.eclipse.equinox.p2.engine.actions.root"; //$NON-NLS-1$
private static final String EXPLANATION = "org.eclipse.equinox.p2.director.explain"; //$NON-NLS-1$
private static final String CONSIDER_METAREQUIREMENTS = "org.eclipse.equinox.p2.planner.resolveMetaRequirements"; //$NON-NLS-1$
+
+ static final int UNSATISFIABLE = 1; //status code indicating that the problem is not satisfiable
+
private final IProvisioningAgent agent;
private final IProfileRegistry profileRegistry;
private final IEngine engine;
@@ -312,7 +315,7 @@ public class SimplePlanner implements IPlanner {
}
if (s.getSeverity() == IStatus.ERROR) {
sub.setTaskName(Messages.Planner_NoSolution);
- if (context != null && !(context.getProperty(EXPLANATION) == null || Boolean.TRUE.toString().equalsIgnoreCase(context.getProperty(EXPLANATION)))) {
+ if (s.getCode() != UNSATISFIABLE || (context != null && !(context.getProperty(EXPLANATION) == null || Boolean.TRUE.toString().equalsIgnoreCase(context.getProperty(EXPLANATION))))) {
IProvisioningPlan plan = engine.createPlan(profile, context);
plan.setStatus(s);
return plan;

Back to the top