Hello community, here is the log from the commit of package zypper checked in at Thu Aug 30 23:49:02 CEST 2007. -------- --- zypper/zypper.changes 2007-08-29 12:56:29.000000000 +0200 +++ /mounts/work_src_done/STABLE/zypper/zypper.changes 2007-08-30 20:33:57.000000000 +0200 @@ -1,0 +2,9 @@ +Thu Aug 30 20:32:56 CEST 2007 - jkupec@suse.cz + +- suppressing excessive output of media errors +- prompting for media change only for changeable media +- adapted to libzypp 3.21.0 (#294481) +- r7043 +- 0.8.18 + +------------------------------------------------------------------- Old: ---- zypper-0.8.17.tar.bz2 New: ---- zypper-0.8.18.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zypper.spec ++++++ --- /var/tmp/diff_new_pack.w28005/_old 2007-08-30 23:48:36.000000000 +0200 +++ /var/tmp/diff_new_pack.w28005/_new 2007-08-30 23:48:36.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package zypper (Version 0.8.17) +# spec file for package zypper (Version 0.8.18) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,7 +11,7 @@ # norootforbuild Name: zypper -BuildRequires: boost-devel >= 1.33.1 gettext-devel >= 0.15 libzypp-devel >= 3.19.0 readline-devel >= 5.1 +BuildRequires: boost-devel >= 1.33.1 gettext-devel >= 0.15 libzypp-devel > 3.20.1 readline-devel >= 5.1 BuildRequires: cmake >= 2.4.6 gcc-c++ >= 4.2 pkg-config >= 0.20 Requires: procps License: GPL v2 or later @@ -20,9 +20,9 @@ Autoreqprov: on PreReq: permissions Summary: Command Line Package Management Using Libzypp -Version: 0.8.17 -Release: 4 -Source: zypper-0.8.17.tar.bz2 +Version: 0.8.18 +Release: 1 +Source: zypper-0.8.18.tar.bz2 Prefix: /usr URL: http://en.opensuse.org/Zypper Provides: y2pmsh @@ -97,6 +97,12 @@ %ghost %config(noreplace) %{_var}/log/zypper.log %changelog +* Thu Aug 30 2007 - jkupec@suse.cz +- suppressing excessive output of media errors +- prompting for media change only for changeable media +- adapted to libzypp 3.21.0 (#294481) +- r7043 +- 0.8.18 * Wed Aug 29 2007 - jkupec@suse.cz - proper fix for y/n translation (#304650) - r6965 ++++++ zypper-0.8.17.tar.bz2 -> zypper-0.8.18.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/package/zypper.changes new/zypper-0.8.18/package/zypper.changes --- old/zypper-0.8.17/package/zypper.changes 2007-08-29 12:56:28.000000000 +0200 +++ new/zypper-0.8.18/package/zypper.changes 2007-08-30 20:33:57.000000000 +0200 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Thu Aug 30 20:32:56 CEST 2007 - jkupec@suse.cz + +- suppressing excessive output of media errors +- prompting for media change only for changeable media +- adapted to libzypp 3.21.0 (#294481) +- r7043 +- 0.8.18 + +------------------------------------------------------------------- Wed Aug 29 12:51:42 CEST 2007 - jkupec@suse.cz - proper fix for y/n translation (#304650) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/src/zypper-callbacks.cc new/zypper-0.8.18/src/zypper-callbacks.cc --- old/zypper-0.8.17/src/zypper-callbacks.cc 2007-08-29 12:56:27.000000000 +0200 +++ new/zypper-0.8.18/src/zypper-callbacks.cc 2007-08-30 20:33:57.000000000 +0200 @@ -181,13 +181,12 @@ { if (e.historySize()) { - if (gSettings.verbosity > 2) + if (gSettings.verbosity > VERBOSITY_NORMAL) { // print the whole history cerr << e.historyAsString(); - cerr << endl; // this exception - cerr << e.asUserString(); + cerr << " - " << e.asUserString(); } else // print the root cause only diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/src/zypper-callbacks.h new/zypper-0.8.18/src/zypper-callbacks.h --- old/zypper-0.8.17/src/zypper-callbacks.h 2007-08-29 12:56:28.000000000 +0200 +++ new/zypper-0.8.18/src/zypper-callbacks.h 2007-08-30 20:33:57.000000000 +0200 @@ -32,6 +32,7 @@ // newline if normal progress is on single line void display_done ( const std::string &id, ostream & out); +//! \todo this must be rewritten as the error enums are different for some zypp callbacks template<typename Error> void display_error (Error error, const std::string& reason) { if (error != 0 /*NO_ERROR*/) @@ -41,7 +42,13 @@ "", _("Not found"), _("I/O error"), _("Invalid object") }; ostream& stm = std::cerr; - stm << error_s[error]; + + // error type: + if (error < 3) + stm << error_s[error]; + else + stm << _("Error"); + // description if (!reason.empty()) stm << ": " << reason; stm << std::endl; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/src/zypper.h new/zypper-0.8.18/src/zypper.h --- old/zypper-0.8.17/src/zypper.h 2007-08-29 12:56:28.000000000 +0200 +++ new/zypper-0.8.18/src/zypper.h 2007-08-30 20:33:57.000000000 +0200 @@ -100,10 +100,11 @@ std::listzypp::RepoInfo repos; int patches_count; int security_patches_count; - std::vectorstd::string packages_to_install; + std::vectorstd::string packages_to_install; std::vectorstd::string packages_to_uninstall; zypp::ResStore repo_resolvables; zypp::ResStore target_resolvables; + zypp::RepoInfo current_repo; /** * Limit output to and above specified verbosity level. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/src/zypper-media-callbacks.h new/zypper-0.8.18/src/zypper-media-callbacks.h --- old/zypper-0.8.17/src/zypper-media-callbacks.h 2007-08-29 12:56:28.000000000 +0200 +++ new/zypper-0.8.18/src/zypper-media-callbacks.h 2007-08-30 20:33:57.000000000 +0200 @@ -23,8 +23,10 @@ #include <zypp/Digest.h> #include <zypp/Url.h> +#include "zypper.h" #include "zypper-callbacks.h" #include "AliveCursor.h" +#include "zypper-utils.h" using zypp::media::MediaChangeReport; using zypp::media::DownloadProgressReport; @@ -36,24 +38,35 @@ struct MediaChangeReportReceiver : public zypp::callback::ReceiveReport<MediaChangeReport> { - virtual MediaChangeReport::Action requestMedia( Repository repo, + virtual MediaChangeReport::Action requestMedia( zypp::Url & url, unsigned mediumNr, MediaChangeReport::Error error, const std::string & description ) { - cerr << description << endl; - // TranslatorExplanation translate letters 'y' and 'n' the same as you translated the [y/n] prompt. - std::string request = boost::str(boost::format( - _("Please insert media [%s] # %d and type 'y' to continue or 'n' to cancel the operation.")) - % repo.info().name() % mediumNr); - if (read_bool_answer(request, false)) - return MediaChangeReport::RETRY; - else - return MediaChangeReport::ABORT; + if (is_changeable_media(url)) + { + cerr << endl; // may be in the middle of RepoReport or ProgressReport + cerr << description << endl; + + // TranslatorExplanation translate letters 'y' and 'n' to whathever is appropriate for your language. + // Try to check what answers does zypper accept (it always accepts y/n at least) + // You can also have a look at the regular expressions used to check the answer here: + // /usr/lib/locale/<your_locale>/LC_MESSAGES/SYS_LC_MESSAGES + std::string request = boost::str(boost::format( + _("Please insert media [%s] # %d and type 'y' to continue or 'n' to cancel the operation.")) + % gData.current_repo.name() % mediumNr); + if (read_bool_answer(request, false)) + return MediaChangeReport::RETRY; + else + return MediaChangeReport::ABORT; + } + + // not displaying the error for non-changeable media, it will be displayed + // where it is caught } }; - // progress for downloading a file + // progress for downloading a file struct DownloadProgressReportReceiver : public zypp::callback::ReceiveReportzypp::media::DownloadProgressReport { virtual void start( const zypp::Url & file, zypp::Pathname localfile ) @@ -76,6 +89,7 @@ return true; } + // not used anywhere in libzypp 3.20.0 virtual DownloadProgressReport::Action problem( const zypp::Url & /*file*/, DownloadProgressReport::Error error, const std::string & description ) { display_done ("download", cout_v); @@ -83,10 +97,12 @@ return DownloadProgressReport::ABORT; } + // 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 ) { display_done ("download", cout_v); - display_error (error, konreason); + // don't display errors here, they will be reported in media change callback + // display_error (error, konreason); } }; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/src/zypper-sources.cc new/zypper-0.8.18/src/zypper-sources.cc --- old/zypper-0.8.17/src/zypper-sources.cc 2007-08-29 12:56:27.000000000 +0200 +++ new/zypper-0.8.18/src/zypper-sources.cc 2007-08-30 20:33:57.000000000 +0200 @@ -6,7 +6,6 @@ #include <zypp/target/store/PersistentStorage.h> #include <zypp/base/IOStream.h> -#include <zypp/media/MediaManager.h> #include <zypp/RepoManager.h> #include <zypp/RepoInfo.h> @@ -36,6 +35,11 @@ static bool refresh_raw_metadata(const RepoInfo & repo, bool force_download) { + gData.current_repo = repo; + + // reset the gData.current_repo when going out of scope + struct Bye { ~Bye() { gData.current_repo = RepoInfo(); } } reset __attribute__ ((__unused__)); + try { RepoManager manager; @@ -101,6 +105,7 @@ catch (const RepoNoAliasException & e) { ZYPP_CAUGHT(e); + //! \todo correct the message after 10.3 release cerr << format(_("No alias defined this repository.")) << endl; report_a_bug(cerr); return true; // error @@ -653,9 +658,7 @@ for(RepoInfo::urls_const_iterator it = repo.baseUrlsBegin(); it != repo.baseUrlsEnd(); ++it) { - MediaManager mm; MediaAccessId id = mm.open(*it); - is_cd = mm.isChangeable(id); - mm.close(id); + is_cd = is_changeable_media(*it); if (!is_cd) break; } @@ -669,6 +672,11 @@ try { + gData.current_repo = repo; + + // reset the gData.current_repo when going out of scope + struct Bye { ~Bye() { gData.current_repo = RepoInfo(); } } reset __attribute__ ((__unused__)); + manager.addRepository(repo); } catch (const RepoAlreadyExistsException & e) @@ -695,7 +703,7 @@ ZYPP_CAUGHT(e); report_problem(e, _("Problem transferring repository data from specified URL:"), - _("Please, check whether the specified URL is accessible.")); + is_cd ? "" : _("Please, check whether the specified URL is accessible.")); ERR << "Problem transferring repository data from specified URL" << endl; return ZYPPER_EXIT_ERR_ZYPP; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/src/zypper-utils.cc new/zypper-0.8.18/src/zypper-utils.cc --- old/zypper-0.8.17/src/zypper-utils.cc 2007-08-29 12:56:27.000000000 +0200 +++ new/zypper-0.8.18/src/zypper-utils.cc 2007-08-30 20:33:57.000000000 +0200 @@ -1,4 +1,7 @@ #include <fstream> + +#include <zypp/media/MediaManager.h> + #include "zypper.h" using namespace zypp::detail; @@ -46,3 +49,11 @@ // unless you translate the actual page :) << _("See http://en.opensuse.org/Zypper#Troubleshooting for instructions.") << endl; } + +bool is_changeable_media(const zypp::Url & url) +{ + media::MediaManager mm; media::MediaAccessId id = mm.open(url); + bool is_cd = mm.isChangeable(id); + mm.close(id); + return is_cd; +} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/src/zypper-utils.h new/zypper-0.8.18/src/zypper-utils.h --- old/zypper-0.8.17/src/zypper-utils.h 2007-08-29 12:56:28.000000000 +0200 +++ new/zypper-0.8.18/src/zypper-utils.h 2007-08-30 20:33:57.000000000 +0200 @@ -5,6 +5,7 @@ #include <string> #include <zypp/Pathname.h> +#include <zypp/Url.h> std::string read_line_from_file( const zypp::Pathname &file ); void write_line_to_file( const zypp::Pathname &file, const std::string &line ); @@ -14,4 +15,6 @@ */ std::ostream & report_a_bug (std::ostream& stm); +bool is_changeable_media(const zypp::Url & url); + #endif /*ZYPPER_UTILS_H*/ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/VERSION.cmake new/zypper-0.8.18/VERSION.cmake --- old/zypper-0.8.17/VERSION.cmake 2007-08-29 12:56:28.000000000 +0200 +++ new/zypper-0.8.18/VERSION.cmake 2007-08-30 20:33:57.000000000 +0200 @@ -20,4 +20,4 @@ SET(VERSION_MAJOR "0") SET(VERSION_MINOR "8") -SET(VERSION_PATCH "17") +SET(VERSION_PATCH "18") diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.8.17/zypper.spec.cmake new/zypper-0.8.18/zypper.spec.cmake --- old/zypper-0.8.17/zypper.spec.cmake 2007-08-29 12:56:28.000000000 +0200 +++ new/zypper-0.8.18/zypper.spec.cmake 2007-08-30 20:33:57.000000000 +0200 @@ -11,7 +11,7 @@ # norootforbuild Name: @PACKAGE@ -BuildRequires: libzypp-devel >= 3.19.0 boost-devel >= 1.33.1 gettext-devel >= 0.15 readline-devel >= 5.1 +BuildRequires: libzypp-devel > 3.20.1 boost-devel >= 1.33.1 gettext-devel >= 0.15 readline-devel >= 5.1 BuildRequires: gcc-c++ >= 4.2 cmake >= 2.4.6 pkg-config >= 0.20 Requires: procps License: GPL ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org