From 1258b8be7786128e3d8db754a65c890b609db05c Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Fri, 9 May 2008 16:00:18 +0000 Subject: [PATCH] - work around bug #388810 - fix progressEnd to say Error on error --- src/output/OutNormal.cc | 2 +- src/zypper-rpm-callbacks.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/output/OutNormal.cc b/src/output/OutNormal.cc index 9cfe5dc..495f819 100644 --- a/src/output/OutNormal.cc +++ b/src/output/OutNormal.cc @@ -148,7 +148,7 @@ void OutNormal::progressEnd(const std::string & id, const string & label, bool e return; if (isatty(STDOUT_FILENO)) - cout << CLEARLN << label << " [" << _("done") << "]"; + cout << CLEARLN << label << " [" << (error ? _("error") : _("done")) << "]"; else cout << "]"; cout << endl << std::flush; diff --git a/src/zypper-rpm-callbacks.h b/src/zypper-rpm-callbacks.h index 9210e07..73d8620 100644 --- a/src/zypper-rpm-callbacks.h +++ b/src/zypper-rpm-callbacks.h @@ -184,11 +184,14 @@ struct RemoveResolvableReportReceiver : public zypp::callback::ReceiveReportout().progressEnd("remove-resolvable", _label, error != NO_ERROR); if (error != NO_ERROR) - // don't write to output, the error should have been reported in problem() (bnc #381203) + { + // set proper exit code + Zypper::instance()->out().error(zcb_error2str(error, reason)); Zypper::instance()->setExitCode(ZYPPER_EXIT_ERR_ZYPP); - else - Zypper::instance()->out().progressEnd("remove-resolvable", _label); + } } }; -- 2.7.4