From 15c8b67cc0651c4dd87f15c9a048bf329f2c3b1d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 1 Nov 2016 10:31:01 +0900 Subject: [PATCH] Imported Upstream version 14.31.0 Change-Id: Iefc0fd7bab9d1e05ae79e76abc9b49888c395cd3 Signed-off-by: DongHun Kwak --- VERSION.cmake | 6 +++--- libzypp.spec.cmake | 13 ------------- package/libzypp.changes | 15 +++++++++++++++ tests/sat/Solvable_test.cc | 2 +- tests/zypp/ContentType_test.cc | 3 ++- tests/zypp/CpeId_test.cc | 1 + zypp/KeyRing.cc | 35 ++++++++++++++++++++++++++--------- zypp/base/String.cc | 32 +++++++++++++++++++------------- zypp/base/String.h | 7 +++++-- zypp/base/Xml.h | 4 ++-- 10 files changed, 74 insertions(+), 44 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 2fc4a63..56c4275 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -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) #======= diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index 23cecf7..fa02c1f 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -134,17 +134,6 @@ Requires: libcurl >= %{min_curl_version} %description Package, Patch, Pattern, and Product Management -Authors: --------- - Michael Andres - Jiri Srain - Stefan Schubert - Duncan Mac-Vicar - Klaus Kaempf - Marius Tomaschewski - Stanislav Visnovsky - Ladislav Slezak - %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 diff --git a/package/libzypp.changes b/package/libzypp.changes index 9943ef2..db8d2b9 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -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) diff --git a/tests/sat/Solvable_test.cc b/tests/sat/Solvable_test.cc index 4532a5d..f4685ed 100644 --- a/tests/sat/Solvable_test.cc +++ b/tests/sat/Solvable_test.cc @@ -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" ); diff --git a/tests/zypp/ContentType_test.cc b/tests/zypp/ContentType_test.cc index 97346e6..6d7cbcb 100644 --- a/tests/zypp/ContentType_test.cc +++ b/tests/zypp/ContentType_test.cc @@ -1,4 +1,5 @@ #include +#include #include #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 +} diff --git a/tests/zypp/CpeId_test.cc b/tests/zypp/CpeId_test.cc index bce2adb..682a7f2 100644 --- a/tests/zypp/CpeId_test.cc +++ b/tests/zypp/CpeId_test.cc @@ -1,4 +1,5 @@ #include +#include #include "zypp/CpeId.h" using std::cout; diff --git a/zypp/KeyRing.cc b/zypp/KeyRing.cc index 50b8d8d..9ff1f80 100644 --- a/zypp/KeyRing.cc +++ b/zypp/KeyRing.cc @@ -98,13 +98,33 @@ namespace zypp private: struct Cache { - scoped_ptr _keyringP; - std::list _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 _data; + + private: + scoped_ptr _keyringK; + scoped_ptr _keyringP; }; typedef std::map CacheMap; @@ -112,17 +132,14 @@ namespace zypp const std::list & 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 & getData( const Pathname & keyring_r, Cache & cache_r ) const { - if ( cache_r._keyringP->hasChanged() ) + if ( cache_r.hasChanged() ) { const char* argv[] = { diff --git a/zypp/base/String.cc b/zypp/base/String.cc index 8ec8d6e..666e79a 100644 --- a/zypp/base/String.cc +++ b/zypp/base/String.cc @@ -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 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; } diff --git a/zypp/base/String.h b/zypp/base/String.h index 1690ab6..8e97650 100644 --- a/zypp/base/String.h +++ b/zypp/base/String.h @@ -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 diff --git a/zypp/base/Xml.h b/zypp/base/Xml.h index 0a5f814..12cdf5e 100644 --- a/zypp/base/Xml.h +++ b/zypp/base/Xml.h @@ -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 std::string asXmlNodeAttr( const _Tp & val_r ) - { return str::asString( val_r ); } + { return asString( val_r ); } /////////////////////////////////////////////////////////////////// /// \class NodeAttr -- 2.7.4