ref: refs/heads/master
commit 25375302513edfbfec02f8fded43257aa4b90051
Author: Michael Andres
Date: Wed Sep 9 15:27:01 2009 +0200
Always print solver problems if solving failed.
---
VERSION | 2 +-
package/libzypp-testsuite-tools.changes | 6 ++++
solver/src/deptestomatic.cc | 47 ++++++++++++++++++------------
3 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/VERSION b/VERSION
index 985ee41..1250544 100644
--- a/VERSION
+++ b/VERSION
@@ -49,5 +49,5 @@ dnl ==================================================
m4_define([LIBZYPPTESTSUITE_MINOR], [2])
m4_define([LIBZYPPTESTSUITE_COMPATMINOR], [2])
dnl ==================================================
-m4_define([LIBZYPPTESTSUITE_PATCH], [10])
+m4_define([LIBZYPPTESTSUITE_PATCH], [11])
dnl ==================================================
diff --git a/package/libzypp-testsuite-tools.changes b/package/libzypp-testsuite-tools.changes
index 7da7be0..edf39af 100644
--- a/package/libzypp-testsuite-tools.changes
+++ b/package/libzypp-testsuite-tools.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Sep 9 15:25:35 CEST 2009 - ma@suse.de
+
+- Always print solver problems if solving failed.
+- version 4.2.11
+
+-------------------------------------------------------------------
Tue Aug 4 15:16:26 CEST 2009 - ma@suse.de
- Parse and process <upgradeRepo name=REPOALIAS/>
diff --git a/solver/src/deptestomatic.cc b/solver/src/deptestomatic.cc
index da3535b..ed2282b 100644
--- a/solver/src/deptestomatic.cc
+++ b/solver/src/deptestomatic.cc
@@ -186,6 +186,9 @@ string2kind (const std::string & str)
else if (str == "product") {
kind = ResKind::product;
}
+ else if (str == "srcpackage") {
+ kind = ResKind::srcpackage;
+ }
else {
cerr << "get_poolItem unknown kind '" << str << "'" << endl;
}
@@ -376,6 +379,28 @@ print_solution ( const ResPool & pool, bool instorder, bool mediaorder)
return;
}
+static void print_problems( zypp::solver::detail::Resolver_Ptr resolver )
+{
+ ResolverProblemList problems = resolver->problems();
+ problems.sort( compare_problems() );
+ RESULT << problems.size() << " problems found:" << endl;
+ for ( ResolverProblemList::iterator iter = problems.begin(); iter != problems.end(); ++iter )
+ {
+ ResolverProblem problem = **iter;
+ RESULT << "Problem:" << endl;
+ RESULT << problem.description() << endl;
+ RESULT << problem.details() << endl;
+
+ ProblemSolutionList solutions = problem.solutions();
+ for ( ProblemSolutionList::const_iterator iter = solutions.begin(); iter != solutions.end(); ++iter )
+ {
+ ProblemSolution solution = **iter;
+ RESULT << " Solution:" << endl;
+ RESULT << " " << solution.description() << endl;
+ RESULT << " " << solution.details() << endl;
+ }
+ }
+}
//---------------------------------------------------------------------------------------------------------------------
@@ -1020,25 +1045,8 @@ parse_xml_trial (XmlNode_Ptr node, ResPool & pool)
RESULT << "No problems so far" << endl;
}
else {
- ResolverProblemList problems = resolver->problems ();
- problems.sort(compare_problems());
- RESULT << problems.size() << " problems found:" << endl;
- for (ResolverProblemList::iterator iter = problems.begin(); iter != problems.end(); ++iter) {
- ResolverProblem problem = **iter;
- RESULT << "Problem:" << endl;
- RESULT << problem.description() << endl;
- RESULT << problem.details() << endl;
-
- ProblemSolutionList solutions = problem.solutions();
- for (ProblemSolutionList::const_iterator iter = solutions.begin();
- iter != solutions.end(); ++iter) {
- ProblemSolution solution = **iter;
- RESULT << " Solution:" << endl;
- RESULT << " " << solution.description() << endl;
- RESULT << " " << solution.details() << endl;
- }
- }
- }
+ print_problems( resolver );
+ }
} else if (node->equals ("takesolution")) {
string problemNrStr = node->getProp ("problem");
string solutionNrStr = node->getProp ("solution");
@@ -1388,6 +1396,7 @@ parse_xml_trial (XmlNode_Ptr node, ResPool & pool)
print_solution (pool, instorder, mediaorder);
} else {
RESULT << "No valid solution found." << endl;
+ print_problems( resolver );
}
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org