Imported Upstream version 14.38.0 28/94628/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:32:52 +0000 (10:32 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:32:53 +0000 (10:32 +0900)
Change-Id: Id468ab374f49c35a21ddefce4145b356f9e578fd
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
VERSION.cmake
package/libzypp.changes
zypp/RepoManager.cc
zypp/ZYppCallbacks.h
zypp/zypp_detail/ZYppImpl.cc

index c6ee35c..61880ad 100644 (file)
@@ -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)
 #=======
index 75859a8..e52b181 100644 (file)
@@ -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
index 9b717f2..d9ce8bf 100644 (file)
@@ -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 )
     {
index 9f0a96a..27b0c4f 100644 (file)
@@ -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<callback::TempConnect<media::MediaChangeReport> > _guard;
+    };
+
     // progress for downloading a file
     struct DownloadProgressReport : public callback::ReportBase
     {
index f0023e7..985d429 100644 (file)
@@ -32,12 +32,29 @@ using std::endl;
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
+  ///////////////////////////////////////////////////////////////////
+  namespace media
+  {
+    ScopedDisableMediaChangeReport::ScopedDisableMediaChangeReport( bool condition_r )
+    {
+      static weak_ptr<callback::TempConnect<media::MediaChangeReport> > globalguard;
+      if ( condition_r && ! (_guard = globalguard.lock()) )
+      {
+       // aquire a new one....
+       _guard.reset( new callback::TempConnect<media::MediaChangeReport>() );
+       globalguard = _guard;
+      }
+    }
+  } // namespace media
+  ///////////////////////////////////////////////////////////////////
+
   callback::SendReport<JobReport> & JobReport::instance()
   {
     static callback::SendReport<JobReport> _report;
     return _report;
   }
 
+
   ///////////////////////////////////////////////////////////////////
   namespace zypp_detail
   { /////////////////////////////////////////////////////////////////