From: Jan Kupec Date: Tue, 30 Oct 2007 14:23:59 +0000 (+0000) Subject: - supress progress output when --quiet X-Git-Tag: BASE-SuSE-Linux-11_0-Branch~542 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c20b79ecbad6a1adc1ccc6393cc3e3feb25b131;p=platform%2Fupstream%2Fzypper.git - supress progress output when --quiet --- diff --git a/src/zypper-media-callbacks.h b/src/zypper-media-callbacks.h index 5f67b09..6abddc6 100644 --- a/src/zypper-media-callbacks.h +++ b/src/zypper-media-callbacks.h @@ -73,7 +73,9 @@ namespace ZmartRecipients { virtual void start( const zypp::Url & file, zypp::Pathname localfile ) { - if (gSettings.verbosity == VERBOSITY_MEDIUM || gData.show_media_progress_hack) + if (gSettings.verbosity < VERBOSITY_NORMAL) + return; + else if (gSettings.verbosity == VERBOSITY_MEDIUM || gData.show_media_progress_hack) { cout << CLEARLN << _("Downloading: ") << zypp::Pathname(file.getPathName()).basename() @@ -87,6 +89,8 @@ namespace ZmartRecipients virtual bool progress(int value, const zypp::Url & /*file*/) { + if (gSettings.verbosity < VERBOSITY_NORMAL) + return true; if (gData.show_media_progress_hack) display_progress ("download", cout, "Downloading", value); else @@ -97,10 +101,13 @@ namespace ZmartRecipients // not used anywhere in libzypp 3.20.0 virtual DownloadProgressReport::Action problem( const zypp::Url & /*file*/, DownloadProgressReport::Error error, const std::string & description ) { - if (gData.show_media_progress_hack) - display_done ("download", cout); - else - display_done ("download", cout_v); + if (gSettings.verbosity >= VERBOSITY_NORMAL) + { + if (gData.show_media_progress_hack) + display_done ("download", cout_n); + else + display_done ("download", cout_v); + } display_error (error, description); return DownloadProgressReport::ABORT; } @@ -108,7 +115,9 @@ namespace ZmartRecipients // used only to finish, errors will be reported in media change callback (libzypp 3.20.0) virtual void finish( const zypp::Url & /*file*/, Error error, const std::string & konreason ) { - if (gData.show_media_progress_hack) + if (gSettings.verbosity < VERBOSITY_NORMAL) + return; + else if (gData.show_media_progress_hack) display_done ("download", cout); else display_done ("download", cout_v); diff --git a/src/zypper-rpm-callbacks.h b/src/zypper-rpm-callbacks.h index f534a71..723cb24 100644 --- a/src/zypper-rpm-callbacks.h +++ b/src/zypper-rpm-callbacks.h @@ -114,7 +114,7 @@ struct ScanRpmDbReceive : public zypp::callback::ReceiveReportname() + string("-") + resolvable->edition().asString(), value); return true; } @@ -183,7 +183,7 @@ struct InstallResolvableReportReceiver : public zypp::callback::ReceiveReportname() % resolvable->edition()); - display_progress ( "install-resolvable", cout, s, value); + display_progress ( "install-resolvable", cout_n, s, value); } virtual void start( zypp::Resolvable::constPtr resolvable ) diff --git a/src/zypper-source-callbacks.h b/src/zypper-source-callbacks.h index b2a2a43..84075ec 100644 --- a/src/zypper-source-callbacks.h +++ b/src/zypper-source-callbacks.h @@ -219,9 +219,9 @@ struct ProgressReportReceiver : public zypp::callback::ReceiveReport