From f28b094010da6ff27e02f330c72bc2781e99521a Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 2 Sep 2019 16:19:43 +0900 Subject: [PATCH] Imported Upstream version 17.14.0 --- CMakeLists.txt | 12 +++++-- VERSION.cmake | 4 +-- package/libzypp.changes | 6 ++++ zypp/Arch.h | 3 ++ zypp/CMakeLists.txt | 1 + zypp/Callback.h | 2 +- zypp/CpeId.cc | 5 +++ zypp/KeyRing.h | 2 +- zypp/Patch.h | 1 + zypp/Pattern.h | 1 + zypp/PluginFrame.h | 2 +- zypp/PluginScript.h | 2 +- zypp/PoolItem.h | 4 +-- zypp/PoolItemBest.h | 2 +- zypp/ProblemSolution.h | 2 +- zypp/PublicKey.cc | 20 ++++++++++- zypp/PublicKey.h | 10 ++++-- zypp/RepoInfo.h | 2 +- zypp/RepoManager.h | 2 +- zypp/RepoStatus.h | 2 +- zypp/ResObject.h | 1 - zypp/ResPoolProxy.h | 2 +- zypp/ResStatus.h | 4 +-- zypp/ResTraits.h | 8 +++++ zypp/ResolverProblem.h | 2 +- zypp/ServiceInfo.h | 2 +- zypp/ZConfig.cc | 2 +- zypp/ZYppFactory.cc | 6 ++-- zypp/base/Easy.h | 23 ++++++++++++ zypp/base/Exception.h | 8 ++--- zypp/base/StrMatcher.h | 2 +- zypp/base/Xml.cc | 20 +++++++++++ zypp/media/CredentialManager.h | 2 +- zypp/media/MediaCD.h | 22 ++++++------ zypp/media/MediaCIFS.h | 16 ++++----- zypp/media/MediaCurl.cc | 3 ++ zypp/media/MediaCurl.h | 20 +++++------ zypp/media/MediaDIR.h | 14 ++++---- zypp/media/MediaDISK.h | 19 +++++----- zypp/media/MediaException.cc | 4 ++- zypp/media/MediaException.h | 60 +++++++++++++++---------------- zypp/media/MediaISO.h | 19 +++++----- zypp/media/MediaManager.h | 2 +- zypp/media/MediaMultiCurl.h | 4 +-- zypp/media/MediaNFS.h | 18 +++++----- zypp/media/MediaPlugin.h | 16 ++++----- zypp/media/UrlResolverPlugin.h | 2 +- zypp/parser/HistoryLogReader.h | 2 +- zypp/parser/ProductFileReader.h | 4 +-- zypp/parser/susetags/ContentFileReader.cc | 6 ++-- zypp/parser/susetags/ContentFileReader.h | 2 +- zypp/parser/xml/ParseDef.h | 2 +- zypp/repo/DeltaCandidates.h | 2 +- zypp/repo/PackageProvider.h | 2 +- zypp/repo/RepoInfoBase.h | 2 +- zypp/repo/ServiceRepos.h | 2 +- zypp/sat/LookupAttr.h | 2 +- zypp/sat/Map.cc | 2 ++ zypp/sat/SolvIterMixin.h | 12 ++----- zypp/sat/Transaction.cc | 2 ++ zypp/sat/Transaction.h | 2 +- zypp/sat/WhatProvides.h | 2 +- zypp/sat/detail/PoolMember.h | 2 +- zypp/solver/detail/Types.h | 2 +- zypp/target/modalias/Modalias.h | 2 +- zypp/ui/Selectable.h | 2 +- zypp/zypp_detail/ZYppImpl.cc | 6 ++-- zypp/zypp_detail/ZYppImpl.h | 2 -- 68 files changed, 270 insertions(+), 178 deletions(-) create mode 100644 zypp/base/Xml.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index ff17324..1c018ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,8 @@ OPTION (DISABLE_AUTODOCS "Do not require doxygen being installed (required to bu #-------------------------------------------------------------------------------- SET (have_system x) +set (CMAKE_CXX_STANDARD 14) + IF (DEBIAN) MESSAGE (STATUS "Building for Debian") SET (ENABLE_BUILD_DOCS ON) @@ -53,8 +55,8 @@ include(CheckCXXCompilerFlag) CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY) CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY) -SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Wl,-as-needed -Wp,-D_GLIBCXX_ASSERTIONS" ) -SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -rdynamic -Wall -Wl,-as-needed -Wp,-D_GLIBCXX_ASSERTIONS" ) +SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wp,-D_GLIBCXX_ASSERTIONS" ) +SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wp,-D_GLIBCXX_ASSERTIONS" ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden -Woverloaded-virtual -Wnon-virtual-dtor" ) @@ -69,6 +71,12 @@ IF(${CXX_FORMAT_SECURITY}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security") ENDIF(${CXX_FORMAT_SECURITY}) +if ( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + #cli args ignored by clang, it still prints a noisy warning though + SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic -Wl,-as-needed" ) + SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic -Wl,-as-needed" ) +endif() + INCLUDE(CheckFunctionExists) CHECK_FUNCTION_EXISTS(pipe2 PIPE2_FOUND) IF(${PIPE2_FOUND}) diff --git a/VERSION.cmake b/VERSION.cmake index 33e3da1..98a5f9d 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "17") SET(LIBZYPP_COMPATMINOR "12") -SET(LIBZYPP_MINOR "13") +SET(LIBZYPP_MINOR "14") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 17.13.0 (12) +# LAST RELEASED: 17.14.0 (12) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index 938b7db..31fb4db 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Aug 5 13:03:55 CEST 2019 - ma@suse.de + +- PublicKey::algoName: supply key algorithm and length +- version 17.14.0 (12) + +------------------------------------------------------------------- Thu Jul 25 17:25:10 CEST 2019 - ma@suse.de - MediaCurl: Fix leaking filedescriptors (bsc#1116995) diff --git a/zypp/Arch.h b/zypp/Arch.h index e781b19..d726671 100644 --- a/zypp/Arch.h +++ b/zypp/Arch.h @@ -345,6 +345,9 @@ namespace std { ///////////////////////////////////////////////////////////////// /** \relates zypp::Arch Default order for std::container based Arch::compare.*/ template<> +#ifdef __clang__ +constexpr +#endif inline bool less::operator()( const zypp::Arch & lhs, const zypp::Arch & rhs ) const { return lhs.compare( rhs ) < 0; } ///////////////////////////////////////////////////////////////// diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt index 3d3629a..31adeb2 100644 --- a/zypp/CMakeLists.txt +++ b/zypp/CMakeLists.txt @@ -224,6 +224,7 @@ SET( zypp_base_SRCS base/Sysconfig.cc base/ProfilingFormater.cc base/LogControl.cc + base/Xml.cc ) SET( zypp_base_HEADERS diff --git a/zypp/Callback.h b/zypp/Callback.h index 3baf8c0..99037f2 100644 --- a/zypp/Callback.h +++ b/zypp/Callback.h @@ -161,7 +161,7 @@ namespace zypp /** */ template - class DistributeReport; + struct DistributeReport; /** */ template diff --git a/zypp/CpeId.cc b/zypp/CpeId.cc index acce8b2..1496c1e 100644 --- a/zypp/CpeId.cc +++ b/zypp/CpeId.cc @@ -75,6 +75,8 @@ namespace zypp } // namespace /////////////////////////////////////////////////////////////////// + constexpr CpeId::NoThrowType CpeId::noThrow; + /////////////////////////////////////////////////////////////////// /// \class CpeId::Impl /// \brief CpeId implementation. @@ -442,6 +444,9 @@ namespace zypp const CpeId::Value CpeId::Value::ANY; const CpeId::Value CpeId::Value::NA( "" ); + constexpr CpeId::Value::FsFormatType CpeId::Value::fsFormat; + constexpr CpeId::Value::UriFormatType CpeId::Value::uriFormat; + CpeId::Value::Value( const std::string & value_r ) { if ( value_r.empty() ) // NA diff --git a/zypp/KeyRing.h b/zypp/KeyRing.h index d230836..618be9b 100644 --- a/zypp/KeyRing.h +++ b/zypp/KeyRing.h @@ -201,7 +201,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; public: /** Default ctor */ diff --git a/zypp/Patch.h b/zypp/Patch.h index b3d240b..14eb738 100644 --- a/zypp/Patch.h +++ b/zypp/Patch.h @@ -15,6 +15,7 @@ #include "zypp/base/Flags.h" #include "zypp/sat/SolvAttr.h" #include "zypp/ResObject.h" +#include "zypp/sat/SolvableSet.h" /////////////////////////////////////////////////////////////////// namespace zypp diff --git a/zypp/Pattern.h b/zypp/Pattern.h index 6d94263..5daa650 100644 --- a/zypp/Pattern.h +++ b/zypp/Pattern.h @@ -14,6 +14,7 @@ #include "zypp/ResObject.h" #include "zypp/Pathname.h" +#include "zypp/sat/SolvableSet.h" /////////////////////////////////////////////////////////////////// namespace zypp diff --git a/zypp/PluginFrame.h b/zypp/PluginFrame.h index 96c7bad..cb44e63 100644 --- a/zypp/PluginFrame.h +++ b/zypp/PluginFrame.h @@ -247,7 +247,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; private: /** Pointer to implementation */ RWCOW_pointer _pimpl; diff --git a/zypp/PluginScript.h b/zypp/PluginScript.h index fa64aa8..a2a40ff 100644 --- a/zypp/PluginScript.h +++ b/zypp/PluginScript.h @@ -182,7 +182,7 @@ namespace zypp public: /** Implementation. */ - class Impl; + struct Impl; private: /** Pointer to implementation. */ RW_pointer _pimpl; diff --git a/zypp/PoolItem.h b/zypp/PoolItem.h index 922ad53..8b5e946 100644 --- a/zypp/PoolItem.h +++ b/zypp/PoolItem.h @@ -144,7 +144,7 @@ namespace zypp void setBuddy( const sat::Solvable & solv_r ); /** internal ctor */ public: - class Impl; ///< Expose type only + struct Impl; ///< Expose type only private: explicit PoolItem( Impl * implptr_r ); /** Pointer to implementation */ @@ -154,7 +154,7 @@ namespace zypp /** \name tmp hack for save/restore state. */ /** \todo get rid of it. */ //@{ - friend class PoolItemSaver; + friend struct PoolItemSaver; void saveState() const; void restoreState() const; bool sameState() const; diff --git a/zypp/PoolItemBest.h b/zypp/PoolItemBest.h index b4ebc6b..a93e134 100644 --- a/zypp/PoolItemBest.h +++ b/zypp/PoolItemBest.h @@ -144,7 +144,7 @@ namespace zypp const Container & container() const; private: /** Implementation */ - class Impl; + struct Impl; /** Pointer to implementation */ RWCOW_pointer & pimpl() { return *(reinterpret_cast*>( _dont_use_this_use_pimpl.get() )); } /** Pointer to implementation */ diff --git a/zypp/ProblemSolution.h b/zypp/ProblemSolution.h index 56ee1ce..8144917 100644 --- a/zypp/ProblemSolution.h +++ b/zypp/ProblemSolution.h @@ -92,7 +92,7 @@ namespace zypp private: - class Impl; + struct Impl; RWCOW_pointer _pimpl; }; diff --git a/zypp/PublicKey.cc b/zypp/PublicKey.cc index 4580d7c..e251a39 100644 --- a/zypp/PublicKey.cc +++ b/zypp/PublicKey.cc @@ -102,6 +102,15 @@ namespace zypp return ret; } + std::string keyAlgoName( const gpgme_subkey_t & key_r ) + { + std::string ret; + if ( const char * n = ::gpgme_pubkey_algo_name( key_r->pubkey_algo ) ) + ret = str::Str() << n << ' ' << key_r->length; + else + ret = "?"; + return ret; + } } //namespace /////////////////////////////////////////////////////////////////// @@ -190,6 +199,7 @@ namespace zypp std::string _id; std::string _name; std::string _fingerprint; + std::string _algoName; Date _created; Date _expires; @@ -245,6 +255,7 @@ namespace zypp data->_expires = zypp::Date(sKey->expires); data->_fingerprint = str::asString(sKey->fpr); + data->_algoName = keyAlgoName( sKey ); data->_id = str::asString(sKey->keyid); //get the primary user ID @@ -298,6 +309,9 @@ namespace zypp std::string PublicKeyData::fingerprint() const { return _pimpl->_fingerprint; } + std::string PublicKeyData::algoName() const + { return _pimpl->_algoName; } + Date PublicKeyData::created() const { return _pimpl->_created; } @@ -345,13 +359,14 @@ namespace zypp } PublicKeyData::AsciiArt PublicKeyData::asciiArt() const - { return AsciiArt( fingerprint() /* TODO: key algorithm could be added as top tile. */ ); } + { return AsciiArt( fingerprint(), algoName() ); } std::ostream & dumpOn( std::ostream & str, const PublicKeyData & obj ) { str << "[" << obj.name() << "]" << endl; str << " fpr " << obj.fingerprint() << endl; str << " id " << obj.id() << endl; + str << " alg " << obj.algoName() << endl; str << " cre " << Date::ValueType(obj.created()) << ' ' << obj.created() << endl; str << " exp " << Date::ValueType(obj.expires()) << ' ' << obj.expiresAsString() << endl; str << " ttl " << obj.daysToLive() << endl; @@ -515,6 +530,9 @@ namespace zypp std::string PublicKey::fingerprint() const { return keyData().fingerprint(); } + std::string PublicKey::algoName() const + { return keyData().algoName(); } + Date PublicKey::created() const { return keyData().created(); } diff --git a/zypp/PublicKey.h b/zypp/PublicKey.h index 9f00378..6b7a50f 100644 --- a/zypp/PublicKey.h +++ b/zypp/PublicKey.h @@ -115,7 +115,7 @@ namespace zypp std::string asString() const; private: - class Impl; + struct Impl; RWCOW_pointer _pimpl; friend class PublicKeyData; friend std::ostream & dumpOn( std::ostream & str, const PublicKeyData & obj ); @@ -157,6 +157,9 @@ namespace zypp /** Key fingerprint.*/ std::string fingerprint() const; + /** Key algorithm string like `RSA 2048` */ + std::string algoName() const; + /** Creation / last modification date (latest selfsig). */ Date created() const; @@ -233,7 +236,7 @@ namespace zypp AsciiArt asciiArt() const; private: - class Impl; + struct Impl; RWCOW_pointer _pimpl; friend class KeyManagerCtx; @@ -273,7 +276,7 @@ namespace zypp { public: /** Implementation */ - class Impl; + struct Impl; public: /** Default ctor. */ @@ -311,6 +314,7 @@ namespace zypp std::string id() const; //!< \see \ref PublicKeyData std::string name() const; //!< \see \ref PublicKeyData std::string fingerprint() const; //!< \see \ref PublicKeyData + std::string algoName() const; //!< \see \ref PublicKeyData Date created() const; //!< \see \ref PublicKeyData Date expires() const; //!< \see \ref PublicKeyData std::string expiresAsString() const; //!< \see \ref PublicKeyData diff --git a/zypp/RepoInfo.h b/zypp/RepoInfo.h index 11f3f62..4c2804c 100644 --- a/zypp/RepoInfo.h +++ b/zypp/RepoInfo.h @@ -541,7 +541,7 @@ namespace zypp */ virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const; - class Impl; + struct Impl; private: friend class RepoManager; /** Raw values for RepoManager */ diff --git a/zypp/RepoManager.h b/zypp/RepoManager.h index 5f14287..ac3e206 100644 --- a/zypp/RepoManager.h +++ b/zypp/RepoManager.h @@ -108,7 +108,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; /** ServiceInfo typedefs */ typedef std::set ServiceSet; diff --git a/zypp/RepoStatus.h b/zypp/RepoStatus.h index 587a507..1eaa2da 100644 --- a/zypp/RepoStatus.h +++ b/zypp/RepoStatus.h @@ -77,7 +77,7 @@ namespace zypp Date timestamp() const; public: - class Impl; ///< Implementation + struct Impl; ///< Implementation private: RWCOW_pointer _pimpl; ///< Pointer to implementation }; diff --git a/zypp/ResObject.h b/zypp/ResObject.h index 17afa2b..c896f3f 100644 --- a/zypp/ResObject.h +++ b/zypp/ResObject.h @@ -18,7 +18,6 @@ #include "zypp/Vendor.h" #include "zypp/sat/LookupAttr.h" -#include "zypp/sat/SolvableSet.h" /////////////////////////////////////////////////////////////////// namespace zypp diff --git a/zypp/ResPoolProxy.h b/zypp/ResPoolProxy.h index 94136ba..75550d8 100644 --- a/zypp/ResPoolProxy.h +++ b/zypp/ResPoolProxy.h @@ -39,7 +39,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; typedef MapKVIteratorTraits::Value_const_iterator const_iterator; typedef SelectablePool::size_type size_type; diff --git a/zypp/ResStatus.h b/zypp/ResStatus.h index a7e7dd3..89ebe40 100644 --- a/zypp/ResStatus.h +++ b/zypp/ResStatus.h @@ -22,7 +22,7 @@ namespace zypp namespace resstatus { - class UserLockQueryManip; + struct UserLockQueryManip; class StatusBackup; } @@ -322,7 +322,7 @@ namespace zypp /** \name Internal hard lock maintainance */ //@{ - friend class resstatus::UserLockQueryManip; + friend struct resstatus::UserLockQueryManip; bool isUserLockQueryMatch() const { return fieldValueIs( USERLOCK_MATCH ); } diff --git a/zypp/ResTraits.h b/zypp/ResTraits.h index 33097a4..3a170c5 100644 --- a/zypp/ResTraits.h +++ b/zypp/ResTraits.h @@ -89,6 +89,14 @@ namespace zypp static bool isPseudoInstalled() { return traits::isPseudoInstalled( kind ); } }; + // Defined in ResKind.cc + template<> const ResKind ResTraits::kind; + template<> const ResKind ResTraits::kind; + template<> const ResKind ResTraits::kind; + template<> const ResKind ResTraits::kind; + template<> const ResKind ResTraits::kind; + template<> const ResKind ResTraits::kind; + /** ResTraits specialisation for Resolvable. * Resolvable is common base and has no Kind value. */ diff --git a/zypp/ResolverProblem.h b/zypp/ResolverProblem.h index 548f780..f19ce62 100644 --- a/zypp/ResolverProblem.h +++ b/zypp/ResolverProblem.h @@ -89,7 +89,7 @@ namespace zypp void addSolution( ProblemSolution_Ptr solution, bool inFront = false ); private: - class Impl; + struct Impl; RWCOW_pointer _pimpl; }; diff --git a/zypp/ServiceInfo.h b/zypp/ServiceInfo.h index e5b27cb..35f8a24 100644 --- a/zypp/ServiceInfo.h +++ b/zypp/ServiceInfo.h @@ -208,7 +208,7 @@ namespace zypp */ virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const; - class Impl; + struct Impl; private: RWCOW_pointer _pimpl; diff --git a/zypp/ZConfig.cc b/zypp/ZConfig.cc index 2be2503..1416f95 100644 --- a/zypp/ZConfig.cc +++ b/zypp/ZConfig.cc @@ -706,7 +706,7 @@ namespace zypp // _specMap[root] - scan root/zypp.conf and root/multiversion.d if ( root_r.empty() ) - root_r == "/"; + root_r = "/"; bool cacheHit = _specMap.count( root_r ); MultiversionSpec & ret( _specMap[root_r] ); // creates new entry on the fly diff --git a/zypp/ZYppFactory.cc b/zypp/ZYppFactory.cc index 0fd500d..6712196 100644 --- a/zypp/ZYppFactory.cc +++ b/zypp/ZYppFactory.cc @@ -190,7 +190,7 @@ namespace zypp bool isProcessRunning( pid_t pid_r ) { // it is another program, not me, see if it is still running - Pathname procdir( "/proc"/str::numstring(pid_r) ); + Pathname procdir( Pathname("/proc")/str::numstring(pid_r) ); PathInfo status( procdir ); MIL << "Checking " << status << endl; @@ -371,7 +371,7 @@ namespace zypp { MIL << "Waiting whether pid " << globalLock().lockerPid() << " ends within $LOCK_TIMEOUT=" << LOCK_TIMEOUT << " sec." << endl; unsigned delay = 1; - Pathname procdir( "/proc"/str::numstring(globalLock().lockerPid()) ); + Pathname procdir( Pathname("/proc")/str::numstring(globalLock().lockerPid()) ); for ( long i = 0; i < LOCK_TIMEOUT; i += delay ) { if ( PathInfo( procdir ).isDir() ) // wait for /proc/pid to disapear @@ -384,7 +384,7 @@ namespace zypp { // another proc locked faster. maybe it ends fast as well.... MIL << "Waiting whether pid " << globalLock().lockerPid() << " ends within " << (LOCK_TIMEOUT-i) << " sec." << endl; - procdir = Pathname( "/proc"/str::numstring(globalLock().lockerPid()) ); + procdir = Pathname( Pathname("/proc")/str::numstring(globalLock().lockerPid()) ); } else { diff --git a/zypp/base/Easy.h b/zypp/base/Easy.h index e560043..9088901 100644 --- a/zypp/base/Easy.h +++ b/zypp/base/Easy.h @@ -13,6 +13,7 @@ #define ZYPP_BASE_EASY_H #include +#include /** Convenient for-loops using iterator. * \code @@ -89,6 +90,28 @@ NON_MOVABLE(CLASS); \ DEFAULT_COPYABLE(CLASS) + +/** Prevent an universal ctor to be chosen as copy ctor. + * \code + * struct FeedStrings + * { + * template> + * FeedStrings( TARG && arg_r ) + * : _value { std::forward( arg_r ) } + * {} + * + * // Same with variadic template. Could be chosen as copy_ctor. + * template + * FeedStrings( Us &&... us ) + * : ... + * + * private: + * std::string _value; + * \endcode + */ +template +using disable_use_as_copy_ctor = typename std::enable_if::type>::value>::type; + /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// diff --git a/zypp/base/Exception.h b/zypp/base/Exception.h index 0e4d090..42c4d80 100644 --- a/zypp/base/Exception.h +++ b/zypp/base/Exception.h @@ -326,7 +326,7 @@ namespace zypp /** Helper for \ref ZYPP_THROW( Exception ). */ template = 0> void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn)); - template = 0> + template> void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r ) { excpt_r.relocate( where_r ); @@ -337,7 +337,7 @@ namespace zypp /** Helper for \ref ZYPP_THROW( not Exception ). */ template = 0> void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn)); - template = 0> + template> void do_ZYPP_THROW( const TExcpt & excpt_r, const CodeLocation & where_r ) { Exception::log( typeid(excpt_r).name(), where_r, "THROW: " ); @@ -363,7 +363,7 @@ namespace zypp /** Helper for \ref ZYPP_THROW( Exception ). */ template = 0> void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn)); - template = 0> + template> void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r ) { Exception::log( excpt_r, where_r, "RETHROW: " ); @@ -374,7 +374,7 @@ namespace zypp /** Helper for \ref ZYPP_THROW( not Exception ). */ template = 0> void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r ) __attribute__((noreturn)); - template = 0> + template> void do_ZYPP_RETHROW( const TExcpt & excpt_r, const CodeLocation & where_r ) { Exception::log( excpt_r, where_r, "RETHROW: " ); diff --git a/zypp/base/StrMatcher.h b/zypp/base/StrMatcher.h index 8e28ca6..5a8c889 100644 --- a/zypp/base/StrMatcher.h +++ b/zypp/base/StrMatcher.h @@ -303,7 +303,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; public: /** Default ctor matches nothing. */ diff --git a/zypp/base/Xml.cc b/zypp/base/Xml.cc new file mode 100644 index 0000000..3b186c5 --- /dev/null +++ b/zypp/base/Xml.cc @@ -0,0 +1,20 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/base/Xml.cc + * +*/ +#include "Xml.h" + +namespace zypp +{ + namespace xmlout + { + constexpr Node::OptionalContentType Node::optionalContent; + } +} diff --git a/zypp/media/CredentialManager.h b/zypp/media/CredentialManager.h index 19018df..1a57c64 100644 --- a/zypp/media/CredentialManager.h +++ b/zypp/media/CredentialManager.h @@ -169,7 +169,7 @@ namespace zypp CredentialSize credsUserSize() const; bool credsUserEmpty() const; - class Impl; + struct Impl; private: RW_pointer _pimpl; }; diff --git a/zypp/media/MediaCD.h b/zypp/media/MediaCD.h index 03cee50..4320988 100644 --- a/zypp/media/MediaCD.h +++ b/zypp/media/MediaCD.h @@ -43,32 +43,32 @@ namespace zypp { protected: - virtual void attachTo (bool next = false); - virtual void releaseFrom( const std::string & ejectDev ); + virtual void attachTo (bool next = false) override; + virtual void releaseFrom( const std::string & ejectDev ) override; virtual void getFile(const Pathname & filename, const ByteCount &expectedFileSize_r ) const override; - virtual void getDir( const Pathname & dirname, bool recurse_r ) const; + virtual void getDir( const Pathname & dirname, bool recurse_r ) const override; virtual void getDirInfo( std::list & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; virtual void getDirInfo( filesystem::DirContent & retlist, - const Pathname & dirname, bool dots = true ) const; - virtual bool getDoesFileExist( const Pathname & filename ) const; + const Pathname & dirname, bool dots = true ) const override; + virtual bool getDoesFileExist( const Pathname & filename ) const override; - virtual void forceEject(const std::string & ejectDev); + virtual void forceEject(const std::string & ejectDev) override; - virtual bool hasMoreDevices(); + virtual bool hasMoreDevices() override; virtual void getDetectedDevices(std::vector & devices, - unsigned int & index) const; + unsigned int & index) const override; public: MediaCD( const Url & url_r, const Pathname & attach_point_hint_r ); - virtual ~MediaCD() { try { release(); } catch(...) {} } + virtual ~MediaCD() override { try { release(); } catch(...) {} } - virtual bool isAttached() const; + virtual bool isAttached() const override; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/media/MediaCIFS.h b/zypp/media/MediaCIFS.h index 29bb9c7..adce533 100644 --- a/zypp/media/MediaCIFS.h +++ b/zypp/media/MediaCIFS.h @@ -33,23 +33,23 @@ namespace zypp { protected: - virtual void attachTo (bool next = false); - virtual void releaseFrom( const std::string & ejectDev ); + virtual void attachTo (bool next = false) override; + virtual void releaseFrom( const std::string & ejectDev ) override; virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override; - virtual void getDir( const Pathname & dirname, bool recurse_r ) const; + virtual void getDir( const Pathname & dirname, bool recurse_r ) const override; virtual void getDirInfo( std::list & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; virtual void getDirInfo( filesystem::DirContent & retlist, - const Pathname & dirname, bool dots = true ) const; - virtual bool getDoesFileExist( const Pathname & filename ) const; + const Pathname & dirname, bool dots = true ) const override; + virtual bool getDoesFileExist( const Pathname & filename ) const override; public: MediaCIFS( const Url& url_r, const Pathname & attach_point_hint_r ); - virtual ~MediaCIFS() { try { release(); } catch(...) {} } + virtual ~MediaCIFS() override { try { release(); } catch(...) {} } - virtual bool isAttached() const; + virtual bool isAttached() const override; private: bool authenticate( AuthData & authdata, bool firstTry ) const; diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc index af4c5f7..20f0f5a 100644 --- a/zypp/media/MediaCurl.cc +++ b/zypp/media/MediaCurl.cc @@ -1807,6 +1807,9 @@ bool MediaCurl::authenticate(const string & availAuthTypes, bool firstTry) const return false; } +//need a out of line definiton, otherwise vtable is emitted for every translation unit +MediaCurl::Callbacks::~Callbacks() {} + } // namespace media } // namespace zypp diff --git a/zypp/media/MediaCurl.h b/zypp/media/MediaCurl.h index 0d5adaa..fe9c369 100644 --- a/zypp/media/MediaCurl.h +++ b/zypp/media/MediaCurl.h @@ -51,20 +51,20 @@ class MediaCurl : public MediaHandler Url clearQueryString(const Url &url) const; - virtual void attachTo (bool next = false); - virtual void releaseFrom( const std::string & ejectDev ); + virtual void attachTo (bool next = false) override; + virtual void releaseFrom( const std::string & ejectDev ) override; virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override; - virtual void getDir( const Pathname & dirname, bool recurse_r ) const; + virtual void getDir( const Pathname & dirname, bool recurse_r ) const override; virtual void getDirInfo( std::list & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; virtual void getDirInfo( filesystem::DirContent & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; /** * Repeatedly calls doGetDoesFileExist() until it successfully returns, * fails unexpectedly, or user cancels the operation. This is used to * handle authentication or similar retry scenarios on media level. */ - virtual bool getDoesFileExist( const Pathname & filename ) const; + virtual bool getDoesFileExist( const Pathname & filename ) const override; /** * \see MediaHandler::getDoesFileExist @@ -76,7 +76,7 @@ class MediaCurl : public MediaHandler * \throws MediaException * */ - virtual void disconnectFrom(); + virtual void disconnectFrom() override; /** * * \throws MediaException @@ -92,14 +92,14 @@ class MediaCurl : public MediaHandler virtual void doGetFileCopy( const Pathname & srcFilename, const Pathname & targetFilename, callback::SendReport & _report, const ByteCount &expectedFileSize_r, RequestOptions options = OPTION_NONE ) const; - virtual bool checkAttachPoint(const Pathname &apoint) const; + virtual bool checkAttachPoint(const Pathname &apoint) const override; public: MediaCurl( const Url & url_r, const Pathname & attach_point_hint_r ); - virtual ~MediaCurl() { try { release(); } catch(...) {} } + virtual ~MediaCurl() override { try { release(); } catch(...) {} } TransferSettings & settings(); @@ -108,7 +108,7 @@ class MediaCurl : public MediaHandler class Callbacks { public: - virtual ~Callbacks() {} + virtual ~Callbacks(); virtual bool progress( int percent ) = 0; }; diff --git a/zypp/media/MediaDIR.h b/zypp/media/MediaDIR.h index 988c5bf..fb2309f 100644 --- a/zypp/media/MediaDIR.h +++ b/zypp/media/MediaDIR.h @@ -29,22 +29,22 @@ namespace zypp { protected: - virtual void attachTo (bool next = false); - virtual void releaseFrom( const std::string & ejectDev ); + virtual void attachTo (bool next = false) override; + virtual void releaseFrom( const std::string & ejectDev ) override; virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override; - virtual void getDir( const Pathname & dirname, bool recurse_r ) const; + virtual void getDir( const Pathname & dirname, bool recurse_r ) const override; virtual void getDirInfo( std::list & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; virtual void getDirInfo( filesystem::DirContent & retlist, - const Pathname & dirname, bool dots = true ) const; - virtual bool getDoesFileExist( const Pathname & filename ) const; + const Pathname & dirname, bool dots = true ) const override; + virtual bool getDoesFileExist( const Pathname & filename ) const override; public: MediaDIR( const Url & url_r, const Pathname & attach_point_hint_r ); - virtual ~MediaDIR() { try { release(); } catch(...) {} } + virtual ~MediaDIR() override { try { release(); } catch(...) {} } }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/media/MediaDISK.h b/zypp/media/MediaDISK.h index 8b2dc9e..ffd74a3 100644 --- a/zypp/media/MediaDISK.h +++ b/zypp/media/MediaDISK.h @@ -27,32 +27,29 @@ namespace zypp { class MediaDISK : public MediaHandler { private: - - unsigned long _mountflags; - std::string _device; std::string _filesystem; protected: - virtual void attachTo (bool next = false); - virtual void releaseFrom( const std::string & ejectDev ); + virtual void attachTo (bool next = false) override; + virtual void releaseFrom( const std::string & ejectDev ) override; virtual void getFile(const Pathname & filename, const ByteCount &expectedFileSize_r ) const override; - virtual void getDir( const Pathname & dirname, bool recurse_r ) const; + virtual void getDir( const Pathname & dirname, bool recurse_r ) const override; virtual void getDirInfo( std::list & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; virtual void getDirInfo( filesystem::DirContent & retlist, - const Pathname & dirname, bool dots = true ) const; - virtual bool getDoesFileExist( const Pathname & filename ) const; + const Pathname & dirname, bool dots = true ) const override; + virtual bool getDoesFileExist( const Pathname & filename ) const override; public: MediaDISK( const Url & url_r, const Pathname & attach_point_hint_r ); - virtual ~MediaDISK() { try { release(); } catch(...) {} } + virtual ~MediaDISK() override { try { release(); } catch(...) {} } - virtual bool isAttached() const; + virtual bool isAttached() const override; bool verifyIfDiskVolume(const Pathname &name); }; diff --git a/zypp/media/MediaException.cc b/zypp/media/MediaException.cc index 81c8ad4..82b6def 100644 --- a/zypp/media/MediaException.cc +++ b/zypp/media/MediaException.cc @@ -26,6 +26,8 @@ namespace zypp namespace media { ///////////////////////////////////////////////////////////////// + MediaException::~MediaException () noexcept {} + std::ostream & MediaMountException::dumpOn( std::ostream & str ) const { str << form(_("Failed to mount %s on %s"), _source.c_str(), _target.c_str() ); @@ -214,7 +216,7 @@ namespace zypp return str; } - ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// } // namespace media } // namespace zypp /////////////////////////////////////////////////////////////////// diff --git a/zypp/media/MediaException.h b/zypp/media/MediaException.h index 1ffea3f..18e6689 100644 --- a/zypp/media/MediaException.h +++ b/zypp/media/MediaException.h @@ -48,7 +48,7 @@ namespace zypp {} /** Dtor. */ - virtual ~MediaException() throw() {}; + virtual ~MediaException() noexcept override; }; class MediaMountException : public MediaException @@ -72,7 +72,7 @@ namespace zypp , _cmdout(cmdout_r) {} /** Dtor. */ - virtual ~MediaMountException() throw() {}; + virtual ~MediaMountException() noexcept {} const std::string & mountError() const { return _error; } @@ -105,7 +105,7 @@ namespace zypp , _path(path_r) {} /** Dtor. */ - virtual ~MediaUnmountException() throw() {}; + virtual ~MediaUnmountException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -120,7 +120,7 @@ namespace zypp : MediaException() , _filename(filename_r) {} - virtual ~MediaBadFilenameException() throw() {}; + virtual ~MediaBadFilenameException() noexcept {} std::string filename() const { return _filename; } protected: virtual std::ostream & dumpOn( std::ostream & str ) const; @@ -135,7 +135,7 @@ namespace zypp : MediaException() , _action(action_r) {} - virtual ~MediaNotOpenException() throw() {}; + virtual ~MediaNotOpenException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -151,7 +151,7 @@ namespace zypp , _url(url_r.asString()) , _filename(filename_r.asString()) {} - virtual ~MediaFileNotFoundException() throw() {}; + virtual ~MediaFileNotFoundException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -166,7 +166,7 @@ namespace zypp : MediaException() , _filename(filename_r.asString()) {} - virtual ~MediaWriteException() throw() {}; + virtual ~MediaWriteException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -180,7 +180,7 @@ namespace zypp : MediaException() , _url(url_r.asString()) {} - virtual ~MediaNotAttachedException() throw() {}; + virtual ~MediaNotAttachedException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -194,7 +194,7 @@ namespace zypp : MediaException() , _url(url_r.asString()) {} - virtual ~MediaBadAttachPointException() throw() {}; + virtual ~MediaBadAttachPointException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -208,7 +208,7 @@ namespace zypp : MediaException() , _url(url_r.asString()) {} - virtual ~MediaCurlInitException() throw() {}; + virtual ~MediaCurlInitException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -224,7 +224,7 @@ namespace zypp , _url(url_r.asString()) , _message(message_r) {} - virtual ~MediaSystemException() throw() {}; + virtual ~MediaSystemException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -241,7 +241,7 @@ namespace zypp , _url(url_r.asString()) , _path(path_r.asString()) {} - virtual ~MediaNotAFileException() throw() {}; + virtual ~MediaNotAFileException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -258,7 +258,7 @@ namespace zypp , _url(url_r.asString()) , _path(path_r.asString()) {} - virtual ~MediaNotADirException() throw() {}; + virtual ~MediaNotADirException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -275,7 +275,7 @@ namespace zypp , _url(url_r.asString()) , _msg(msg_r) {} - virtual ~MediaBadUrlException() throw() {}; + virtual ~MediaBadUrlException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; @@ -288,7 +288,7 @@ namespace zypp MediaBadUrlEmptyHostException(const Url & url_r) : MediaBadUrlException(url_r) {} - virtual ~MediaBadUrlEmptyHostException() throw() {}; + virtual ~MediaBadUrlEmptyHostException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; }; @@ -299,7 +299,7 @@ namespace zypp MediaBadUrlEmptyFilesystemException(const Url & url_r) : MediaBadUrlException(url_r) {} - virtual ~MediaBadUrlEmptyFilesystemException() throw() {}; + virtual ~MediaBadUrlEmptyFilesystemException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; }; @@ -310,7 +310,7 @@ namespace zypp MediaBadUrlEmptyDestinationException(const Url & url_r) : MediaBadUrlException(url_r) {} - virtual ~MediaBadUrlEmptyDestinationException() throw() {}; + virtual ~MediaBadUrlEmptyDestinationException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; }; @@ -321,7 +321,7 @@ namespace zypp MediaUnsupportedUrlSchemeException(const Url & url_r) : MediaBadUrlException(url_r) {} - virtual ~MediaUnsupportedUrlSchemeException() throw() {}; + virtual ~MediaUnsupportedUrlSchemeException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; }; @@ -333,7 +333,7 @@ namespace zypp : MediaException() , _url(url_r.asString()) {} - virtual ~MediaNotSupportedException() throw() {}; + virtual ~MediaNotSupportedException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; @@ -350,7 +350,7 @@ namespace zypp , _err(err_r) , _msg(msg_r) {} - virtual ~MediaCurlException() throw() {}; + virtual ~MediaCurlException() noexcept {} std::string errstr() const { return _err; } protected: virtual std::ostream & dumpOn( std::ostream & str ) const; @@ -367,7 +367,7 @@ namespace zypp , _url(url_r.asString()) , _msg(msg_r) {} - virtual ~MediaCurlSetOptException() throw() {}; + virtual ~MediaCurlSetOptException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; @@ -381,7 +381,7 @@ namespace zypp : MediaException() , _url(url_r.asString()) {} - virtual ~MediaNotDesiredException() throw() {}; + virtual ~MediaNotDesiredException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -398,7 +398,7 @@ namespace zypp : MediaException() , _name(name) {} - virtual ~MediaIsSharedException() throw() {}; + virtual ~MediaIsSharedException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -417,7 +417,7 @@ namespace zypp : MediaException("Can't eject media") , _name(name) {} - virtual ~MediaNotEjectedException() throw() {}; + virtual ~MediaNotEjectedException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; private: @@ -444,7 +444,7 @@ namespace zypp , _hint(hint_r) {} - virtual ~MediaUnauthorizedException() throw() {}; + virtual ~MediaUnauthorizedException() noexcept {} const Url & url() const { return _url; } const std::string & err() const { return _err; } @@ -466,7 +466,7 @@ namespace zypp : MediaException(msg) , _url(url_r.asString()), _msg(msg) {} - virtual ~MediaForbiddenException() throw() {}; + virtual ~MediaForbiddenException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; @@ -480,7 +480,7 @@ namespace zypp : MediaException(msg) , _url(url_r.asString()), _msg(msg) {} - virtual ~MediaTimeoutException() throw() {}; + virtual ~MediaTimeoutException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; @@ -496,7 +496,7 @@ namespace zypp , _msg(msg) , _expectedFileSize(cnt_r) {} - virtual ~MediaFileSizeExceededException() throw() {}; + virtual ~MediaFileSizeExceededException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; @@ -512,7 +512,7 @@ namespace zypp : MediaException(msg) , _url(url_r.asString()), _msg(msg) {} - virtual ~MediaTemporaryProblemException() throw() {}; + virtual ~MediaTemporaryProblemException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; @@ -526,7 +526,7 @@ namespace zypp : MediaException(msg) , _url(url_r.asString()), _msg(msg) {} - virtual ~MediaBadCAException() throw() {}; + virtual ~MediaBadCAException() noexcept {} protected: virtual std::ostream & dumpOn( std::ostream & str ) const; std::string _url; diff --git a/zypp/media/MediaISO.h b/zypp/media/MediaISO.h index 032a3b4..ece2408 100644 --- a/zypp/media/MediaISO.h +++ b/zypp/media/MediaISO.h @@ -36,20 +36,19 @@ namespace zypp { private: Pathname _isofile; - MediaAccessId _isosource; std::string _filesystem; protected: - virtual void attachTo (bool next = false); - virtual void releaseFrom( const std::string & ejectDev = "" ); - virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const; - virtual void getDir( const Pathname & dirname, bool recurse_r ) const; + virtual void attachTo (bool next = false) override; + virtual void releaseFrom( const std::string & ejectDev = "" ) override; + virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override; + virtual void getDir( const Pathname & dirname, bool recurse_r ) const override; virtual void getDirInfo( std::list & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; virtual void getDirInfo( filesystem::DirContent & retlist, - const Pathname & dirname, bool dots = true ) const; - virtual bool getDoesFileExist( const Pathname & filename ) const; + const Pathname & dirname, bool dots = true ) const override; + virtual bool getDoesFileExist( const Pathname & filename ) const override; public: @@ -57,10 +56,10 @@ namespace zypp const Pathname &attach_point_hint_r); virtual - ~MediaISO(); + ~MediaISO() override; virtual bool - isAttached() const; + isAttached() const override; }; diff --git a/zypp/media/MediaManager.h b/zypp/media/MediaManager.h index faed227..f2fb3da 100644 --- a/zypp/media/MediaManager.h +++ b/zypp/media/MediaManager.h @@ -42,7 +42,7 @@ namespace zypp /////////////////////////////////////////////////////////////////// // forward declaration - class MountEntry; + struct MountEntry; class MediaManager_Impl; /////////////////////////////////////////////////////////////////// diff --git a/zypp/media/MediaMultiCurl.h b/zypp/media/MediaMultiCurl.h index 0c2e1ee..6b62c9d 100644 --- a/zypp/media/MediaMultiCurl.h +++ b/zypp/media/MediaMultiCurl.h @@ -43,7 +43,7 @@ public: friend class multifetchworker; MediaMultiCurl(const Url &url_r, const Pathname & attach_point_hint_r); - ~MediaMultiCurl(); + ~MediaMultiCurl() override; virtual void doGetFileCopy( const Pathname & srcFilename, const Pathname & targetFilename, callback::SendReport & _report, const ByteCount &expectedFileSize_r, RequestOptions options = OPTION_NONE ) const override; @@ -57,7 +57,7 @@ protected: CURL *fromEasyPool(const std::string &host) const; void toEasyPool(const std::string &host, CURL *easy) const; - virtual void setupEasy(); + virtual void setupEasy() override; void checkFileDigest(Url &url, FILE *fp, MediaBlockList *blklist) const; static int progressCallback( void *clientp, double dltotal, double dlnow, double ultotal, double ulnow ); diff --git a/zypp/media/MediaNFS.h b/zypp/media/MediaNFS.h index bcc084c..a67b221 100644 --- a/zypp/media/MediaNFS.h +++ b/zypp/media/MediaNFS.h @@ -37,25 +37,25 @@ namespace zypp { protected: - virtual void attachTo (bool next = false); + virtual void attachTo (bool next = false) override; - virtual void releaseFrom( const std::string & ejectDev ); - virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const; - virtual void getDir( const Pathname & dirname, bool recurse_r ) const; + virtual void releaseFrom( const std::string & ejectDev ) override; + virtual void getFile( const Pathname & filename, const ByteCount &expectedFileSize_r ) const override; + virtual void getDir( const Pathname & dirname, bool recurse_r ) const override; virtual void getDirInfo( std::list & retlist, - const Pathname & dirname, bool dots = true ) const; + const Pathname & dirname, bool dots = true ) const override; virtual void getDirInfo( filesystem::DirContent & retlist, - const Pathname & dirname, bool dots = true ) const; - virtual bool getDoesFileExist( const Pathname & filename ) const; + const Pathname & dirname, bool dots = true ) const override; + virtual bool getDoesFileExist( const Pathname & filename ) const override; public: MediaNFS( const Url& url_r, const Pathname & attach_point_hint_r ); - virtual ~MediaNFS() { try { release(); } catch(...) {} } + virtual ~MediaNFS() override { try { release(); } catch(...) {} } - virtual bool isAttached() const; + virtual bool isAttached() const override; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/media/MediaPlugin.h b/zypp/media/MediaPlugin.h index c48ceb8..53b36d8 100644 --- a/zypp/media/MediaPlugin.h +++ b/zypp/media/MediaPlugin.h @@ -31,16 +31,16 @@ namespace zypp public: MediaPlugin( const Url & url_r, const Pathname & attach_point_hint_r ); - virtual ~MediaPlugin() { try { release(); } catch(...) {} } + virtual ~MediaPlugin() override { try { release(); } catch(...) {} } protected: - virtual void attachTo( bool next_r = false ); - virtual void releaseFrom( const std::string & ejectDev_r ); - virtual void getFile( const Pathname & filename_r, const ByteCount &expectedFileSize_r ) const; - virtual void getDir( const Pathname & dirname_r, bool recurse_r ) const; - virtual void getDirInfo( std::list & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const; - virtual void getDirInfo( filesystem::DirContent & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const; - virtual bool getDoesFileExist( const Pathname & filename_r ) const; + virtual void attachTo( bool next_r = false ) override; + virtual void releaseFrom( const std::string & ejectDev_r ) override; + virtual void getFile( const Pathname & filename_r, const ByteCount &expectedFileSize_r ) const override; + virtual void getDir( const Pathname & dirname_r, bool recurse_r ) const override; + virtual void getDirInfo( std::list & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const override; + virtual void getDirInfo( filesystem::DirContent & retlist_r, const Pathname & dirname_r, bool dots_r = true ) const override; + virtual bool getDoesFileExist( const Pathname & filename_r ) const override; }; ////////////////////////////////////////////////////////////////// diff --git a/zypp/media/UrlResolverPlugin.h b/zypp/media/UrlResolverPlugin.h index b1f5bad..213fb49 100644 --- a/zypp/media/UrlResolverPlugin.h +++ b/zypp/media/UrlResolverPlugin.h @@ -36,7 +36,7 @@ namespace zypp public: - class Impl; + struct Impl; typedef std::multimap HeaderList; diff --git a/zypp/parser/HistoryLogReader.h b/zypp/parser/HistoryLogReader.h index b23f037..407834a 100644 --- a/zypp/parser/HistoryLogReader.h +++ b/zypp/parser/HistoryLogReader.h @@ -141,7 +141,7 @@ namespace zypp private: /** Implementation */ - class Impl; + struct Impl; RW_pointer > _pimpl; }; diff --git a/zypp/parser/ProductFileReader.h b/zypp/parser/ProductFileReader.h index 15b57c9..e43ba56 100644 --- a/zypp/parser/ProductFileReader.h +++ b/zypp/parser/ProductFileReader.h @@ -40,7 +40,7 @@ namespace zypp class ProductFileData { public: - class Impl; + struct Impl; /** Ctor takes ownership of \c allocated_r. */ ProductFileData( Impl * allocated_r = 0 ); @@ -72,7 +72,7 @@ namespace zypp struct Upgrade { public: - class Impl; + struct Impl; /** Ctor takes ownership of \c allocated_r. */ Upgrade( Impl * allocated_r = 0 ); diff --git a/zypp/parser/susetags/ContentFileReader.cc b/zypp/parser/susetags/ContentFileReader.cc index 1e403e2..6a53222 100644 --- a/zypp/parser/susetags/ContentFileReader.cc +++ b/zypp/parser/susetags/ContentFileReader.cc @@ -43,8 +43,7 @@ namespace zypp struct ContentFileReader::Impl { public: - Impl( const ContentFileReader & parent_r ) - : _parent( parent_r ) + Impl() {} RepoIndex & repoindex() @@ -85,7 +84,6 @@ namespace zypp std::string _inputname; private: - const ContentFileReader & _parent; RepoIndex_Ptr _repoindex; }; /////////////////////////////////////////////////////////////////// @@ -119,7 +117,7 @@ namespace zypp // void ContentFileReader::beginParse() { - _pimpl.reset( new Impl(*this) ); + _pimpl.reset( new Impl() ); // actually mandatory, but in case they were forgotten... _pimpl->repoindex().descrdir = "suse/setup/descr"; _pimpl->repoindex().datadir = "suse"; diff --git a/zypp/parser/susetags/ContentFileReader.h b/zypp/parser/susetags/ContentFileReader.h index addf838..2a0694a 100644 --- a/zypp/parser/susetags/ContentFileReader.h +++ b/zypp/parser/susetags/ContentFileReader.h @@ -85,7 +85,7 @@ namespace zypp const std::string & line_r = "-" ) const; private: - class Impl; + struct Impl; RW_pointer > _pimpl; RepoIndexConsumer _repoIndexConsumer; }; diff --git a/zypp/parser/xml/ParseDef.h b/zypp/parser/xml/ParseDef.h index 44b5261..a85b37e 100644 --- a/zypp/parser/xml/ParseDef.h +++ b/zypp/parser/xml/ParseDef.h @@ -25,7 +25,7 @@ namespace zypp { ///////////////////////////////////////////////////////////////// class Reader; - class ParseDefConsume; + struct ParseDefConsume; /////////////////////////////////////////////////////////////////// // diff --git a/zypp/repo/DeltaCandidates.h b/zypp/repo/DeltaCandidates.h index e59cd12..47e523a 100644 --- a/zypp/repo/DeltaCandidates.h +++ b/zypp/repo/DeltaCandidates.h @@ -39,7 +39,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; public: DeltaCandidates(); diff --git a/zypp/repo/PackageProvider.h b/zypp/repo/PackageProvider.h index 984692b..1604b52 100644 --- a/zypp/repo/PackageProvider.h +++ b/zypp/repo/PackageProvider.h @@ -94,7 +94,7 @@ namespace zypp bool isCached() const; public: - class Impl; ///< Implementation class. + struct Impl; ///< Implementation class. private: RW_pointer _pimpl; ///< Pointer to implementation. }; diff --git a/zypp/repo/RepoInfoBase.h b/zypp/repo/RepoInfoBase.h index e31ff59..378d765 100644 --- a/zypp/repo/RepoInfoBase.h +++ b/zypp/repo/RepoInfoBase.h @@ -157,7 +157,7 @@ namespace zypp */ virtual std::ostream & dumpAsXmlOn( std::ostream & str, const std::string & content = "" ) const; - class Impl; + struct Impl; private: /** Pointer to implementation */ RWCOW_pointer _pimpl; diff --git a/zypp/repo/ServiceRepos.h b/zypp/repo/ServiceRepos.h index ea209ab..a4d23d7 100644 --- a/zypp/repo/ServiceRepos.h +++ b/zypp/repo/ServiceRepos.h @@ -42,7 +42,7 @@ namespace zypp ~ServiceRepos(); public: - class Impl; //!< Expose type only + struct Impl; //!< Expose type only private: RW_pointer _impl; }; diff --git a/zypp/sat/LookupAttr.h b/zypp/sat/LookupAttr.h index f547e22..726cddd 100644 --- a/zypp/sat/LookupAttr.h +++ b/zypp/sat/LookupAttr.h @@ -26,7 +26,7 @@ namespace zypp class CheckSum; class Match; - class MatchException; + struct MatchException; class StrMatcher; /////////////////////////////////////////////////////////////////// diff --git a/zypp/sat/Map.cc b/zypp/sat/Map.cc index b44a1f6..f7914e9 100644 --- a/zypp/sat/Map.cc +++ b/zypp/sat/Map.cc @@ -38,6 +38,8 @@ namespace zypp namespace sat { ///////////////////////////////////////////////////////////////// + constexpr Map::PoolSizeType Map::poolSize; + Map::Map() : _pimpl( new detail::CMap ) { ::map_init( _pimpl.get(), 0 ); } diff --git a/zypp/sat/SolvIterMixin.h b/zypp/sat/SolvIterMixin.h index 4419222..232959c 100644 --- a/zypp/sat/SolvIterMixin.h +++ b/zypp/sat/SolvIterMixin.h @@ -19,25 +19,19 @@ #include "zypp/base/Hash.h" #include "zypp/sat/Solvable.h" +#include "zypp/PoolItem.h" +#include "zypp/ui/Selectable.h" /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// - class PoolItem; - class asPoolItem; // transform functor - - namespace ui - { - class asSelectable; // transform functor - } - /////////////////////////////////////////////////////////////////// namespace sat { ///////////////////////////////////////////////////////////////// class Solvable; - class asSolvable; // transform functor + //class asSolvable; // transform functor namespace solvitermixin_detail { diff --git a/zypp/sat/Transaction.cc b/zypp/sat/Transaction.cc index 2f01f90..cb45d94 100644 --- a/zypp/sat/Transaction.cc +++ b/zypp/sat/Transaction.cc @@ -36,6 +36,8 @@ namespace zypp namespace sat { ///////////////////////////////////////////////////////////////// + constexpr Transaction::LoadFromPoolType Transaction::loadFromPool; + /** Transaction implementation. * * \NOTE After commit the @System repo is reloaded. This invalidates diff --git a/zypp/sat/Transaction.h b/zypp/sat/Transaction.h index a2165f9..60406a4 100644 --- a/zypp/sat/Transaction.h +++ b/zypp/sat/Transaction.h @@ -181,7 +181,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; private: /** Pointer to implementation */ RW_pointer _pimpl; diff --git a/zypp/sat/WhatProvides.h b/zypp/sat/WhatProvides.h index c57f572..cea6abe 100644 --- a/zypp/sat/WhatProvides.h +++ b/zypp/sat/WhatProvides.h @@ -124,7 +124,7 @@ namespace zypp const_iterator end() const; private: - struct Impl; + class Impl; RW_pointer _pimpl; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/sat/detail/PoolMember.h b/zypp/sat/detail/PoolMember.h index 52ab226..79c5fc0 100644 --- a/zypp/sat/detail/PoolMember.h +++ b/zypp/sat/detail/PoolMember.h @@ -45,7 +45,7 @@ namespace zypp namespace detail { class RepoIterator; - class ByRepository; + struct ByRepository; } /////////////////////////////////////////////////////////////////// diff --git a/zypp/solver/detail/Types.h b/zypp/solver/detail/Types.h index f8287a2..72ea4d7 100644 --- a/zypp/solver/detail/Types.h +++ b/zypp/solver/detail/Types.h @@ -38,7 +38,7 @@ namespace zypp class Resolver; typedef Resolver ResolverInternal; ///< Preferred name in API - class ItemCapKind; + struct ItemCapKind; typedef std::list ItemCapKindList; DEFINE_PTR_TYPE(SolverQueueItem); diff --git a/zypp/target/modalias/Modalias.h b/zypp/target/modalias/Modalias.h index eb446af..7298b33 100644 --- a/zypp/target/modalias/Modalias.h +++ b/zypp/target/modalias/Modalias.h @@ -38,7 +38,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; public: typedef std::vector ModaliasList; diff --git a/zypp/ui/Selectable.h b/zypp/ui/Selectable.h index e13e564..64a2224 100644 --- a/zypp/ui/Selectable.h +++ b/zypp/ui/Selectable.h @@ -528,7 +528,7 @@ namespace zypp public: /** Implementation */ - class Impl; + struct Impl; typedef shared_ptr Impl_Ptr; /** Default ctor */ Selectable( Impl_Ptr pimpl_r ); diff --git a/zypp/zypp_detail/ZYppImpl.cc b/zypp/zypp_detail/ZYppImpl.cc index 56dd17e..0ee62c0 100644 --- a/zypp/zypp_detail/ZYppImpl.cc +++ b/zypp/zypp_detail/ZYppImpl.cc @@ -65,7 +65,7 @@ namespace zypp // METHOD TYPE : Constructor // ZYppImpl::ZYppImpl() - : _target(0) + : _target( nullptr ) , _resolver( new Resolver( ResPool::instance()) ) { ZConfig::instance().about( MIL ); @@ -138,7 +138,7 @@ namespace zypp if (_target) _target->unload(); - _target = 0; + _target = nullptr; } //------------------------------------------------------------------------ @@ -227,7 +227,7 @@ namespace zypp Pathname myTmpDir() // from TmpPath.h { - static filesystem::TmpDir _tmpdir( TmpPath::defaultLocation(), "zypp." ); + static filesystem::TmpDir _tmpdir( filesystem::TmpPath::defaultLocation(), "zypp." ); return _tmpdir.path(); } diff --git a/zypp/zypp_detail/ZYppImpl.h b/zypp/zypp_detail/ZYppImpl.h index fc70cfa..4a32758 100644 --- a/zypp/zypp_detail/ZYppImpl.h +++ b/zypp/zypp_detail/ZYppImpl.h @@ -23,8 +23,6 @@ #include "zypp/DiskUsageCounter.h" #include "zypp/ManagedFile.h" -using namespace zypp::filesystem; - /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// -- 2.7.4