Imported Upstream version 14.41.1 40/94640/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:35:24 +0000 (10:35 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:35:25 +0000 (10:35 +0900)
Change-Id: I7cb2a3dbd977084726b4527f25884b9b49495283
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
VERSION.cmake
package/libzypp.changes
zypp/RepoManager.cc

index 455db4c..8841878 100644 (file)
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "14")
 SET(LIBZYPP_COMPATMINOR "39")
 SET(LIBZYPP_MINOR "41")
-SET(LIBZYPP_PATCH "0")
+SET(LIBZYPP_PATCH "1")
 #
-# LAST RELEASED: 14.41.0 (39)
+# LAST RELEASED: 14.41.1 (39)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index e80aaa6..d326915 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri Sep 25 10:54:20 CEST 2015 - ma@suse.de
+
+- Avoid URL rewrite if probing local cache directories (bsc#946129)
+- version 14.41.1 (39)
+
+-------------------------------------------------------------------
 Mon Sep  7 09:41:44 CEST 2015 - ma@suse.de
 
 - Don't cache repo releasever (bnc#943563)
index d9ce8bf..80f0130 100644 (file)
@@ -520,6 +520,7 @@ namespace zypp
     void buildCache( const RepoInfo & info, CacheBuildPolicy policy, OPT_PROGRESS );
 
     repo::RepoType probe( const Url & url, const Pathname & path = Pathname() ) const;
+    repo::RepoType probeCache( const Pathname & path_r ) const;
 
     void cleanCacheDirGarbage( OPT_PROGRESS );
 
@@ -812,7 +813,7 @@ namespace zypp
     RepoType repokind = info.type();
     // If unknown, probe the local metadata
     if ( repokind == RepoType::NONE )
-      repokind = probe( productdatapath.asUrl() );
+      repokind = probeCache( productdatapath );
 
     RepoStatus status;
     switch ( repokind.toEnum() )
@@ -846,7 +847,7 @@ namespace zypp
     RepoType repokind = info.type();
     if ( repokind.toEnum() == RepoType::NONE_e )
       // unknown, probe the local metadata
-      repokind = probe( productdatapath.asUrl() );
+      repokind = probeCache( productdatapath );
     // if still unknown, just return
     if (repokind == RepoType::NONE_e)
       return;
@@ -1235,7 +1236,7 @@ namespace zypp
     {
       case RepoType::NONE_e:
         // unknown, probe the local metadata
-        repokind = probe( productdatapath.asUrl() );
+        repokind = probeCache( productdatapath );
       break;
       default:
       break;
@@ -1307,6 +1308,13 @@ namespace zypp
 
   ////////////////////////////////////////////////////////////////////////////
 
+
+  /** Probe the metadata type of a repository located at \c url.
+   * Urls here may be rewritten by \ref MediaSetAccess to reflect the correct media number.
+   *
+   * \note Metadata in local cache directories must be probed using \ref probeCache as
+   * a cache path must not be rewritten (bnc#946129)
+   */
   repo::RepoType RepoManager::Impl::probe( const Url & url, const Pathname & path  ) const
   {
     MIL << "going to probe the repo type at " << url << " (" << path << ")" << endl;
@@ -1391,6 +1399,28 @@ namespace zypp
     return repo::RepoType::NONE;
   }
 
+  /** Probe Metadata in a local cache directory
+   *
+   * \note Metadata in local cache directories must not be probed using \ref probe as
+   * a cache path must not be rewritten (bnc#946129)
+   */
+  repo::RepoType RepoManager::Impl::probeCache( const Pathname & path_r ) const
+  {
+    MIL << "going to probe the cached repo at " << path_r << endl;
+
+    repo::RepoType ret = repo::RepoType::NONE;
+
+    if ( PathInfo(path_r/"/repodata/repomd.xml").isFile() )
+    { ret = repo::RepoType::RPMMD; }
+    else if ( PathInfo(path_r/"/content").isFile() )
+    { ret = repo::RepoType::YAST2; }
+    else if ( PathInfo(path_r).isDir() )
+    { ret = repo::RepoType::RPMPLAINDIR; }
+
+    MIL << "Probed cached type " << ret << " at " << path_r << endl;
+    return ret;
+  }
+
   ////////////////////////////////////////////////////////////////////////////
 
   void RepoManager::Impl::cleanCacheDirGarbage( const ProgressData::ReceiverFnc & progressrcv )