Author: jkupec Date: Tue Oct 30 15:23:59 2007 New Revision: 7703 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7703&view=rev Log: - supress progress output when --quiet Modified: trunk/zypper/src/zypper-media-callbacks.h trunk/zypper/src/zypper-rpm-callbacks.h trunk/zypper/src/zypper-source-callbacks.h Modified: trunk/zypper/src/zypper-media-callbacks.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-media-callbacks.h?rev=7703&r1=7702&r2=7703&view=diff ============================================================================== --- trunk/zypper/src/zypper-media-callbacks.h (original) +++ trunk/zypper/src/zypper-media-callbacks.h Tue Oct 30 15:23:59 2007 @@ -73,7 +73,9 @@ { 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 @@ 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 @@ // 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 @@ // 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); Modified: trunk/zypper/src/zypper-rpm-callbacks.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-rpm-callbacks.h?rev=7703&r1=7702&r2=7703&view=diff ============================================================================== --- trunk/zypper/src/zypper-rpm-callbacks.h (original) +++ trunk/zypper/src/zypper-rpm-callbacks.h Tue Oct 30 15:23:59 2007 @@ -114,7 +114,7 @@ // this is called too often. relax a bit. static int last = -1; if (last != value) - display_progress ( "read-installed-packages", cout, _("Reading installed packages"), value); + display_progress ( "read-installed-packages", cout_n, _("Reading installed packages"), value); last = value; return true; } @@ -126,7 +126,7 @@ virtual void finish( Error error, const std::string & reason ) { - display_done ("read-installed-packages", cout); + display_done ("read-installed-packages", cout_n); display_error (error, reason); } }; @@ -145,7 +145,7 @@ virtual bool progress(int value, zypp::Resolvable::constPtr resolvable) { // TranslatorExplanation This text is a progress display label e.g. "Removing [42%]" - display_progress ( "remove-resolvable", cout, + display_progress ( "remove-resolvable", cout_n, _("Removing ") + resolvable->name() + string("-") + resolvable->edition().asString(), value); return true; } @@ -183,7 +183,7 @@ // TranslatorExplanation This text is a progress display label e.g. "Installing foo-1.1.2 [42%]" string s = boost::str(boost::format(_("Installing: %s-%s")) % resolvable->name() % resolvable->edition()); - display_progress ( "install-resolvable", cout, s, value); + display_progress ( "install-resolvable", cout_n, s, value); } virtual void start( zypp::Resolvable::constPtr resolvable ) Modified: trunk/zypper/src/zypper-source-callbacks.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-source-callbacks.h?rev=7703&r1=7702&r2=7703&view=diff ============================================================================== --- trunk/zypper/src/zypper-source-callbacks.h (original) +++ trunk/zypper/src/zypper-source-callbacks.h Tue Oct 30 15:23:59 2007 @@ -219,9 +219,9 @@ void tick( const zypp::ProgressData &data ) { if ( data.reportAlive() ) - display_tick (zypp::str::numstring(data.numericId()), cout, data.name() ); + display_tick (zypp::str::numstring(data.numericId()), cout_n, data.name() ); else - display_progress ( zypp::str::numstring(data.numericId()), cout, data.name() , data.val() ); + display_progress ( zypp::str::numstring(data.numericId()), cout_n, data.name() , data.val() ); } virtual void start( const zypp::ProgressData &data ) @@ -244,7 +244,7 @@ virtual void finish( const zypp::ProgressData &data ) { - display_done(zypp::str::numstring(data.numericId()), cout, data.name() ); + display_done(zypp::str::numstring(data.numericId()), cout_n, data.name() ); } }; @@ -260,7 +260,7 @@ void display_step(const zypp::ProgressData & pd) { - display_progress("repo", cout, "(" + _repo.name() + ") " + pd.name(), pd.val()); + display_progress("repo", cout_n, "(" + _repo.name() + ") " + pd.name(), pd.val()); } virtual bool progress(const zypp::ProgressData & pd) @@ -271,7 +271,7 @@ virtual Action problem( zypp::Repository /*repo*/, Error error, const std::string & description ) { - display_done ("repo", cout); + display_done ("repo", cout_n); display_error (error, description); return (Action) read_action_ari (ABORT); } @@ -281,9 +281,9 @@ display_step(100); // many of these, avoid newline if (boost::algorithm::starts_with (task, "Reading patch")) - cout << '\r' << flush; + cout_n << '\r' << flush; else - display_done ("repo", cout); + display_done ("repo", cout_n); display_error (error, reason); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org