[zypp-commit] r11202 - /trunk/libzypp/zypp/target/rpm/RpmDb.cc
Author: jkupec Date: Mon Sep 29 15:54:54 2008 New Revision: 11202 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11202&view=rev Log: - tell which package failed before logging rpm output or error message (bnc #430585) Modified: trunk/libzypp/zypp/target/rpm/RpmDb.cc Modified: trunk/libzypp/zypp/target/rpm/RpmDb.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/rpm/RpmDb.cc?rev=11202&r1=11201&r2=11202&view=diff ============================================================================== --- trunk/libzypp/zypp/target/rpm/RpmDb.cc (original) +++ trunk/libzypp/zypp/target/rpm/RpmDb.cc Mon Sep 29 15:54:54 2008 @@ -2071,27 +2071,26 @@ if ( rpm_status != 0 ) { - // %s = filename of rpm package - // historylog(/*timestamp*/true) << str::form(_("%s install failed"), Pathname::basename(filename).c_str()) << endl; + historylog.comment( + // %s = filename of rpm package + str::form(_("%s install failed"), Pathname::basename(filename).c_str()), + true /*timestamp*/); ostringstream sstr; sstr << _("rpm output:") << endl << rpmmsg << endl; historylog.comment(sstr.str()); - //TranslatorExplanation after semicolon is error message + // TranslatorExplanation the colon is followed by an error message ZYPP_THROW(RpmSubprocessException(string(_("RPM failed: ")) + (rpmmsg.empty() ? error_message : rpmmsg))); } - else + else if ( ! rpmmsg.empty() ) { - // %s = filename of rpm package - // historylog.comment( - // str::form(_("%s installed ok"), Pathname::basename(filename).c_str()), - // /*timestamp*/true); - if ( ! rpmmsg.empty() ) - { - ostringstream sstr; - sstr << _("Additional rpm output:") << endl << rpmmsg << endl; - historylog.comment(sstr.str()); - } + historylog.comment( + // %s = filename of rpm package + str::form(_("%s installed ok"), Pathname::basename(filename).c_str()), + true /*timestamp*/); + ostringstream sstr; + sstr << _("Additional rpm output:") << endl << rpmmsg << endl; + historylog.comment(sstr.str()); } } @@ -2211,25 +2210,25 @@ if ( rpm_status != 0 ) { - // %s = name of rpm package historylog.comment( - str::form(_("%s remove failed"), name_r.c_str()), /*timestamp*/true); + // %s = name of rpm package + str::form(_("%s remove failed"), name_r.c_str()), true /*timestamp*/); ostringstream sstr; sstr << _("rpm output:") << endl << rpmmsg << endl; historylog.comment(sstr.str()); - // TranslatorExplanation after semicolon is error message + // TranslatorExplanation the colon is followed by an error message ZYPP_THROW(RpmSubprocessException(string(_("RPM failed: ")) + (rpmmsg.empty() ? error_message: rpmmsg))); } - else + else if ( ! rpmmsg.empty() ) { - // historylog.comment(str::form(_("%s remove ok"), name_r.c_str()), /*timestamp*/true); - if ( ! rpmmsg.empty() ) - { - ostringstream sstr; - sstr << _("Additional rpm output:") << endl << rpmmsg << endl; - historylog.comment(sstr.str()); - } + historylog.comment( + // %s = name of rpm package + str::form(_("%s removed ok"), name_r.c_str()), true /*timestamp*/); + + ostringstream sstr; + sstr << _("Additional rpm output:") << endl << rpmmsg << endl; + historylog.comment(sstr.str()); } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
jkupec@svn.opensuse.org