Imported Upstream version 14.31.0 18/94618/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:31:01 +0000 (10:31 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:31:02 +0000 (10:31 +0900)
Change-Id: Iefc0fd7bab9d1e05ae79e76abc9b49888c395cd3
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
VERSION.cmake
libzypp.spec.cmake
package/libzypp.changes
tests/sat/Solvable_test.cc
tests/zypp/ContentType_test.cc
tests/zypp/CpeId_test.cc
zypp/KeyRing.cc
zypp/base/String.cc
zypp/base/String.h
zypp/base/Xml.h

index 2fc4a63..56c4275 100644 (file)
@@ -60,9 +60,9 @@
 #
 SET(LIBZYPP_MAJOR "14")
 SET(LIBZYPP_COMPATMINOR "30")
-SET(LIBZYPP_MINOR "30")
-SET(LIBZYPP_PATCH "2")
+SET(LIBZYPP_MINOR "31")
+SET(LIBZYPP_PATCH "0")
 #
-# LAST RELEASED: 14.30.2 (30)
+# LAST RELEASED: 14.31.0 (30)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index 23cecf7..fa02c1f 100644 (file)
@@ -134,17 +134,6 @@ Requires:       libcurl   >= %{min_curl_version}
 %description
 Package, Patch, Pattern, and Product Management
 
-Authors:
---------
-    Michael Andres <ma@suse.de>
-    Jiri Srain <jsrain@suse.cz>
-    Stefan Schubert <schubi@suse.de>
-    Duncan Mac-Vicar <dmacvicar@suse.de>
-    Klaus Kaempf <kkaempf@suse.de>
-    Marius Tomaschewski <mt@suse.de>
-    Stanislav Visnovsky <visnov@suse.cz>
-    Ladislav Slezak <lslezak@suse.cz>
-
 %package devel
 Summary:        Package, Patch, Pattern, and Product Management - developers files
 Group:          Development/Libraries/C and C++
@@ -190,8 +179,6 @@ Package, Patch, Pattern, and Product Management - developers files
 %package devel-doc
 Summary:        Package, Patch, Pattern, and Product Management - developers files
 Group:          Documentation/HTML
-Provides:       yast2-packagemanager-devel
-Obsoletes:      yast2-packagemanager-devel
 
 %description devel-doc
 Package, Patch, Pattern, and Product Management - developers files
index 9943ef2..db8d2b9 100644 (file)
@@ -1,4 +1,19 @@
 -------------------------------------------------------------------
+Mon Dec  8 14:53:00 CET 2014 - ma@suse.de
+
+- Adapt to gpg-2.1 (bnc#908135)
+- rpm: do not obsolete yast2-packagemanager-devel by libzypp-devel-doc
+- replaceAll: fix endless loop on empty search string
+- version 14.31.0 (30)
+
+-------------------------------------------------------------------
+Thu Nov 27 07:40:30 UTC 2014 - dimstar@opensuse.org
+
+- Do not provide/obsolete yast2-packagemanager-devel by the -doc
+  package: the -devel package already does that.
+- Minor .spec cleanup (remove Authors section).
+
+-------------------------------------------------------------------
 Tue Nov 11 17:09:28 CET 2014 - ma@suse.de
 
 - Call rpm with '--noglob' (bnc#892431)
index 4532a5d..f4685ed 100644 (file)
@@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(attributes)
     BOOST_CHECK_EQUAL(c, 2);
 }
 
-BOOST_AUTO_TEST_CASE(asString)
+BOOST_AUTO_TEST_CASE(asStringTest)
 {
   BOOST_CHECK_EQUAL( sat::Solvable(0).asString(), "noSolvable" );
   BOOST_CHECK_EQUAL( sat::Solvable(1).asString(), "systemSolvable" );
index 97346e6..6d7cbcb 100644 (file)
@@ -1,4 +1,5 @@
 #include <boost/test/auto_unit_test.hpp>
+#include <iostream>
 #include <set>
 #include "zypp/ContentType.h"
 
@@ -62,4 +63,4 @@ BOOST_AUTO_TEST_CASE(contenttype_cmp)
   BOOST_CHECK_EQUAL( *(i++), ContentType( "b", "b" ) );
   BOOST_CHECK_EQUAL( *(i++), ContentType( "b", "c" ) );
   BOOST_CHECK( i == c.end() );
-}
\ No newline at end of file
+}
index bce2adb..682a7f2 100644 (file)
@@ -1,4 +1,5 @@
 #include <boost/test/auto_unit_test.hpp>
+#include <iostream>
 #include "zypp/CpeId.h"
 
 using std::cout;
index 50b8d8d..9ff1f80 100644 (file)
@@ -98,13 +98,33 @@ namespace zypp
     private:
       struct Cache
       {
-       scoped_ptr<WatchFile> _keyringP;
-       std::list<PublicKeyData> _data;
-
        // Empty copy ctor to allow insert into std::map as
        // scoped_ptr is noncopyable.
        Cache() {}
        Cache( const Cache & rhs ) {}
+
+       void assertCache( const Pathname & keyring_r )
+       {
+           ExternalProgram("ls -l "+keyring_r.asString()) >> SEC;
+         // .kbx since gpg2-2.1
+         if ( !_keyringK )
+           _keyringK.reset( new WatchFile( keyring_r/"pubring.kbx", WatchFile::NO_INIT ) );
+         if ( !_keyringP )
+           _keyringP.reset( new WatchFile( keyring_r/"pubring.gpg", WatchFile::NO_INIT ) );
+       }
+
+       bool hasChanged() const
+       {
+         bool k = _keyringK->hasChanged();     // be sure both files are checked
+         bool p = _keyringP->hasChanged();
+         return k || p;
+       }
+
+       std::list<PublicKeyData> _data;
+
+      private:
+       scoped_ptr<WatchFile> _keyringK;
+       scoped_ptr<WatchFile> _keyringP;
       };
 
       typedef std::map<Pathname,Cache> CacheMap;
@@ -112,17 +132,14 @@ namespace zypp
       const std::list<PublicKeyData> & getData( const Pathname & keyring_r ) const
       {
        Cache & cache( _cacheMap[keyring_r] );
-       if ( ! cache._keyringP )
-       {
-         // init new cache entry
-         cache._keyringP.reset( new WatchFile( keyring_r/"pubring.gpg", WatchFile::NO_INIT ) );
-       }
+       // init new cache entry
+       cache.assertCache( keyring_r );
        return getData( keyring_r, cache );
       }
 
       const std::list<PublicKeyData> & getData( const Pathname & keyring_r, Cache & cache_r ) const
       {
-       if ( cache_r._keyringP->hasChanged() )
+       if ( cache_r.hasChanged() )
        {
          const char* argv[] =
          {
index 8ec8d6e..666e79a 100644 (file)
@@ -303,14 +303,17 @@ namespace zypp
 
     std::string & replaceAll( std::string & str_r, const std::string & from_r, const std::string & to_r )
     {
-      std::string::size_type pos = 0;
-      while ( (pos = str_r.find( from_r, pos )) != std::string::npos )
+      if ( ! from_r.empty() )
       {
-        str_r.replace( pos, from_r.size(), to_r );
-        pos += to_r.size();
+       std::string::size_type pos = 0;
+       while ( (pos = str_r.find( from_r, pos )) != std::string::npos )
+       {
+         str_r.replace( pos, from_r.size(), to_r );
+         pos += to_r.size();
 
-        if ( pos >= str_r.length() )
-          break;
+         if ( pos >= str_r.length() )
+           break;
+       }
       }
       return str_r;
     }
@@ -323,15 +326,18 @@ namespace zypp
 
     std::string & replaceAllFun( std::string & str_r, const std::string & from_r, function<std::string()> to_r )
     {
-      std::string::size_type pos = 0;
-      while ( (pos = str_r.find( from_r, pos )) != std::string::npos )
+      if ( ! from_r.empty() )
       {
-       std::string to( to_r() );
-        str_r.replace( pos, from_r.size(), to );
-        pos += to.size();
+       std::string::size_type pos = 0;
+       while ( (pos = str_r.find( from_r, pos )) != std::string::npos )
+       {
+         std::string to( to_r() );
+         str_r.replace( pos, from_r.size(), to );
+         pos += to.size();
 
-        if ( pos >= str_r.length() )
-          break;
+         if ( pos >= str_r.length() )
+           break;
+       }
       }
       return str_r;
     }
index 1690ab6..8e97650 100644 (file)
@@ -145,6 +145,7 @@ namespace zypp
   /** String related utilities and \ref ZYPP_STR_REGEX.
    \see \ref ZYPP_STR_REGEX
   */
+
   namespace str
   { /////////////////////////////////////////////////////////////////
 
@@ -1007,10 +1008,12 @@ namespace zypp
     inline bool endsWith( const C_Str & str_r, const C_Str & prefix_r )
     { return hasSuffix( str_r, prefix_r ); }
     //@}
-    /////////////////////////////////////////////////////////////////
   } // namespace str
   ///////////////////////////////////////////////////////////////////
-  /////////////////////////////////////////////////////////////////
+
+  // drag into zypp:: namespace
+  using str::asString;
+
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
 #endif // ZYPP_BASE_STRING_H
index 0a5f814..12cdf5e 100644 (file)
@@ -32,10 +32,10 @@ namespace zypp
     using xml::escape;
     using xml::unescape;
 
-    /** \relates NodeAttr NODE ATTRIBUTE representation of types [str::asString] */
+    /** \relates NodeAttr NODE ATTRIBUTE representation of types [asString] */
     template <class _Tp>
     std::string asXmlNodeAttr( const _Tp & val_r )
-    { return str::asString( val_r ); }
+    { return asString( val_r ); }
 
     ///////////////////////////////////////////////////////////////////
     /// \class NodeAttr