Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Messages.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/messages.properties10
3 files changed, 29 insertions, 22 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 ec8543a21..9e3d3538e 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
@@ -31,15 +31,22 @@ public class Messages extends NLS {
public static String Director_Cannot_Uninstall;
public static String Director_Already_Installed;
- public static String Director_Replace_Problems;
public static String Director_Revert_Problems;
public static String Director_Unexpected_IU;
public static String Director_Task_Installing;
public static String Director_Task_Uninstalling;
public static String Director_Task_Updating;
public static String Director_Task_Resolving_Dependencies;
- public static String Director_Resolving_Shared_Dependencies;
public static String Director_Unsatisfied_Dependencies;
public static String Director_Unsatisfied_Dependency;
+ public static String Planner_Error_saving_opbfile;
+ public static String Planner_Format_error;
+ public static String Planner_Missing_opb_file;
+ public static String Planner_Timeout;
+ public static String Planner_Problems_resolving_plan;
+ public static String Planner_Trivial_exception;
+ public static String Planner_Unsatisfiable_problem;
+ public static String Planner_Unsatisfied_dependency;
+
}
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 f3a8e6925..5c4b392f6 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
@@ -18,6 +18,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.CapabilityQuer
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.internal.provisional.p2.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.query.IQueryable;
+import org.eclipse.osgi.util.NLS;
import org.osgi.framework.InvalidSyntaxException;
import org.sat4j.pb.IPBSolver;
import org.sat4j.pb.SolverFactory;
@@ -64,7 +65,7 @@ public class Projector {
dependencies = new ArrayList();
selectionContext = context;
abstractVariables = new ArrayList();
- result = new MultiStatus(DirectorActivator.PI_DIRECTOR, IStatus.OK, "Problems resolving provisioning plan.", null);
+ result = new MultiStatus(DirectorActivator.PI_DIRECTOR, IStatus.OK, Messages.Planner_Problems_resolving_plan, null);
}
public void encode(IInstallableUnit[] ius, IProgressMonitor monitor) {
@@ -113,7 +114,7 @@ public class Projector {
}
List toSort = new ArrayList(conflictingEntries.values());
Collections.sort(toSort);
- double weight = Math.pow(10, toSort.size() - 1); //TODO We could start at toSort -1, but be careful
+ double weight = Math.pow(10, toSort.size() - 1);
int count = toSort.size();
for (Iterator iterator2 = toSort.iterator(); iterator2.hasNext();) {
count--;
@@ -182,7 +183,7 @@ public class Projector {
}
w.close();
} catch (IOException e) {
- e.printStackTrace();
+ result.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Error_saving_opbfile, problemFile), e));
}
}
@@ -213,12 +214,7 @@ public class Projector {
if (!isApplicable(reqs[i]))
continue;
- try {
- expandRequirement(iu, reqs[i]);
- } catch (IllegalStateException ise) {
- result.add(new Status(IStatus.WARNING, DirectorActivator.PI_DIRECTOR, ise.getMessage(), ise));
- createNegation(iu);
- }
+ expandRequirement(iu, reqs[i]);
}
addOptionalityExpression();
}
@@ -252,7 +248,6 @@ public class Projector {
if (countMatches > 0) {
dependencies.add(" -1 " + getNoOptionalVariable(iu) + " -1 " + abstractVar + " >= -1;"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
dependencies.add(expression + " >= 0;"); //$NON-NLS-1$
- // dependencies.add("-1" + getVariable(iu) + " 1 " + abstractVar + " >=0;"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
optionalityExpression += " 1 " + abstractVar; //$NON-NLS-1$
}
@@ -277,7 +272,8 @@ public class Projector {
if (countMatches > 0) {
dependencies.add(expression + " >= 0;"); //$NON-NLS-1$
} else {
- throw new IllegalStateException("No IU found to satisfy dependency of " + iu + " req " + req); //$NON-NLS-1$//$NON-NLS-2$
+ result.add(new Status(IStatus.WARNING, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Unsatisfied_dependency, iu, req)));
+ createNegation(iu);
}
}
@@ -326,7 +322,6 @@ public class Projector {
private String getVariable(IInstallableUnit iu) {
String v = (String) variables.get(iu);
if (v == null) {
- // v = new String("x" + varCount++ + "--" + iu.toString()); //$NON-NLS-1$
v = new String("x" + varCount++); //$NON-NLS-1$
variables.put(iu, v);
}
@@ -342,7 +337,6 @@ public class Projector {
private String getNoOptionalVariable(IInstallableUnit iu) {
String v = (String) noopVariables.get(iu);
if (v == null) {
- // v = new String("x" + varCount++ + "-noop-" + iu.toString()); //$NON-NLS-1$
v = new String("x" + varCount++); //$NON-NLS-1$
noopVariables.put(iu, v);
}
@@ -375,16 +369,16 @@ public class Projector {
} else {
if (DEBUG)
System.out.println("Unsatisfiable !"); //$NON-NLS-1$
- result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, 1, "No solution found because the problem is unsatisfiable", null)); //$NON-NLS-1$
+ result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Unsatisfiable_problem, problemFile)));
}
} catch (FileNotFoundException e) {
- result.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, 1, "Missing problem file:" + problemFile, e)); //$NON-NLS-1$
+ result.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Missing_opb_file, problemFile)));
} catch (ParseFormatException e) {
- result.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, 1, "Format error in problem file: " + problemFile, e)); //$NON-NLS-1$
+ result.add(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Format_error, problemFile)));
} catch (ContradictionException e) {
- result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, 1, "No solution found because of a trivial contradiction", e)); //$NON-NLS-1$
+ result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Trivial_exception, problemFile)));
} catch (TimeoutException e) {
- result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, 1, "No solution found.", e)); //$NON-NLS-1$
+ result.merge(new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Planner_Timeout, problemFile)));
} catch (Exception e) {
e.printStackTrace();
} finally {
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 a783e0518..cb65dd674 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
@@ -14,7 +14,6 @@ Director_Install_Problems=Problems occurred while installing.
Director_Cannot_Uninstall=Can not uninstall {0} because others IUs depend on it.
Director_Nothing_To_Uninstall=Nothing to uninstall.
Director_Already_Installed={0} is already installed.
-Director_Replace_Problems=Problems occurred while replacing.
Director_Revert_Problems=Problems occurred while reverting the install.
Director_Unexpected_IU=The installable unit {0} can not be used here.
Director_Task_Installing=Installing into {0}
@@ -26,4 +25,11 @@ Director_Unsatisfied_Dependencies=\
Cannot complete the install because some dependencies are not satisfiable
Director_Unsatisfied_Dependency=\
Unsatisfied dependency: {0}
-Director_Resolving_Shared_Dependencies=Resolving shared dependencies
+Planner_Error_saving_opbfile=Exception writing problem file in: {0}.
+Planner_Format_error=Format error in file: {0}.
+Planner_Missing_opb_file=Missing file: {0}.
+Planner_Timeout=The solver timed out on problem {0}.
+Planner_Problems_resolving_plan=Problems resolving provisioning plan.
+Planner_Trivial_exception=No solution found because of a trivial contradiction in {0}.
+Planner_Unsatisfiable_problem=No solution found because the problem in {0} is unsatisfiable.
+Planner_Unsatisfied_dependency=No IU found to satisfy dependency from {0} to {1}.

Back to the top