Author: schubi2
Date: Thu Aug 2 15:41:00 2007
New Revision: 6392
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6392&view=rev
Log:
improved layout for detail description in the error messages
Modified:
trunk/libzypp/zypp/solver/detail/Resolver_problems.cc
Modified: trunk/libzypp/zypp/solver/detail/Resolver_problems.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver_problems.cc?rev=6392&r1=6391&r2=6392&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver_problems.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver_problems.cc Thu Aug 2 15:41:00 2007
@@ -70,6 +70,7 @@
typedef multimap ConflictMap;
#define MAXPROBLEMS 20
+#define TAB " "
// match template over ItemCapabilityMap
template
@@ -231,38 +232,36 @@
std::string logAdditionalInfo ( const ProblemMap &additionalInfo, const PoolItem_Ref item)
{
- string infoStr = "\n";
+ string infoStr = "";
for (ProblemMap::const_iterator iter = additionalInfo.find(item); iter != additionalInfo.end();) {
ResolverInfo_Ptr info = iter->second;
PoolItem_Ref iterItem = iter->first;
if (iter == additionalInfo.find(item)) {
string who = ResolverInfo::toString( item );
- infoStr = "\n\n" + who + "\n";
- for (unsigned int i = 1; i <= who.length(); i++) infoStr += "=";
- infoStr += "\n\n";
+ infoStr = "=== " + who + " ===\n";
ResStatus status = iterItem.status();
if (status.isToBeUninstalled()) {
if (status.isByUser())
// Translator: all.%s = name of package,patch,...
- infoStr += str::form (_("%s will be deleted by the user.\n"),
+ infoStr += TAB + str::form (_("%s will be deleted by the user.\n"),
who.c_str());
if (status.isByApplHigh()
|| status.isByApplLow())
// Translator: all.%s = name of package,patch,...
- infoStr += str::form (_("%s will be deleted by another application. (ApplLow/ApplHigh)\n"),
+ infoStr += TAB + str::form (_("%s will be deleted by another application. (ApplLow/ApplHigh)\n"),
who.c_str());
}
if (status.isToBeInstalled()) {
if (status.isByUser())
// Translator: all.%s = name of package,patch,...
- infoStr += str::form (_("%s will be installed by the user.\n"),
+ infoStr += TAB + str::form (_("%s will be installed by the user.\n"),
who.c_str());
if (status.isByApplHigh()
|| status.isByApplLow())
// Translator: all.%s = name of package,patch,...
- infoStr += str::form (_("%s will be installed by another application. (ApplLow/ApplHigh)\n"),
+ infoStr += TAB + str::form (_("%s will be installed by another application. (ApplLow/ApplHigh)\n"),
who.c_str());
}
}
@@ -274,7 +273,7 @@
&& info->type() != RESOLVER_INFO_TYPE_SKIPPING
&& info->type() != RESOLVER_INFO_TYPE_UNINSTALLABLE
&& info->type() != RESOLVER_INFO_TYPE_CONFLICT_UNINSTALLABLE) {
- infoStr += info->message();
+ infoStr += TAB +info->message();
infoStr += "\n";
}
iter++;
@@ -371,7 +370,7 @@
// TranslatorExplanation %s = name of package, patch, selection ...
what = str::form (_("%s conflicts with %s"), who.c_str(), conflicts_with->itemsToString(true).c_str());
- details = str::form (_("%s conflicts with:\n%s"), who.c_str(), conflicts_with->itemsToString(false).c_str());
+ details = str::form (_("%s conflicts with:\n%s"), who.c_str(), conflicts_with->itemsToString(false).c_str()) + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
PoolItemList item_list = conflicts_with->items();
for (PoolItemList::const_iterator it = item_list.begin(); it != item_list.end(); ++it) {
@@ -407,7 +406,7 @@
// TranslatorExplanation %s = name of package, patch, selection ...
details = str::form (_("%s obsoletes:%s"), who.c_str(), obsoletes->itemsToString(false).c_str());
details += _("\nThese resolvables will be deleted from the system.");
- details += logAdditionalInfo(collector.additionalInfo, item);
+ details += "\n" + logAdditionalInfo(collector.additionalInfo, item);
}
break;
case RESOLVER_INFO_TYPE_DEPENDS_ON: { // no solution; it is only a info
@@ -457,7 +456,7 @@
if (it->first == item) {
what = str::form (_("Cannot install %s because it is conflicting with %s"),
who.c_str(),
- it->second->name().c_str());
+ it->second->name().c_str()) + "\n";
details = logAdditionalInfo(collector.additionalInfo, item);
details += logAdditionalInfo(collector.additionalInfo, it->second);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -473,7 +472,7 @@
// default
what = misc_info->message();
// TranslatorExplanation %s = name of package,patch,...
- details = str::form (_("%s is not installed and has been marked as uninstallable"), who.c_str());
+ details = str::form (_("%s is not installed and has been marked as uninstallable"), who.c_str()) + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
problem->addSolution (new ProblemSolutionInstall (problem, item)); // Install resolvable again
@@ -486,7 +485,7 @@
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
// TranslatorExplanation %s = name of package,patch,...
what = str::form (_("Cannot install %s due to dependency problems"), who.c_str());
- details = misc_info->message();
+ details = misc_info->message() + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
// Uninstall it;
@@ -499,7 +498,7 @@
case RESOLVER_INFO_TYPE_INSTALL_TO_BE_UNINSTALLED: { // Can't install p since it is already marked as needing to be uninstalled
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
// TranslatorExplanation %s = name of package,patch,...
- what = misc_info->message();
+ what = misc_info->message() + "\n";
details = logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
problem->addSolution (new ProblemSolutionInstall (problem, item)); // Install resolvable again
@@ -518,7 +517,7 @@
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
// TranslatorExplanation %s = name of package,patch,...
what = str::form (_("Cannot install %s"), who.c_str());
- details = misc_info->message();
+ details = misc_info->message() + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
details += logAdditionalInfo(collector.additionalInfo, misc_info->other());
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -553,7 +552,7 @@
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
what = misc_info->message();
// TranslatorExplanation %s = name of package, patch, selection ...
- details = str::form (_("%s has unfulfilled requirements"), who.c_str());
+ details = str::form (_("%s has unfulfilled requirements"), who.c_str())+ "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
// Uninstall
@@ -593,7 +592,7 @@
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
// TranslatorExplanation %s = name of package, patch, selection ...
what = str::form (_("%s has missing dependencies"), who.c_str());
- details = misc_info->message();
+ details = misc_info->message() + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -641,7 +640,7 @@
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
// TranslatorExplanation %s = name of package, patch, selection ...
what = str::form (_("%s cannot be installed due to missing dependencies"), who.c_str());
- details = misc_info->message();
+ details = misc_info->message() + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -741,7 +740,7 @@
break;
case RESOLVER_INFO_TYPE_CANT_SATISFY: { // Can't satisfy requirement c
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
- what = misc_info->message();
+ what = misc_info->message() + "\n";
details = logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
// uninstall
@@ -779,7 +778,7 @@
ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
// TranslatorExplanation %s = name of package, patch, selection ...
what = str::form (_("%s will not be uninstalled cause it is still required"), who.c_str());
- details = misc_info->message();
+ details = misc_info->message() + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -803,7 +802,7 @@
// TranslatorExplanation %s = name of package, patch, selection ...
details = str::form (_("%s obsoletes %s. But %s cannot be deleted because it is locked."),
misc_info->other()->name().c_str(),
- who.c_str(), who.c_str());
+ who.c_str(), who.c_str()) + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
}
@@ -835,7 +834,7 @@
else
what = str::form (_("Cannot install %s because it is conflicting"),
who.c_str());
- details = misc_info->message();
+ details = misc_info->message() + "\n";
details += logAdditionalInfo(collector.additionalInfo, item);
if (misc_info->other())
details += logAdditionalInfo(collector.additionalInfo, misc_info->other());
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org