From d69b93ff46523bc39560a23299ce90ac0796d136 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 10:32:52 +0900 Subject: [PATCH] Imported Upstream version 14.38.0 Change-Id: Id468ab374f49c35a21ddefce4145b356f9e578fd Signed-off-by: DongHun Kwak --- VERSION.cmake | 6 +++--- package/libzypp.changes | 6 ++++++ zypp/RepoManager.cc | 3 +++ zypp/ZYppCallbacks.h | 13 +++++++++++++ zypp/zypp_detail/ZYppImpl.cc | 17 +++++++++++++++++ 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index c6ee35c..61880ad 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "14") SET(LIBZYPP_COMPATMINOR "30") -SET(LIBZYPP_MINOR "37") -SET(LIBZYPP_PATCH "1") +SET(LIBZYPP_MINOR "38") +SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 14.37.1 (30) +# LAST RELEASED: 14.38.0 (30) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index 75859a8..e52b181 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Mar 19 16:44:39 CET 2015 - ma@suse.de + +- Suppress MediaChangeReport while testing multiple baseurls (bnc#899510) +- version 14.38.0 (30) + +------------------------------------------------------------------- Mon Mar 16 14:05:28 CET 2015 - ma@suse.de - add support for SHA224/384/512 diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 9b717f2..d9ce8bf 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -1012,6 +1012,9 @@ namespace zypp "Valid metadata not found at specified URLs", info.baseUrlsSize() ) ); + // Suppress (interactive) media::MediaChangeReport if we in have multiple basurls (>1) + media::ScopedDisableMediaChangeReport guard( info.baseUrlsSize() > 1 ); + // try urls one by one for ( RepoInfo::urls_const_iterator it = info.baseUrlsBegin(); it != info.baseUrlsEnd(); ++it ) { diff --git a/zypp/ZYppCallbacks.h b/zypp/ZYppCallbacks.h index 9f0a96a..27b0c4f 100644 --- a/zypp/ZYppCallbacks.h +++ b/zypp/ZYppCallbacks.h @@ -337,6 +337,19 @@ namespace zypp ) { return ABORT; } }; + /////////////////////////////////////////////////////////////////// + /// \class ScopedDisableMediaChangeReport + /// \brief Temporarily disable MediaChangeReport + /// Sometimes helpful to suppress interactive messages connected to + /// MediaChangeReport while fallback URLs are avaialble. + struct ScopedDisableMediaChangeReport + { + /** Disbale MediaChangeReport if \a condition_r is \c true.*/ + ScopedDisableMediaChangeReport( bool condition_r = true ); + private: + shared_ptr > _guard; + }; + // progress for downloading a file struct DownloadProgressReport : public callback::ReportBase { diff --git a/zypp/zypp_detail/ZYppImpl.cc b/zypp/zypp_detail/ZYppImpl.cc index f0023e7..985d429 100644 --- a/zypp/zypp_detail/ZYppImpl.cc +++ b/zypp/zypp_detail/ZYppImpl.cc @@ -32,12 +32,29 @@ using std::endl; namespace zypp { ///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// + namespace media + { + ScopedDisableMediaChangeReport::ScopedDisableMediaChangeReport( bool condition_r ) + { + static weak_ptr > globalguard; + if ( condition_r && ! (_guard = globalguard.lock()) ) + { + // aquire a new one.... + _guard.reset( new callback::TempConnect() ); + globalguard = _guard; + } + } + } // namespace media + /////////////////////////////////////////////////////////////////// + callback::SendReport & JobReport::instance() { static callback::SendReport _report; return _report; } + /////////////////////////////////////////////////////////////////// namespace zypp_detail { ///////////////////////////////////////////////////////////////// -- 2.7.4