ref: refs/heads/SuSE-Code-11-Branch commit 66695be3faeab0b16083e56bdfe362721c45de52 Author: Michael Andres <ma@suse.de> Date: Mon May 4 16:02:59 2009 +0200 Improve problem report on broken systemCheck rule (bnc #475144) --- zypp/solver/detail/ProblemSolutionCombi.cc | 25 +++++++++++++++++++++++-- zypp/solver/detail/ProblemSolutionCombi.h | 12 ++++++++---- zypp/solver/detail/SATResolver.cc | 15 +++++++++++---- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/zypp/solver/detail/ProblemSolutionCombi.cc b/zypp/solver/detail/ProblemSolutionCombi.cc index 11b5ce8..5b9880c 100644 --- a/zypp/solver/detail/ProblemSolutionCombi.cc +++ b/zypp/solver/detail/ProblemSolutionCombi.cc @@ -58,7 +58,7 @@ void ProblemSolutionCombi::addSingleAction( Capability capability, const Transac addAction (new TransactionSolutionAction(capability, action)); actNumber++; } - + void ProblemSolutionCombi::addSingleAction( PoolItem item, const TransactionKind action) { addAction (new TransactionSolutionAction(item, action)); @@ -86,7 +86,28 @@ void ProblemSolutionCombi::addDescription( const std::string description) } // all other _details += "\n"; - _details += description; + _details += description; + } +} + +void ProblemSolutionCombi::addFrontDescription( const std::string & description ) +{ + if ( _description.size() == 0 + && _details.size() == 0) { + // first entry + _description = description; + } else { + if ( _description.size() > 0 + && _details.size() == 0) { + // second entry + _details = _description; + _description = _("Following actions will be done:"); + } + // all other + std::string tmp( _details ); + _details = description; + _details += "\n"; + _details += tmp; } } diff --git a/zypp/solver/detail/ProblemSolutionCombi.h b/zypp/solver/detail/ProblemSolutionCombi.h index 96be552..1e9875e 100644 --- a/zypp/solver/detail/ProblemSolutionCombi.h +++ b/zypp/solver/detail/ProblemSolutionCombi.h @@ -41,7 +41,7 @@ namespace zypp * Class representing one possible solution to one problem found during resolving * This problem solution is a combination of different actions. * e.G. install, delete, keep different resolvables. - * + * **/ class ProblemSolutionCombi : public ProblemSolution { @@ -66,18 +66,22 @@ namespace zypp /** * Add a single action of a SolverQueueItem */ - void addSingleAction( SolverQueueItem_Ptr item, const TransactionKind action); + void addSingleAction( SolverQueueItem_Ptr item, const TransactionKind action); /** * returns the number of actions */ int actionCount() { return actNumber;} - + /** - * Set description text + * Set description text (append) */ void addDescription( const std::string description); + /** + * Set description text (prepend) + */ + void addFrontDescription( const std::string & description ); }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc index 96e665e..a3dd941 100644 --- a/zypp/solver/detail/SATResolver.cc +++ b/zypp/solver/detail/SATResolver.cc @@ -1151,11 +1151,14 @@ SATResolver::problems () resolverProblem->setDetails( resolverProblem->description() + "\n" + resolverProblem->details() ); resolverProblem->setDescription(_("This request will break your system!")); description = _("ignore the warning of a broken system"); + description += string(" (requires:")+dep2str(pool, what)+")"; + MIL << description << endl; + problemSolution->addFrontDescription (description); } else { description = str::form (_("do not ask to install a solvable providing %s"), dep2str(pool, what)); + MIL << description << endl; + problemSolution->addDescription (description); } - MIL << description << endl; - problemSolution->addDescription (description); } break; case SOLVER_ERASE_SOLVABLE_PROVIDES: @@ -1169,11 +1172,15 @@ SATResolver::problems () resolverProblem->setDetails( resolverProblem->description() + "\n" + resolverProblem->details() ); resolverProblem->setDescription(_("This request will break your system!")); description = _("ignore the warning of a broken system"); + description += string(" (conflicts:")+dep2str(pool, what)+")"; + MIL << description << endl; + problemSolution->addFrontDescription (description); + } else { description = str::form (_("do not ask to delete all solvables providing %s"), dep2str(pool, what)); + MIL << description << endl; + problemSolution->addDescription (description); } - MIL << description << endl; - problemSolution->addDescription (description); } break; case SOLVER_INSTALL_SOLVABLE_UPDATE: -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org