From 036b901c4389c58b29c54803a36e4aa3226a5ea6 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Mon, 21 Jan 2008 17:03:03 +0000 Subject: [PATCH] Removed obsolete files and classes. --- zypp/Arch.cc | 3 +- zypp/Arch.h | 3 + zypp/Atom.cc | 6 +- zypp/Atom.h | 10 +- zypp/CMakeLists.txt | 176 +---------- zypp/CapFactory.cc | 323 -------------------- zypp/CapFactory.h | 118 -------- zypp/CapFilters.h | 27 +- zypp/CapMatch.h | 12 +- zypp/CapMatchHelper.h | 41 +-- zypp/CapSet.cc | 36 --- zypp/CapSet.h | 29 -- zypp/CapSetFwd.h | 28 -- zypp/Capabilities.h | 1 + zypp/Capability.cc | 88 ------ zypp/Capability.h | 176 +---------- zypp/Dependencies.cc | 3 +- zypp/Dependencies.h | 14 +- zypp/Edition.cc | 14 +- zypp/Edition.h | 8 + zypp/Language.cc | 48 +-- zypp/Language.h | 29 +- zypp/Locks.cc | 24 +- zypp/Message.cc | 14 +- zypp/Message.h | 12 +- zypp/NVRAD.h | 3 +- zypp/NeedAType.h | 11 +- zypp/Package.cc | 45 ++- zypp/Package.h | 12 +- zypp/Patch.cc | 93 ++++-- zypp/Patch.h | 17 +- zypp/Pattern.cc | 56 +++- zypp/Pattern.h | 16 +- zypp/PoolItem.cc | 8 - zypp/Product.cc | 28 +- zypp/Product.h | 13 +- zypp/Rel.h | 7 + zypp/RepoManager.cc | 42 +-- zypp/ResKind.cc | 12 +- zypp/ResKind.h | 12 +- zypp/ResObject.cc | 39 ++- zypp/ResObject.h | 47 +-- zypp/ResPool.cc | 18 +- zypp/ResPool.h | 44 ++- zypp/ResTraits.h | 2 - zypp/Resolvable.cc | 45 +-- zypp/Resolvable.h | 83 ++--- zypp/Resolver.cc | 4 +- zypp/Resolver.h | 4 +- zypp/Script.cc | 18 +- zypp/Script.h | 10 +- zypp/Selection.cc | 24 +- zypp/Selection.h | 10 +- zypp/SrcPackage.cc | 9 +- zypp/SrcPackage.h | 12 +- zypp/SystemResObject.cc | 66 ---- zypp/SystemResObject.h | 79 ----- zypp/base/KindOf.h | 1 - zypp/base/Regex.cc | 12 +- zypp/base/Regex.h | 43 ++- zypp/base/String.h | 18 -- zypp/cache/ResolvableQuery.cc | 24 +- zypp/cache/SolvStore.cc | 137 ++------- zypp/cache/SolvStore.h | 170 +---------- zypp/capability/.cvsignore | 8 - zypp/capability/CapTraits.cc | 48 --- zypp/capability/CapTraits.h | 58 ---- zypp/capability/Capabilities.h | 29 -- zypp/capability/CapabilityImpl.cc | 402 ------------------------- zypp/capability/CapabilityImpl.h | 338 --------------------- zypp/capability/ConditionalCap.h | 44 --- zypp/capability/FileCap.cc | 42 --- zypp/capability/FileCap.h | 76 ----- zypp/capability/FilesystemCap.cc | 115 ------- zypp/capability/FilesystemCap.h | 97 ------ zypp/capability/HalCap.cc | 75 ----- zypp/capability/HalCap.h | 112 ------- zypp/capability/ModaliasCap.cc | 113 ------- zypp/capability/ModaliasCap.h | 115 ------- zypp/capability/NamedCap.cc | 74 ----- zypp/capability/NamedCap.h | 84 ------ zypp/capability/NullCap.cc | 48 --- zypp/capability/NullCap.h | 68 ----- zypp/capability/OrCap.h | 44 --- zypp/capability/SplitCap.cc | 56 ---- zypp/capability/SplitCap.h | 91 ------ zypp/capability/VersionedCap.cc | 64 ---- zypp/capability/VersionedCap.h | 77 ----- zypp/data/ResolvableData.h | 10 +- zypp/detail/.cvsignore | 8 - zypp/detail/AtomImpl.cc | 42 --- zypp/detail/AtomImpl.h | 45 --- zypp/detail/AtomImplIf.cc | 35 --- zypp/detail/AtomImplIf.h | 49 --- zypp/detail/ImplConnect.h | 72 ----- zypp/detail/MessageImpl.cc | 46 --- zypp/detail/MessageImpl.h | 52 ---- zypp/detail/MessageImplIf.cc | 38 --- zypp/detail/MessageImplIf.h | 53 ---- zypp/detail/PackageImpl.cc | 44 --- zypp/detail/PackageImpl.h | 44 --- zypp/detail/PackageImplIf.cc | 103 ------- zypp/detail/PackageImplIf.h | 128 -------- zypp/detail/PatchImpl.cc | 80 ----- zypp/detail/PatchImpl.h | 80 ----- zypp/detail/PatchImplIf.cc | 117 ------- zypp/detail/PatchImplIf.h | 75 ----- zypp/detail/PatternImpl.cc | 44 --- zypp/detail/PatternImpl.h | 45 --- zypp/detail/PatternImplIf.cc | 74 ----- zypp/detail/PatternImplIf.h | 68 ----- zypp/detail/ProductImpl.cc | 42 --- zypp/detail/ProductImpl.h | 44 --- zypp/detail/ProductImplIf.cc | 58 ---- zypp/detail/ProductImplIf.h | 84 ------ zypp/detail/ResImplTraits.h | 43 --- zypp/detail/ResObjectFactory.h | 93 ------ zypp/detail/ResObjectImplIf.cc | 77 ----- zypp/detail/ResObjectImplIf.h | 149 --------- zypp/detail/ResolvableImpl.cc | 308 ------------------- zypp/detail/ResolvableImpl.h | 82 ----- zypp/detail/ScriptImpl.cc | 49 --- zypp/detail/ScriptImpl.h | 62 ---- zypp/detail/ScriptImplIf.cc | 54 ---- zypp/detail/ScriptImplIf.h | 81 ----- zypp/detail/SelectionImpl.cc | 44 --- zypp/detail/SelectionImpl.h | 45 --- zypp/detail/SelectionImplIf.cc | 65 ---- zypp/detail/SelectionImplIf.h | 61 ---- zypp/detail/SrcPackageImpl.cc | 44 --- zypp/detail/SrcPackageImpl.h | 44 --- zypp/detail/SrcPackageImplIf.cc | 43 --- zypp/detail/SrcPackageImplIf.h | 65 ---- zypp/parser/plaindir/RepoParser.cc | 52 +--- zypp/parser/susetags/ContentFileReader.cc | 74 ++--- zypp/parser/susetags/FileReaderBaseImpl.h | 39 +-- zypp/parser/susetags/PackagesDuFileReader.cc | 4 +- zypp/parser/susetags/PackagesFileReader.cc | 14 +- zypp/parser/susetags/PackagesLangFileReader.cc | 4 +- zypp/parser/susetags/PatternFileReader.cc | 4 +- zypp/parser/yum/FileReaderBaseImpl.cc | 54 +--- zypp/parser/yum/FileReaderBaseImpl.h | 22 +- zypp/parser/yum/FilelistsFileReader.cc | 4 +- zypp/parser/yum/OtherFileReader.cc | 2 +- zypp/pool/GetResolvablesToInsDel.cc | 6 +- zypp/pool/PoolImpl.cc | 82 +---- zypp/pool/PoolImpl.h | 44 ++- zypp/pool/PoolTraits.h | 4 +- zypp/pool/Res2Sat.cc | 136 --------- zypp/repo/PackageProvider.cc | 2 - zypp/repo/PackageProvider.h | 6 +- zypp/repo/cached/AtomImpl.cc | 100 ------ zypp/repo/cached/AtomImpl.h | 57 ---- zypp/repo/cached/MessageImpl.cc | 116 ------- zypp/repo/cached/MessageImpl.h | 61 ---- zypp/repo/cached/PackageImpl.cc | 243 --------------- zypp/repo/cached/PackageImpl.h | 95 ------ zypp/repo/cached/PatchImpl.cc | 134 --------- zypp/repo/cached/PatchImpl.h | 64 ---- zypp/repo/cached/PatternImpl.cc | 177 ----------- zypp/repo/cached/PatternImpl.h | 83 ----- zypp/repo/cached/ProductImpl.cc | 159 ---------- zypp/repo/cached/ProductImpl.h | 67 ----- zypp/repo/cached/RepoImpl.cc | 253 +--------------- zypp/repo/cached/RepoImpl.h | 8 +- zypp/repo/cached/ScriptImpl.cc | 130 -------- zypp/repo/cached/ScriptImpl.h | 63 ---- zypp/repo/cached/SrcPackageImpl.cc | 145 --------- zypp/repo/cached/SrcPackageImpl.h | 74 ----- zypp/repo/memory/AtomImpl.cc | 99 ------ zypp/repo/memory/AtomImpl.h | 69 ----- zypp/repo/memory/MessageImpl.cc | 125 -------- zypp/repo/memory/MessageImpl.h | 74 ----- zypp/repo/memory/PackageImpl.cc | 225 -------------- zypp/repo/memory/PackageImpl.h | 102 ------- zypp/repo/memory/PatchImpl.cc | 135 --------- zypp/repo/memory/PatchImpl.h | 79 ----- zypp/repo/memory/PatternImpl.cc | 131 -------- zypp/repo/memory/PatternImpl.h | 83 ----- zypp/repo/memory/ProductImpl.cc | 156 ---------- zypp/repo/memory/ProductImpl.h | 103 ------- zypp/repo/memory/RepoImpl.cc | 75 ----- zypp/repo/memory/RepoImpl.h | 70 ----- zypp/repo/memory/ScriptImpl.cc | 115 ------- zypp/repo/memory/ScriptImpl.h | 70 ----- zypp/repo/memory/SrcPackageImpl.cc | 128 -------- zypp/repo/memory/SrcPackageImpl.h | 80 ----- zypp/sat/Capabilities.cc | 82 +++-- zypp/sat/Capabilities.h | 240 +++++++-------- zypp/sat/Capability.cc | 233 +++++++++----- zypp/sat/Capability.h | 255 ++++++++++------ zypp/sat/IdString.cc | 9 +- zypp/sat/IdString.h | 8 +- zypp/sat/IdStringType.h | 1 - zypp/sat/SATResolver.cc | 2 +- zypp/sat/Solvable.cc | 5 +- zypp/sat/Solvable.h | 8 +- zypp/sat/detail/PoolImpl.cc | 3 + zypp/sat/detail/PoolMember.h | 5 +- zypp/solver/detail/Helper.cc | 2 +- zypp/solver/detail/Helper.h | 2 +- zypp/solver/detail/InstallOrder.cc | 10 +- zypp/solver/detail/InstallOrder.h | 2 +- zypp/solver/detail/QueueItemConflict.cc | 2 +- zypp/solver/detail/QueueItemEstablish.cc | 12 +- zypp/solver/detail/QueueItemEstablish.h | 2 +- zypp/solver/detail/QueueItemInstall.cc | 18 +- zypp/solver/detail/QueueItemInstall.h | 2 +- zypp/solver/detail/QueueItemRequire.cc | 14 +- zypp/solver/detail/QueueItemUninstall.cc | 14 +- zypp/solver/detail/Resolver.cc | 40 +-- zypp/solver/detail/Resolver.h | 10 +- zypp/solver/detail/ResolverContext.cc | 6 +- zypp/solver/detail/ResolverQueue.cc | 10 +- zypp/solver/detail/ResolverUpgrade.cc | 12 +- zypp/solver/detail/SolutionAction.cc | 12 +- zypp/solver/detail/Testcase.cc | 10 +- zypp/solver/detail/Testcase.h | 6 +- zypp/target/rpm/RpmDb.cc | 20 +- zypp/target/rpm/RpmHeader.cc | 123 +++----- zypp/target/rpm/RpmHeader.h | 65 ++-- zypp/target/rpm/RpmPackageImpl.cc | 219 -------------- zypp/target/rpm/RpmPackageImpl.h | 131 -------- zypp/target/store/PersistentStorage.cc | 52 ++-- zypp/target/store/XMLFilesBackend.cc | 11 +- zypp/target/store/XMLFilesBackend.h | 28 +- zypp/target/store/serialize.cc | 38 ++- zypp/target/store/serialize.h | 37 ++- zypp/target/store/xml/XMLAtomImpl.cc | 37 --- zypp/target/store/xml/XMLAtomImpl.h | 80 ----- zypp/target/store/xml/XMLMessageImpl.cc | 46 --- zypp/target/store/xml/XMLMessageImpl.h | 90 ------ zypp/target/store/xml/XMLPatchImpl.cc | 74 ----- zypp/target/store/xml/XMLPatchImpl.h | 109 ------- zypp/target/store/xml/XMLPatternImpl.cc | 61 ---- zypp/target/store/xml/XMLPatternImpl.h | 96 ------ zypp/target/store/xml/XMLProductImpl.cc | 70 ----- zypp/target/store/xml/XMLProductImpl.h | 103 ------- zypp/target/store/xml/XMLScriptImpl.cc | 49 --- zypp/target/store/xml/XMLScriptImpl.h | 89 ------ zypp/target/store/xml/XMLSelectionImpl.cc | 62 ---- zypp/target/store/xml/XMLSelectionImpl.h | 107 ------- zypp/ui/PatternExpander.cc | 24 +- zypp/ui/UserWantedPackages.cc | 4 +- zypp/zypp_detail/ZYppImpl.cc | 1 - 245 files changed, 1466 insertions(+), 13702 deletions(-) delete mode 100644 zypp/CapFactory.cc delete mode 100644 zypp/CapFactory.h delete mode 100644 zypp/CapSet.cc delete mode 100644 zypp/CapSet.h delete mode 100644 zypp/CapSetFwd.h create mode 100644 zypp/Capabilities.h delete mode 100644 zypp/Capability.cc delete mode 100644 zypp/SystemResObject.cc delete mode 100644 zypp/SystemResObject.h delete mode 100644 zypp/capability/.cvsignore delete mode 100644 zypp/capability/CapTraits.cc delete mode 100644 zypp/capability/CapTraits.h delete mode 100644 zypp/capability/Capabilities.h delete mode 100644 zypp/capability/CapabilityImpl.cc delete mode 100644 zypp/capability/CapabilityImpl.h delete mode 100644 zypp/capability/ConditionalCap.h delete mode 100644 zypp/capability/FileCap.cc delete mode 100644 zypp/capability/FileCap.h delete mode 100644 zypp/capability/FilesystemCap.cc delete mode 100644 zypp/capability/FilesystemCap.h delete mode 100644 zypp/capability/HalCap.cc delete mode 100644 zypp/capability/HalCap.h delete mode 100644 zypp/capability/ModaliasCap.cc delete mode 100644 zypp/capability/ModaliasCap.h delete mode 100644 zypp/capability/NamedCap.cc delete mode 100644 zypp/capability/NamedCap.h delete mode 100644 zypp/capability/NullCap.cc delete mode 100644 zypp/capability/NullCap.h delete mode 100644 zypp/capability/OrCap.h delete mode 100644 zypp/capability/SplitCap.cc delete mode 100644 zypp/capability/SplitCap.h delete mode 100644 zypp/capability/VersionedCap.cc delete mode 100644 zypp/capability/VersionedCap.h delete mode 100644 zypp/detail/.cvsignore delete mode 100644 zypp/detail/AtomImpl.cc delete mode 100644 zypp/detail/AtomImpl.h delete mode 100644 zypp/detail/AtomImplIf.cc delete mode 100644 zypp/detail/AtomImplIf.h delete mode 100644 zypp/detail/ImplConnect.h delete mode 100644 zypp/detail/MessageImpl.cc delete mode 100644 zypp/detail/MessageImpl.h delete mode 100644 zypp/detail/MessageImplIf.cc delete mode 100644 zypp/detail/MessageImplIf.h delete mode 100644 zypp/detail/PackageImpl.cc delete mode 100644 zypp/detail/PackageImpl.h delete mode 100644 zypp/detail/PackageImplIf.cc delete mode 100644 zypp/detail/PackageImplIf.h delete mode 100644 zypp/detail/PatchImpl.cc delete mode 100644 zypp/detail/PatchImpl.h delete mode 100644 zypp/detail/PatchImplIf.cc delete mode 100644 zypp/detail/PatchImplIf.h delete mode 100644 zypp/detail/PatternImpl.cc delete mode 100644 zypp/detail/PatternImpl.h delete mode 100644 zypp/detail/PatternImplIf.cc delete mode 100644 zypp/detail/PatternImplIf.h delete mode 100644 zypp/detail/ProductImpl.cc delete mode 100644 zypp/detail/ProductImpl.h delete mode 100644 zypp/detail/ProductImplIf.cc delete mode 100644 zypp/detail/ProductImplIf.h delete mode 100644 zypp/detail/ResImplTraits.h delete mode 100644 zypp/detail/ResObjectFactory.h delete mode 100644 zypp/detail/ResObjectImplIf.cc delete mode 100644 zypp/detail/ResObjectImplIf.h delete mode 100644 zypp/detail/ResolvableImpl.cc delete mode 100644 zypp/detail/ResolvableImpl.h delete mode 100644 zypp/detail/ScriptImpl.cc delete mode 100644 zypp/detail/ScriptImpl.h delete mode 100644 zypp/detail/ScriptImplIf.cc delete mode 100644 zypp/detail/ScriptImplIf.h delete mode 100644 zypp/detail/SelectionImpl.cc delete mode 100644 zypp/detail/SelectionImpl.h delete mode 100644 zypp/detail/SelectionImplIf.cc delete mode 100644 zypp/detail/SelectionImplIf.h delete mode 100644 zypp/detail/SrcPackageImpl.cc delete mode 100644 zypp/detail/SrcPackageImpl.h delete mode 100644 zypp/detail/SrcPackageImplIf.cc delete mode 100644 zypp/detail/SrcPackageImplIf.h delete mode 100644 zypp/pool/Res2Sat.cc delete mode 100644 zypp/repo/cached/AtomImpl.cc delete mode 100644 zypp/repo/cached/AtomImpl.h delete mode 100644 zypp/repo/cached/MessageImpl.cc delete mode 100644 zypp/repo/cached/MessageImpl.h delete mode 100644 zypp/repo/cached/PackageImpl.cc delete mode 100644 zypp/repo/cached/PackageImpl.h delete mode 100644 zypp/repo/cached/PatchImpl.cc delete mode 100644 zypp/repo/cached/PatchImpl.h delete mode 100644 zypp/repo/cached/PatternImpl.cc delete mode 100644 zypp/repo/cached/PatternImpl.h delete mode 100644 zypp/repo/cached/ProductImpl.cc delete mode 100644 zypp/repo/cached/ProductImpl.h delete mode 100644 zypp/repo/cached/ScriptImpl.cc delete mode 100644 zypp/repo/cached/ScriptImpl.h delete mode 100644 zypp/repo/cached/SrcPackageImpl.cc delete mode 100644 zypp/repo/cached/SrcPackageImpl.h delete mode 100644 zypp/repo/memory/AtomImpl.cc delete mode 100644 zypp/repo/memory/AtomImpl.h delete mode 100644 zypp/repo/memory/MessageImpl.cc delete mode 100644 zypp/repo/memory/MessageImpl.h delete mode 100644 zypp/repo/memory/PackageImpl.cc delete mode 100644 zypp/repo/memory/PackageImpl.h delete mode 100644 zypp/repo/memory/PatchImpl.cc delete mode 100644 zypp/repo/memory/PatchImpl.h delete mode 100644 zypp/repo/memory/PatternImpl.cc delete mode 100644 zypp/repo/memory/PatternImpl.h delete mode 100644 zypp/repo/memory/ProductImpl.cc delete mode 100644 zypp/repo/memory/ProductImpl.h delete mode 100644 zypp/repo/memory/RepoImpl.cc delete mode 100644 zypp/repo/memory/RepoImpl.h delete mode 100644 zypp/repo/memory/ScriptImpl.cc delete mode 100644 zypp/repo/memory/ScriptImpl.h delete mode 100644 zypp/repo/memory/SrcPackageImpl.cc delete mode 100644 zypp/repo/memory/SrcPackageImpl.h delete mode 100644 zypp/target/rpm/RpmPackageImpl.cc delete mode 100644 zypp/target/rpm/RpmPackageImpl.h delete mode 100644 zypp/target/store/xml/XMLAtomImpl.cc delete mode 100644 zypp/target/store/xml/XMLAtomImpl.h delete mode 100644 zypp/target/store/xml/XMLMessageImpl.cc delete mode 100644 zypp/target/store/xml/XMLMessageImpl.h delete mode 100644 zypp/target/store/xml/XMLPatchImpl.cc delete mode 100644 zypp/target/store/xml/XMLPatchImpl.h delete mode 100644 zypp/target/store/xml/XMLPatternImpl.cc delete mode 100644 zypp/target/store/xml/XMLPatternImpl.h delete mode 100644 zypp/target/store/xml/XMLProductImpl.cc delete mode 100644 zypp/target/store/xml/XMLProductImpl.h delete mode 100644 zypp/target/store/xml/XMLScriptImpl.cc delete mode 100644 zypp/target/store/xml/XMLScriptImpl.h delete mode 100644 zypp/target/store/xml/XMLSelectionImpl.cc delete mode 100644 zypp/target/store/xml/XMLSelectionImpl.h diff --git a/zypp/Arch.cc b/zypp/Arch.cc index c6a333b..6d84242 100644 --- a/zypp/Arch.cc +++ b/zypp/Arch.cc @@ -17,7 +17,7 @@ #include "zypp/Arch.h" #include "zypp/Bit.h" -using namespace std; +using std::endl; /////////////////////////////////////////////////////////////////// namespace zypp @@ -374,7 +374,6 @@ namespace zypp return ret; } - ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// diff --git a/zypp/Arch.h b/zypp/Arch.h index 5030e1d..cc5cb45 100644 --- a/zypp/Arch.h +++ b/zypp/Arch.h @@ -43,6 +43,9 @@ namespace zypp public: /** String representation of Arch. */ const std::string & asString() const; + /** \overload */ + const std::string & string() const + { return asString(); } /** Test for an empty Arch (this is "", not Arch_noarch). */ bool empty() const diff --git a/zypp/Atom.cc b/zypp/Atom.cc index f14572b..41e3bd7 100644 --- a/zypp/Atom.cc +++ b/zypp/Atom.cc @@ -11,8 +11,6 @@ */ #include "zypp/Atom.h" -using namespace std; - /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// @@ -24,8 +22,8 @@ namespace zypp // METHOD NAME : Atom::Atom // METHOD TYPE : Ctor // - Atom::Atom( const NVRAD & nvrad_r ) - : ResObject( TraitsType::kind, nvrad_r ) + Atom::Atom( const sat::Solvable & solvable_r ) + : ResObject( solvable_r ) {} /////////////////////////////////////////////////////////////////// diff --git a/zypp/Atom.h b/zypp/Atom.h index 16cb9b4..d07a49b 100644 --- a/zypp/Atom.h +++ b/zypp/Atom.h @@ -13,7 +13,6 @@ #define ZYPP_ATOM_H #include "zypp/ResObject.h" -#include "zypp/detail/AtomImplIf.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -26,22 +25,15 @@ namespace zypp class Atom : public ResObject { public: - typedef detail::AtomImplIf Impl; typedef Atom Self; typedef ResTraits TraitsType; typedef TraitsType::PtrType Ptr; typedef TraitsType::constPtrType constPtr; protected: - Atom( const NVRAD & nvrad_r ); + Atom( const sat::Solvable & solvable_r ); /** Dtor */ virtual ~Atom(); - - private: - /** Access implementation */ - virtual Impl & pimpl() = 0; - /** Access implementation */ - virtual const Impl & pimpl() const = 0; }; ///////////////////////////////////////////////////////////////// diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt index f9f5488..62a109b 100644 --- a/zypp/CMakeLists.txt +++ b/zypp/CMakeLists.txt @@ -13,10 +13,7 @@ ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_BINARY_DIR}/zypp/sqlite-schema.h PRE_BUILD CO SET( zypp_SRCS Atom.cc ByteCount.cc - Capability.cc - CapFactory.cc CapMatch.cc - CapSet.cc CheckSum.cc Date.cc Dep.cc @@ -29,7 +26,6 @@ SET( zypp_SRCS Range.cc Rel.cc ResObject.cc - SystemResObject.cc Resolvable.cc ResStatus.cc ResStore.cc @@ -99,13 +95,11 @@ SET( zypp_HEADERS ByteCount.h Callback.h CapAndItem.h - CapFactory.h CapFilters.h CapMatch.h CapMatchHelper.h - CapSet.h - CapSetFwd.h Capability.h + Capabilities.h Changelog.h CheckSum.h CountryCode.h @@ -166,7 +160,6 @@ SET( zypp_HEADERS SilentCallbacks.h SrcPackage.h SysContent.h - SystemResObject.h Target.h TmpPath.h TranslatedText.h @@ -261,40 +254,6 @@ INSTALL( FILES DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/base ) -SET( zypp_capability_SRCS - capability/CapTraits.cc - capability/CapabilityImpl.cc - capability/FileCap.cc - capability/HalCap.cc - capability/ModaliasCap.cc - capability/FilesystemCap.cc - capability/NamedCap.cc - capability/NullCap.cc - capability/SplitCap.cc - capability/VersionedCap.cc -) - -SET( zypp_capability_HEADERS - capability/CapTraits.h - capability/Capabilities.h - capability/CapabilityImpl.h - capability/ConditionalCap.h - capability/FileCap.h - capability/HalCap.h - capability/ModaliasCap.h - capability/FilesystemCap.h - capability/NamedCap.h - capability/NullCap.h - capability/OrCap.h - capability/SplitCap.h - capability/VersionedCap.h -) - -INSTALL( FILES - ${zypp_capability_HEADERS} - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/capability -) - SET( zypp_data_SRCS data/ResolvableData.cc data/RecordId.cc @@ -312,60 +271,6 @@ INSTALL( FILES DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/data ) -SET( zypp_detail_SRCS - detail/AtomImpl.cc - detail/AtomImplIf.cc - detail/MessageImpl.cc - detail/MessageImplIf.cc - detail/PackageImpl.cc - detail/PackageImplIf.cc - detail/PatchImpl.cc - detail/PatchImplIf.cc - detail/PatternImpl.cc - detail/PatternImplIf.cc - detail/ProductImpl.cc - detail/ProductImplIf.cc - detail/ResObjectImplIf.cc - detail/ResolvableImpl.cc - detail/ScriptImpl.cc - detail/ScriptImplIf.cc - detail/SelectionImpl.cc - detail/SelectionImplIf.cc - detail/SrcPackageImpl.cc - detail/SrcPackageImplIf.cc -) - -SET( zypp_detail_HEADERS - detail/AtomImpl.h - detail/AtomImplIf.h - detail/ImplConnect.h - detail/MessageImpl.h - detail/MessageImplIf.h - detail/PackageImpl.h - detail/PackageImplIf.h - detail/PatchImpl.h - detail/PatchImplIf.h - detail/PatternImpl.h - detail/PatternImplIf.h - detail/ProductImpl.h - detail/ProductImplIf.h - detail/ResImplTraits.h - detail/ResObjectFactory.h - detail/ResObjectImplIf.h - detail/ResolvableImpl.h - detail/ScriptImpl.h - detail/ScriptImplIf.h - detail/SelectionImpl.h - detail/SelectionImplIf.h - detail/SrcPackageImpl.h - detail/SrcPackageImplIf.h -) - -INSTALL( FILES - ${zypp_detail_HEADERS} - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/detail -) - SET( zypp_media_SRCS media/MediaException.cc media/MediaAccess.cc @@ -580,7 +485,6 @@ SET( zypp_pool_SRCS pool/GetResolvablesToInsDel.cc pool/PoolImpl.cc pool/PoolStats.cc - pool/Res2Sat.cc ) SET( zypp_pool_HEADERS @@ -768,7 +672,6 @@ SET( zypp_target_rpm_SRCS target/rpm/RpmDb.cc target/rpm/RpmException.cc target/rpm/RpmHeader.cc - target/rpm/RpmPackageImpl.cc target/rpm/librpmDb.cc target/rpm/librpmDb.cv3.cc ) @@ -779,7 +682,6 @@ SET( zypp_target_rpm_HEADERS target/rpm/RpmDb.h target/rpm/RpmException.h target/rpm/RpmHeader.h - target/rpm/RpmPackageImpl.h target/rpm/librpm.h target/rpm/librpmDb.h ) @@ -811,31 +713,6 @@ INSTALL( FILES DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target/store ) -SET( zypp_target_store_xml_SRCS - target/store/xml/XMLAtomImpl.cc - target/store/xml/XMLMessageImpl.cc - target/store/xml/XMLPatchImpl.cc - target/store/xml/XMLPatternImpl.cc - target/store/xml/XMLProductImpl.cc - target/store/xml/XMLScriptImpl.cc - target/store/xml/XMLSelectionImpl.cc -) - -SET( zypp_target_store_xml_HEADERS - target/store/xml/XMLAtomImpl.h - target/store/xml/XMLMessageImpl.h - target/store/xml/XMLPatchImpl.h - target/store/xml/XMLPatternImpl.h - target/store/xml/XMLProductImpl.h - target/store/xml/XMLScriptImpl.h - target/store/xml/XMLSelectionImpl.h -) - -INSTALL( FILES - ${zypp_target_store_xml_HEADERS} - DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/target/store/xml -) - SET( zypp_thread_SRCS thread/Mutex.cc ) @@ -1003,26 +880,10 @@ INSTALL( FILES SET( zypp_repo_cached_SRCS repo/cached/RepoImpl.cc - repo/cached/PackageImpl.cc - repo/cached/SrcPackageImpl.cc - repo/cached/PatchImpl.cc - repo/cached/PatternImpl.cc - repo/cached/ProductImpl.cc - repo/cached/MessageImpl.cc - repo/cached/ScriptImpl.cc - repo/cached/AtomImpl.cc ) SET( zypp_repo_cached_HEADERS repo/cached/RepoImpl.h - repo/cached/PackageImpl.h - repo/cached/SrcPackageImpl.h - repo/cached/PatchImpl.h - repo/cached/PatternImpl.h - repo/cached/ProductImpl.h - repo/cached/MessageImpl.h - repo/cached/ScriptImpl.h - repo/cached/AtomImpl.h ) SET( zypp_repo_yum_SRCS @@ -1043,32 +904,7 @@ SET( zypp_repo_susetags_HEADERS repo/susetags/Downloader.h ) - -SET( zypp_repo_data_SRCS - repo/memory/ScriptImpl.cc - repo/memory/MessageImpl.cc - repo/memory/PackageImpl.cc - repo/memory/PatternImpl.cc - repo/memory/ProductImpl.cc - repo/memory/PatchImpl.cc - repo/memory/RepoImpl.cc - repo/memory/AtomImpl.cc - repo/memory/SrcPackageImpl.cc -) - -SET( zypp_repo_data_HEADERS - repo/memory/PackageImpl.h - repo/memory/PatternImpl.h - repo/memory/ProductImpl.h - repo/memory/PatchImpl.h - repo/memory/RepoImpl.h - repo/memory/AtomImpl.h - repo/memory/SrcPackageImpl.h -) - SET( zypp_lib_SRCS -${zypp_detail_SRCS} -${zypp_capability_SRCS} ${zypp_cache_SRCS} ${zypp_cache_sqlite3x_SRCS} ${zypp_pool_SRCS} @@ -1078,7 +914,6 @@ ${zypp_parser_xml_SRCS} ${zypp_parser_yum_SRCS} ${zypp_parser_plaindir_SRCS} ${zypp_parser_SRCS} -${zypp_data_SRCS} ${zypp_media_proxyinfo_SRCS} ${zypp_media_SRCS} ${zypp_url_SRCS} @@ -1087,13 +922,12 @@ ${zypp_repo_cached_SRCS} ${zypp_repo_yum_SRCS} ${zypp_repo_susetags_SRCS} ${zypp_repo_data_SRCS} -${zypp_target_store_xml_SRCS} ${zypp_target_store_SRCS} ${zypp_target_rpm_SRCS} ${zypp_target_hal_SRCS} ${zypp_target_modalias_SRCS} ${zypp_target_SRCS} -${zypp_solver_detail_SRCS} +#${zypp_solver_detail_SRCS} ${zypp_ui_SRCS} ${zypp_thread_SRCS} ${zypp_SRCS} @@ -1103,7 +937,6 @@ ${zypp_base_SRCS} ) SET( zypp_lib_HEADERS -${zypp_target_store_xml_HEADERS} ${zypp_target_rpm_HEADERS} ${zypp_parser_tagfile_HEADERS} ${zypp_parser_susetags_HEADERS} @@ -1111,12 +944,10 @@ ${zypp_parser_yum_HEADERS} ${zypp_parser_plaindir_HEADERS} ${zypp_parser_xml_HEADERS} ${zypp_parser_HEADERS} -${zypp_capability_HEADERS} ${zypp_cache_HEADERS} ${zypp_cache_sqlite3x_HEADERS} ${zypp_ui_HEADERS} ${zypp_parser_xmlstore_HEADERS} -${zypp_data_HEADERS} ${zypp_media_HEADERS} ${zypp_target_hal_HEADERS} ${zypp_media_proxyinfo_HEADERS} @@ -1132,7 +963,6 @@ ${zypp_repo_HEADERS} ${zypp_source_susetags_HEADERS} ${zypp_target_modalias_HEADERS} ${zypp_target_HEADERS} -${zypp_detail_HEADERS} ${zypp_pool_HEADERS} ) @@ -1151,7 +981,6 @@ ENDMACRO( SET_LOGGROUP ) SET_LOGGROUP( "zypp" ${zypp_lib_SRCS} ) # override some defaults -SET_LOGGROUP( "xmlstore" ${zypp_target_store_xml_SRCS} ) SET_LOGGROUP( "satsolver" ${zypp_sat_SRCS} ) #SET_LOGGROUP( "group" ${zypp_target_rpm_SRCS} ) #SET_LOGGROUP( "group" ${zypp_parser_yum2_SRCS} ) @@ -1178,7 +1007,6 @@ SET_LOGGROUP( "satsolver" ${zypp_sat_SRCS} ) #SET_LOGGROUP( "group" ${zypp_target_modalias_SRCS} ) #SET_LOGGROUP( "group" ${zypp_target_SRCS} ) #SET_LOGGROUP( "group" ${zypp_parser_yum_SRCS} ) -#SET_LOGGROUP( "group" ${zypp_detail_SRCS} ) #SET_LOGGROUP( "group" ${zypp_pool_SRCS} ) diff --git a/zypp/CapFactory.cc b/zypp/CapFactory.cc deleted file mode 100644 index ccbc9bb..0000000 --- a/zypp/CapFactory.cc +++ /dev/null @@ -1,323 +0,0 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/CapFactory.cc - * -*/ -#include -#include -#include -#include - -#include - -#include "zypp/base/Logger.h" -#include "zypp/base/Exception.h" -#include "zypp/base/String.h" -#include "zypp/base/Counter.h" - -#include "zypp/CapFactory.h" -#include "zypp/capability/Capabilities.h" - -using std::endl; - -/////////////////////////////////////////////////////////////////// -namespace -{ ///////////////////////////////////////////////////////////////// - using ::zypp::Resolvable; - using ::zypp::capability::CapabilityImpl; - using ::zypp::capability::CapImplOrder; - - struct CapImplHashFun - { - size_t operator() ( const CapabilityImpl::Ptr & p ) const - { - //return __gnu_cxx::hash()( p->encode().c_str() ); - return p->hash(); - } - }; - - struct CapImplHashEqual - { - bool operator() ( const CapabilityImpl::Ptr & lhs, const CapabilityImpl::Ptr & rhs ) const - { - return ::zypp::capability::exactly_same_caps_p (lhs, rhs); - /*return ( lhs->refers() == rhs->refers() - && lhs->kind() == rhs->kind() - && lhs->encode() == rhs->encode() );*/ - } - }; - - /** Set of unique CapabilityImpl. */ - //typedef std::set USet; - typedef __gnu_cxx::hash_set USet; - - - /** Set to unify created capabilities. - * - * This is to unify capabilities. Each CapabilityImpl created - * by CapFactory, must be inserted into _uset, and the returned - * CapabilityImpl::Ptr has to be uset to create the Capability. - */ - USet _uset; - - /** Each CapabilityImpl created in CapFactory \b must be wrapped. - * - * Immediately wrap \a allocated_r, and unified by inserting it into - * \c _uset. Each CapabilityImpl created by CapFactory, \b must be - * inserted into _uset, by calling usetInsert. - * - * \return CapabilityImpl_Ptr referencing \a allocated_r (or an - * eqal representation, allocated is deleted then). - */ - CapabilityImpl::Ptr usetInsert( CapabilityImpl::Ptr cap_ptr ) - { - return *(_uset.insert( cap_ptr ).first); - } - - /** Collect USet statistics. - * \ingroup DEBUG - */ - struct USetStatsCollect : public std::unary_function - { - typedef ::zypp::Counter Counter; - - Counter _caps; - std::map _capKind; - std::map _capRefers; - - void operator()( const CapabilityImpl::constPtr & cap_r ) - { - //DBG << *cap_r << endl; - ++_caps; - ++(_capKind[cap_r->kind()]); - ++(_capRefers[cap_r->refers()]); - } - - std::ostream & dumpOn( std::ostream & str ) const - { - str << " Capabilities total: " << _caps << endl; - str << " Capability kinds:" << endl; - for ( std::map::const_iterator it = _capKind.begin(); - it != _capKind.end(); ++it ) - { - str << " " << it->first << '\t' << it->second << endl; - } - str << " Capability refers:" << endl; - for ( std::map::const_iterator it = _capRefers.begin(); - it != _capRefers.end(); ++it ) - { - str << " " << it->first << '\t' << it->second << endl; - } - return str; - } - }; - - ///////////////////////////////////////////////////////////////// -} // namespace -/////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // - // CLASS NAME : CapFactoryImpl - // - /** CapFactory implementation. - * - * Provides various functions doing checks and log and \c throw. - * CapFactory::parse usually combines them, and if nothing fails, - * finaly builds the Capability. - * - * \attention Each CapabilityImpl created by CapFactory, \b must - * be inserted into ::_uset, by calling ::usetInsert, \b before - * the Capability is created. - * - * \li \c file: /absolute/path - * \li \c split: name:/absolute/path - * \li \c name: name - * \li \c vers: name op edition - * \li \c hal: hal(string) - * \li \c modalias: modalias(string) - */ - struct CapFactory::Impl - { - - }; - /////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // - // CLASS NAME : CapFactory - // - /////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::CapFactory - // METHOD TYPE : Ctor - // - CapFactory::CapFactory() - {} - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::~CapFactory - // METHOD TYPE : Dtor - // - CapFactory::~CapFactory() - {} - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::fromImpl - // METHOD TYPE : Capability - // - Capability CapFactory::fromImpl( capability::CapabilityImpl::Ptr impl ) const - try - { - return Capability( usetInsert( impl ) ); - } - catch ( Exception & excpt ) - { - ZYPP_RETHROW( excpt ); - return Capability(); // not reached - } - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::parse - // METHOD TYPE : Capability - // - Capability CapFactory::parse( const Resolvable::Kind & refers_r, - const std::string & strval_r ) const - try - { - return Capability( usetInsert( ::zypp::capability::parse( refers_r, strval_r ) ) ); - } - catch ( Exception & excpt ) - { - ZYPP_RETHROW( excpt ); - return Capability(); // not reached - } - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::parse - // METHOD TYPE : Capability - // - Capability CapFactory::parse( const Resolvable::Kind & refers_r, - const std::string & name_r, - const std::string & op_r, - const std::string & edition_r ) const - try - { - return Capability( usetInsert(::zypp::capability::parse( refers_r, name_r, op_r, edition_r ) ) ); - } - catch ( Exception & excpt ) - { - ZYPP_RETHROW( excpt ); - return Capability(); // not reached - } - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::parse - // METHOD TYPE : Capability - // - Capability CapFactory::parse( const Resolvable::Kind & refers_r, - const std::string & name_r, - Rel op_r, - const Edition & edition_r ) const - try - { - return Capability( usetInsert(::zypp::capability::parse( refers_r, name_r, op_r, edition_r )) ); - } - catch ( Exception & excpt ) - { - ZYPP_RETHROW( excpt ); - return Capability(); // not reached - } - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::halEvalCap - // METHOD TYPE : Capability - // - Capability CapFactory::halEvalCap() const - try - { - return Capability( usetInsert( ::zypp::capability::buildHal( Resolvable::Kind(), "hal()" ) ) ); - } - catch ( Exception & excpt ) - { - ZYPP_RETHROW( excpt ); - return Capability(); // not reached - } - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::modaliasEvalCap - // METHOD TYPE : Capability - // - Capability CapFactory::modaliasEvalCap() const - try - { - return Capability( usetInsert( ::zypp::capability::buildModalias( Resolvable::Kind(), "modalias()" ) ) ); - } - catch ( Exception & excpt ) - { - ZYPP_RETHROW( excpt ); - return Capability(); // not reached - } - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::filesystemEvalCap - // METHOD TYPE : Capability - // - Capability CapFactory::filesystemEvalCap() const - try - { - return Capability( usetInsert( ::zypp::capability::buildFilesystem( Resolvable::Kind(), "filesystem()" ) ) ); - } - catch ( Exception & excpt ) - { - ZYPP_RETHROW( excpt ); - return Capability(); // not reached - } - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : CapFactory::encode - // METHOD TYPE : std::string - // - std::string CapFactory::encode( const Capability & cap_r ) const - { - return cap_r._pimpl->encode(); - } - - /****************************************************************** - ** - ** FUNCTION NAME : operator<< - ** FUNCTION TYPE : std::ostream & - */ - std::ostream & operator<<( std::ostream & str, const CapFactory & obj ) - { - str << "CapFactory stats:" << endl; - - return for_each( _uset.begin(), _uset.end(), USetStatsCollect() ).dumpOn( str ); - } - - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// diff --git a/zypp/CapFactory.h b/zypp/CapFactory.h deleted file mode 100644 index 9f608e6..0000000 --- a/zypp/CapFactory.h +++ /dev/null @@ -1,118 +0,0 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/CapFactory.h - * -*/ -#ifndef ZYPP_CAPFACTORY_H -#define ZYPP_CAPFACTORY_H - -#include - -#include "zypp/base/PtrTypes.h" - -#include "zypp/Capability.h" -#include "zypp/capability/CapabilityImpl.h" - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // - // CLASS NAME : CapFactory - // - /** Factory for creating Capability. - * - * Besides parsing, CapFactory asserts that equal capabilites - * share the same implementation. - * - * \todo define EXCEPTIONS - * \todo Parser needs improvement in speed and accuracy. - */ - class CapFactory - { - friend std::ostream & operator<<( std::ostream & str, const CapFactory & obj ); - - public: - /** Default ctor */ - CapFactory(); - - /** Dtor */ - ~CapFactory(); - - public: - - /** Create capability from Implementation - * \a impl is a valid \ref CapabilityImpl Ptr - * \throw EXCEPTION on null capability - */ - Capability fromImpl( capability::CapabilityImpl::Ptr impl ) const; - - /** Parse Capability from string providing Resolvable::Kind. - * \a strval_r is expected to define a valid Capability. - * \throw EXCEPTION on parse error. - */ - Capability parse( const Resolvable::Kind & refers_r, - const std::string & strval_r ) const; - /** \overload Templating the \c Resolvable::Kind. */ - template - Capability parse( const std::string & strval_r ) const - { return parse( ResTraits<_Res>::kind, strval_r ); } - - /** Parse Capability providing Resolvable::Kind, name, Rel and Edition as strings. - * \throw EXCEPTION on parse error. - */ - Capability parse( const Resolvable::Kind & refers_r, - const std::string & name_r, - const std::string & op_r, - const std::string & edition_r ) const; - - /** Parse Capability providing Resolvable::Kind, name, Rel and Edition. - * \throw EXCEPTION on parse error. - */ - Capability parse( const Resolvable::Kind & refers_r, - const std::string & name_r, - Rel op_r, - const Edition & edition_r ) const; - - public: - /** Special Capability, triggering evaluation of Hal - * capabilities when matched. - */ - Capability halEvalCap() const; - - /** Special Capability, triggering evaluation of modalias - * capabilities when matched. - */ - Capability modaliasEvalCap() const; - - /** Special Capability, triggering evaluation of filesystem - * capabilities when matched. - */ - Capability filesystemEvalCap() const; - - public: - /** Provide a parsable string representation of \a cap_r. */ - std::string encode( const Capability & cap_r ) const; - - private: - /** Implementation */ - struct Impl; - /** Pointer to implementation */ - RW_pointer _pimpl; - }; - /////////////////////////////////////////////////////////////////// - - /** \relates CapFactory Stream output */ - extern std::ostream & operator<<( std::ostream & str, const CapFactory & obj ); - - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// -#endif // ZYPP_CAPFACTORY_H diff --git a/zypp/CapFilters.h b/zypp/CapFilters.h index cbe7970..03c8e6c 100644 --- a/zypp/CapFilters.h +++ b/zypp/CapFilters.h @@ -12,6 +12,7 @@ #ifndef ZYPP_CAPFILTERS_H #define ZYPP_CAPFILTERS_H +#include "zypp/base/Deprecated.h" #include "zypp/base/Functional.h" #include "zypp/Capability.h" #include "zypp/ResObject.h" @@ -32,38 +33,38 @@ namespace zypp typedef std::unary_function CapabilityFilterFunctor; /** */ - struct ByRefers : public CapabilityFilterFunctor + struct ZYPP_DEPRECATED ByRefers : public CapabilityFilterFunctor { - bool operator()( const Capability & c ) const + ZYPP_DEPRECATED bool operator()( const Capability & c ) const { - return c.refers() == _refers; + return false; //c.refers() == _refers; } - ByRefers( Resolvable::Kind refers_r ) + ZYPP_DEPRECATED ByRefers( Resolvable::Kind refers_r ) : _refers( refers_r ) {} - ByRefers( ResObject::constPtr p ) + ZYPP_DEPRECATED ByRefers( ResObject::constPtr p ) : _refers( p->kind() ) {} - ByRefers( const Capability & cap_r ) - : _refers( cap_r.refers() ) + ZYPP_DEPRECATED ByRefers( const Capability & cap_r ) + //: _refers( cap_r.refers() ) {} Resolvable::Kind _refers; }; /** */ - struct ByIndex : public CapabilityFilterFunctor + struct ZYPP_DEPRECATED ByIndex : public CapabilityFilterFunctor { - bool operator()( const Capability & c ) const + ZYPP_DEPRECATED bool operator()( const Capability & c ) const { - return c.index() == _index; + return false; //c.index() == _index; } - ByIndex( const std::string & index_r ) + ZYPP_DEPRECATED ByIndex( const std::string & index_r ) : _index( index_r ) {} - ByIndex( const Capability & cap_r ) - : _index( cap_r.index() ) + ZYPP_DEPRECATED ByIndex( const Capability & cap_r ) + //: _index( cap_r.index() ) {} std::string _index; }; diff --git a/zypp/CapMatch.h b/zypp/CapMatch.h index d7d4d84..3f38d05 100644 --- a/zypp/CapMatch.h +++ b/zypp/CapMatch.h @@ -13,7 +13,7 @@ #define ZYPP_CAPMATCH_H #include - +#include "zypp/base/Deprecated.h" /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// @@ -32,9 +32,9 @@ namespace zypp * ( !CapMatch::irrelevant ) == CapMatch::irrelevant // true * \endcode */ - class CapMatch + class ZYPP_DEPRECATED CapMatch { - enum Result { NOMATCH, MATCH, IRRELEVANT }; + enum ZYPP_DEPRECATED Result { NOMATCH, MATCH, IRRELEVANT }; public: @@ -42,9 +42,9 @@ namespace zypp : _result( val_r ? MATCH : NOMATCH ) {} - static const CapMatch yes; - static const CapMatch no; - static const CapMatch irrelevant; + static ZYPP_DEPRECATED const CapMatch yes; + static ZYPP_DEPRECATED const CapMatch no; + static ZYPP_DEPRECATED const CapMatch irrelevant; friend bool operator==( const CapMatch & lhs, const CapMatch & rhs ) { return lhs._result == rhs._result; } diff --git a/zypp/CapMatchHelper.h b/zypp/CapMatchHelper.h index b1bdab5..9ab3f80 100644 --- a/zypp/CapMatchHelper.h +++ b/zypp/CapMatchHelper.h @@ -46,24 +46,23 @@ namespace zypp */ //@{ - /** Algorithm invoking \c action_r on each \ref CapSet entry + /** Algorithm invoking \c action_r on each \ref Capabilities entry * that matches a given \ref Capability. */ - inline int forEachMatchIn( CapSet::const_iterator begin_r, - CapSet::const_iterator end_r, + inline int forEachMatchIn( Capabilities::const_iterator begin_r, + Capabilities::const_iterator end_r, const Capability & lhs_r, function action_r ) { - std::string index( lhs_r.index() ); return invokeOnEach( begin_r, end_r, MatchesCapability( lhs_r ), // filter action_r ); } - /** Algorithm invoking \c action_r on each \ref CapSet entry + /** Algorithm invoking \c action_r on each \ref Capabilities entry * that matches a given \ref Capability. */ - inline int forEachMatchIn( const CapSet & capset_r, + inline int forEachMatchIn( const Capabilities & capset_r, const Capability & lhs_r, function action_r ) { @@ -92,29 +91,33 @@ namespace zypp const Capability & lhs_r, function action_r ) { +#warning FIX BROKEN BROKEN POOL byCapabilityIndex + return -1; +#if 0 std::string index( lhs_r.index() ); return invokeOnEach( pool_r.byCapabilityIndexBegin( index, dep_r ), pool_r.byCapabilityIndexEnd( index, dep_r ), MatchesCapability( lhs_r ), // filter action_r ); +#endif } /////////////////////////////////////////////////////////////////// /** Functor invoking \c action_r on each matching \ref Capability - * in a \ref CapSet. + * in a \ref Capabilities. * * Functor is provided to ease using \ref forEachMatchIn as action - * in other algorithms (nested loop over two CapSets). + * in other algorithms (nested loop over two Capabilitiess). */ - class ForEachMatchInCapSet + class ForEachMatchInCapabilities { public: typedef function Action; public: - ForEachMatchInCapSet( const CapSet & set_r, const Action & action_r ) + ForEachMatchInCapabilities( const Capabilities & set_r, const Action & action_r ) : _set( set_r ) , _action( action_r ) {} @@ -126,18 +129,18 @@ namespace zypp } private: - const CapSet & _set; + const Capabilities & _set; Action _action; }; /** Invoke \c action_r on each matching pair of Capabilities within - * two CapSets. */ - inline int forEachMatchIn( const CapSet & lhs_r, - const CapSet & rhs_r, + * two Capabilitiess. */ + inline int forEachMatchIn( const Capabilities & lhs_r, + const Capabilities & rhs_r, function action_r ) { return invokeOnEach( lhs_r.begin(), lhs_r.end(), - ForEachMatchInCapSet( rhs_r, action_r ) ); + ForEachMatchInCapabilities( rhs_r, action_r ) ); } /////////////////////////////////////////////////////////////////// @@ -151,18 +154,18 @@ namespace zypp }; } - /** Return \c true if the CapSet contains at least one Capabilitiy + /** Return \c true if the Capabilities contains at least one Capabilitiy * that matches. */ - inline bool hasMatches( const CapSet & lhs_r, const Capability & rhs_r ) + inline bool hasMatches( const Capabilities & lhs_r, const Capability & rhs_r ) { return( forEachMatchIn( lhs_r, rhs_r, capmatch_detail::AlwaysFalse() ) < 0 ); } - /** Return \c true if the CapSets contain at least one pair of + /** Return \c true if the Capabilitiess contain at least one pair of * Capabilities that match. */ - inline bool hasMatches( const CapSet & lhs_r, const CapSet & rhs_r ) + inline bool hasMatches( const Capabilities & lhs_r, const Capabilities & rhs_r ) { return( forEachMatchIn( lhs_r, rhs_r, capmatch_detail::AlwaysFalse() ) < 0 ); } diff --git a/zypp/CapSet.cc b/zypp/CapSet.cc deleted file mode 100644 index ecfa84f..0000000 --- a/zypp/CapSet.cc +++ /dev/null @@ -1,36 +0,0 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/CapSet.cc - * -*/ -#include -#include - -#include "zypp/CapSet.h" - -using namespace std; - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - - /****************************************************************** - ** - ** FUNCTION NAME : operator<< - ** FUNCTION TYPE : std::ostream & - */ - std::ostream & operator<<( std::ostream & str, const CapSet & obj ) - { - copy( obj.begin(), obj.end(), ostream_iterator(str,"\n") ); - return str; - } - - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// diff --git a/zypp/CapSet.h b/zypp/CapSet.h deleted file mode 100644 index b1eed7a..0000000 --- a/zypp/CapSet.h +++ /dev/null @@ -1,29 +0,0 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/CapSet.h - * -*/ -#ifndef ZYPP_CAPSET_H -#define ZYPP_CAPSET_H - -#include - -#include "zypp/Capability.h" -#include "zypp/CapSetFwd.h" - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - - extern std::ostream & operator<<( std::ostream & str, const CapSet & obj ); - - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// -#endif // ZYPP_CAPSET_H diff --git a/zypp/CapSetFwd.h b/zypp/CapSetFwd.h deleted file mode 100644 index f6d65be..0000000 --- a/zypp/CapSetFwd.h +++ /dev/null @@ -1,28 +0,0 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/CapSetFwd.h - * -*/ -#ifndef ZYPP_CAPSETFWD_H -#define ZYPP_CAPSETFWD_H - -#include - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - - class Capability; - class CapOrder; - typedef std::set CapSet; - - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// -#endif // ZYPP_CAPSETFWD_H diff --git a/zypp/Capabilities.h b/zypp/Capabilities.h new file mode 100644 index 0000000..2013b22 --- /dev/null +++ b/zypp/Capabilities.h @@ -0,0 +1 @@ +#include "sat/Capabilities.h" diff --git a/zypp/Capability.cc b/zypp/Capability.cc deleted file mode 100644 index b644211..0000000 --- a/zypp/Capability.cc +++ /dev/null @@ -1,88 +0,0 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/Capability.cc - * -*/ -#include - -#include "zypp/Capability.h" -#include "zypp/capability/CapabilityImpl.h" -#include "zypp/capability/NullCap.h" - -using namespace std; - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - - const Capability Capability::noCap; - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : Capability::Capability - // METHOD TYPE : Ctor - // - Capability::Capability() - : _pimpl( capability::NullCap::instance() ) - {} - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : Capability::Capability - // METHOD TYPE : Ctor - // - Capability::Capability( Impl_Ptr impl_r ) - : _pimpl( impl_r ) - {} - - /////////////////////////////////////////////////////////////////// - // - // METHOD NAME : Capability::~Capability - // METHOD TYPE : Dtor - // - Capability::~Capability() - {} - - const Capability::Kind & Capability::kind() const - { return _pimpl->kind(); } - - const Resolvable::Kind & Capability::refers() const - { return _pimpl->refers(); } - - bool Capability::relevant() const - { return _pimpl->relevant(); } - - CapMatch Capability::matches( const Capability & rhs ) const - { return _pimpl->matches( rhs._pimpl.getPtr() ); } - - std::string Capability::asString() const - { return _pimpl->asString(); } - - std::string Capability::index() const - { return _pimpl->index(); } - -// Rel Capability::op() const -// { return _pimpl->op(); } -// -// Edition Capability::edition() const -// { return _pimpl->edition(); } - - /****************************************************************** - ** - ** FUNCTION NAME : operator<< - ** FUNCTION TYPE : std::ostream & - */ - std::ostream & operator<<( std::ostream & str, const Capability & obj ) - { - return str << obj._pimpl; - } - - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// diff --git a/zypp/Capability.h b/zypp/Capability.h index 37f53d6..d9d9d59 100644 --- a/zypp/Capability.h +++ b/zypp/Capability.h @@ -1,175 +1 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/Capability.h - * -*/ -#ifndef ZYPP_CAPABILITY_H -#define ZYPP_CAPABILITY_H - -#include -#include - -#include "zypp/base/PtrTypes.h" -#include "zypp/capability/CapTraits.h" -#include "zypp/Resolvable.h" -#include "zypp/CapMatch.h" - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////// - namespace capability - { ///////////////////////////////////////////////////////////////// - DEFINE_PTR_TYPE(CapabilityImpl); - ///////////////////////////////////////////////////////////////// - } // namespace capability - /////////////////////////////////////////////////////////////////// - - class CapFactory; - - /////////////////////////////////////////////////////////////////// - // - // CLASS NAME : Capability - // - /** Resolvable capabilitiy. - * - * Capability is created by a Factory class. Only a default ctor - * creating a dummy capability is provided. - * \code - * Capability cap; - * try - * { - * cap = CapFactory().parse( ResTraits::kind, - * parsed.name, - * parsed.op, - * Edition( parsed.ver, - * parsed.rel, - * parsed.epoch ) ); - * } - * catch ( Exception & excpt_r ) - * { - * ERR << excpt_r << endl; - * ... Or maybe just WAR, or ? - * } - * \endcode - * \see CapFactory: Factory creating Capability. - * - * \invariant Nonzero \c _pimpl - * \invariant Unified \c _pimpl asserted by CapFactory. - * - * \todo Need a trival return from matches. E.g. Conditional - * capabilities must be able to indicate that they should be - * treated as if they were not present at all, if the precondition - * does no apply. Same for the default Capability. - */ - class Capability - { - /** Ordering for use in CapSet */ - friend class CapOrder; - friend bool operator==( const Capability & lhs, const Capability & rhs ); - friend std::ostream & operator<<( std::ostream & str, const Capability & obj ); - - public: - /** */ - typedef capability::CapabilityTraits::KindType Kind; - - public: - /** DefaultCtor creating \ref noCap. */ - Capability(); - - /** Dtor */ - virtual ~Capability(); - - /** Constant representing no Capabiliy. - * It refers to no kind of Resolvable, and matches returns - * returns \c CapMatch::irrelevant. - */ - static const Capability noCap; - - public: - /** Kind of Capability. */ - const Kind & kind() const; - - /** Kind of Resolvable the Capability refers to. */ - const Resolvable::Kind & refers() const; - - /** Whether to consider this Capability. - * Evaluates the Capabilities pre-condition (if any), and - * returns whether the condition applies. If not, the Capability - * is to be ignored. - */ - bool relevant() const; - - /** Return whether the Capabilities match. - * If either Capability is not \ref relevant, CapMatch::irrelevant - * is returned. - */ - CapMatch matches( const Capability & rhs ) const; - - /** More or less human readable representation as string. */ - std::string asString() const; - - /** accessors needed by solver/zmd */ - /** Deprecated */ - std::string index() const; - - private: - typedef capability::CapabilityImpl Impl; - typedef capability::CapabilityImpl_Ptr Impl_Ptr ; - typedef capability::CapabilityImpl_constPtr Impl_constPtr; - - /** Factory */ - friend class CapFactory; - - /** Factory ctor */ - explicit - Capability( Impl_Ptr impl_r ); - - private: - /** */ - friend class capability::CapabilityImpl; - /** Pointer to implementation */ - RW_pointer > _pimpl; - }; - /////////////////////////////////////////////////////////////////// - - template - inline bool isKind( const Capability & cap ) - { return cap.kind() == capability::CapTraits<_Cap>::kind; } - - template - inline bool refersTo( const Capability & cap ) - { return cap.refers() == ResTraits<_Res>::kind; } - - /////////////////////////////////////////////////////////////////// - - /** Ordering relation used by ::CapSet. */ - struct CapOrder : public std::binary_function - { - bool operator()( const Capability & lhs, const Capability & rhs ) const - { return lhs._pimpl.get() < rhs._pimpl.get(); } - }; - - /////////////////////////////////////////////////////////////////// - - /** \relates Capability */ - inline bool operator==( const Capability & lhs, const Capability & rhs ) - { return lhs._pimpl.get() == rhs._pimpl.get(); } - - /** \relates Capability */ - inline bool operator!=( const Capability & lhs, const Capability & rhs ) - { return ! (lhs == rhs); } - - /** \relates Capability Stream output */ - extern std::ostream & operator<<( std::ostream & str, const Capability & obj ); - - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// -#endif // ZYPP_CAPABILITY_H +#include "sat/Capability.h" diff --git a/zypp/Dependencies.cc b/zypp/Dependencies.cc index 0d0b44b..8267fa5 100644 --- a/zypp/Dependencies.cc +++ b/zypp/Dependencies.cc @@ -11,8 +11,9 @@ */ #include +#include "zypp/base/LogTools.h" + #include "zypp/Dependencies.h" -#include "zypp/CapSet.h" using std::endl; diff --git a/zypp/Dependencies.h b/zypp/Dependencies.h index 118ae52..b4577ad 100644 --- a/zypp/Dependencies.h +++ b/zypp/Dependencies.h @@ -16,7 +16,7 @@ #include #include "zypp/Dep.h" -#include "zypp/CapSet.h" +#include "zypp/Capability.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -26,18 +26,18 @@ namespace zypp // // CLASS NAME : Dependencies // - /** Helper keeping CapSet for all kinds of dependencies. + /** Helper keeping CapabilitySet for all kinds of dependencies. */ - struct Dependencies + struct ZYPP_DEPRECATED Dependencies { - CapSet & operator[]( Dep idx_r ) + CapabilitySet & operator[]( Dep idx_r ) { return _capsets[idx_r]; } - const CapSet & operator[]( Dep idx_r ) const - { return const_cast&>(_capsets)[idx_r]; } + const CapabilitySet & operator[]( Dep idx_r ) const + { return const_cast&>(_capsets)[idx_r]; } private: - std::map _capsets; + std::map _capsets; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/Edition.cc b/zypp/Edition.cc index 26042a3..cdd9dfb 100644 --- a/zypp/Edition.cc +++ b/zypp/Edition.cc @@ -18,8 +18,6 @@ extern "C" #include "zypp/Edition.h" #include "zypp/sat/Pool.h" -using namespace std; - /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// @@ -56,12 +54,24 @@ namespace zypp : _str( makeevrstr( version_r, release_r, epoch_r ) ) {} + Edition::Edition( const char * version_r, + const char * release_r, + epoch_t epoch_r ) + : _str( makeevrstr( version_r, release_r, epoch_r ) ) + {} + Edition::Edition( const std::string & version_r, const std::string & release_r, const std::string & epoch_r ) : _str( makeevrstr( version_r, release_r, str::strtonum( epoch_r ) ) ) {} + Edition::Edition( const char * version_r, + const char * release_r, + const char * epoch_r ) + : _str( makeevrstr( version_r, release_r, str::strtonum( epoch_r ) ) ) + {} + Edition::epoch_t Edition::epoch() const { const char * str( c_str() ); diff --git a/zypp/Edition.h b/zypp/Edition.h index fbf482d..aec486d 100644 --- a/zypp/Edition.h +++ b/zypp/Edition.h @@ -86,11 +86,19 @@ namespace zypp Edition( const std::string & version_r, const std::string & release_r, epoch_t epoch_r = noepoch ); + /** \overload */ + Edition( const char * version_r, + const char * release_r, + epoch_t epoch_r = noepoch ); /** Ctor taking \a version_r, \a release_r and optional \a epoch_r as string. */ Edition( const std::string & version_r, const std::string & release_r, const std::string & epoch_r ); + /** \overload */ + Edition( const char * version_r, + const char * release_r, + const char * epoch_r ); public: /** Epoch */ diff --git a/zypp/Language.cc b/zypp/Language.cc index 9900362..5afbefd 100644 --- a/zypp/Language.cc +++ b/zypp/Language.cc @@ -11,28 +11,13 @@ */ #include "zypp/Language.h" #include "zypp/TranslatedText.h" -#include "zypp/CapFactory.h" /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////// - namespace detail - { ///////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // - // CLASS NAME : LanguageImpl - // - /** Exposition only. */ - class LanguageImpl : public LanguageImplIf - { - public: - LanguageImpl( const Locale & locale_r ) - : _locale( locale_r ) - {} - +#warning Check overloaded attributes +#if 0 public: virtual TranslatedText summary() const { return TranslatedText( _locale.name() ); } @@ -42,26 +27,17 @@ namespace zypp private: Locale _locale; - }; - /////////////////////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////////////////// - } // namespace detail - /////////////////////////////////////////////////////////////////// - +#endif IMPL_PTR_TYPE(Language); - - - /////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// // // METHOD NAME : Language::Language // METHOD TYPE : Ctor // - Language::Language( const NVRAD & nvrad_r ) - : ResObject( TraitsType::kind, nvrad_r ) + Language::Language( const sat::Solvable & solvable_r ) + : ResObject( solvable_r ) {} /////////////////////////////////////////////////////////////////// @@ -74,6 +50,9 @@ namespace zypp Language::Ptr Language::installedInstance( const Locale & locale_r ) { +#warning FIX CREATION OF LANGUAGE RESOLVABLES + return 0; +#if 0 static std::map _ptrmap; Ptr ret( _ptrmap[locale_r] ); if ( ! ret ) @@ -92,10 +71,14 @@ namespace zypp ret = _ptrmap[locale_r] = detail::makeResolvableFromImpl( dataCollect, langImpl ); } return ret; +#endif } Language::Ptr Language::availableInstance( const Locale & locale_r ) { +#warning FIX CREATION OF LANGUAGE RESOLVABLES + return 0; +#if 0 static std::map _ptrmap; Ptr ret( _ptrmap[locale_r] ); if ( ! ret ) @@ -114,8 +97,9 @@ namespace zypp ret = _ptrmap[locale_r] = detail::makeResolvableFromImpl( dataCollect, langImpl ); } return ret; +#endif } ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// + // namespace zypp +}/////////////////////////////////////////////////////////////////// diff --git a/zypp/Language.h b/zypp/Language.h index db46fc6..73a64c4 100644 --- a/zypp/Language.h +++ b/zypp/Language.h @@ -22,26 +22,6 @@ namespace zypp DEFINE_PTR_TYPE(Language); /////////////////////////////////////////////////////////////////// - namespace detail - { ///////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// - // - // CLASS NAME : LanguageImplIf - // - /** Exposition only. */ - class LanguageImplIf : public ResObjectImplIf - { - public: - typedef Language ResType; - }; - /////////////////////////////////////////////////////////////////// - - ///////////////////////////////////////////////////////////////// - } // namespace detail - /////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////// // // CLASS NAME : Language // @@ -50,7 +30,6 @@ namespace zypp class Language : public ResObject { public: - typedef detail::LanguageImplIf Impl; typedef Language Self; typedef ResTraits TraitsType; typedef TraitsType::PtrType Ptr; @@ -63,15 +42,9 @@ namespace zypp protected: /** Ctor */ - Language( const NVRAD & nvrad_r ); + Language( const sat::Solvable & solvable_r ); /** Dtor */ virtual ~Language(); - - private: - /** Access implementation */ - virtual Impl & pimpl() = 0; - /** Access implementation */ - virtual const Impl & pimpl() const = 0; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/Locks.cc b/zypp/Locks.cc index 73dceb8..fd7f2a6 100644 --- a/zypp/Locks.cc +++ b/zypp/Locks.cc @@ -16,9 +16,7 @@ #include "zypp/base/Logger.h" #include "zypp/base/IOStream.h" #include "zypp/PoolItem.h" -#include "zypp/CapFactory.h" #include "zypp/CapMatchHelper.h" -#include "zypp/capability/Capabilities.h" #undef ZYPP_BASE_LOGGER_LOGGROUP #define ZYPP_BASE_LOGGER_LOGGROUP "locks" @@ -120,20 +118,25 @@ struct AddLockToPool : _pool(pool) , _count(0) { - + } - + bool operator()( const std::string & str_r ) { +#warning MUST FIX LOCK IMPLEMENTATION + // - make Capability's parse 'Name [Op edition]' available so it can be used here + // - provide new, or extend Capability::Matches, functor to allow pattern (glob/rx) matching + return false; +#if 0 CapFactory cap_factory; - + std::string line( str::trim( str_r ) ); - + if ( line.empty() || line[0] == '#') return true; - + MIL << "Applying locks from pattern '" << str_r << "'" << endl; - + // zypp does not provide wildcard or regex support in the Capability matching helpers // but it still parses the index if it contains wildcards. // so we decompose the capability, and keep the op and edition, while, the name @@ -149,7 +152,7 @@ struct AddLockToPool try { Capability capability = cap_factory.parse( ResTraits::kind, line ); - + capability::NamedCap::constPtr named = capability::asKind(capability); if ( named ) { @@ -221,8 +224,9 @@ struct AddLockToPool ++_count; } return true; +#endif } // end operator()() - + ResPool _pool; int _count; }; diff --git a/zypp/Message.cc b/zypp/Message.cc index b9da306..a8aa71c 100644 --- a/zypp/Message.cc +++ b/zypp/Message.cc @@ -10,8 +10,7 @@ * */ #include "zypp/Message.h" - -using namespace std; +#include "zypp/Message.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -24,8 +23,8 @@ namespace zypp // METHOD NAME : Message::Message // METHOD TYPE : Ctor // - Message::Message( const NVRAD & nvrad_r ) - : ResObject( TraitsType::kind, nvrad_r ) + Message::Message( const sat::Solvable & solvable_r ) + : ResObject( solvable_r ) {} /////////////////////////////////////////////////////////////////// @@ -43,11 +42,12 @@ namespace zypp /////////////////////////////////////////////////////////////////// TranslatedText Message::text() const - { return pimpl().text(); } + { return TranslatedText(); } /** Patch the message belongs to - if any */ - Patch::constPtr Message::patch() const - { return pimpl().patch(); } + ResTraits::constPtrType Message::patch() const + { return ResTraits::constPtrType(); } + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// diff --git a/zypp/Message.h b/zypp/Message.h index 6cd2edd..856f724 100644 --- a/zypp/Message.h +++ b/zypp/Message.h @@ -13,7 +13,6 @@ #define ZYPP_MESSAGE_H #include "zypp/ResObject.h" -#include "zypp/detail/MessageImplIf.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -28,7 +27,6 @@ namespace zypp class Message : public ResObject { public: - typedef detail::MessageImplIf Impl; typedef Message Self; typedef ResTraits TraitsType; typedef TraitsType::PtrType Ptr; @@ -38,18 +36,12 @@ namespace zypp /** Get the text of the message */ TranslatedText text() const; /** Patch the message belongs to - if any */ - Patch::constPtr patch() const; + ResTraits::constPtrType patch() const; protected: - Message( const NVRAD & nvrad_r ); + Message( const sat::Solvable & solvable_r ); /** Dtor */ virtual ~Message(); - - private: - /** Access implementation */ - virtual Impl & pimpl() = 0; - /** Access implementation */ - virtual const Impl & pimpl() const = 0; }; ///////////////////////////////////////////////////////////////// diff --git a/zypp/NVRAD.h b/zypp/NVRAD.h index 68fd458..798aa76 100644 --- a/zypp/NVRAD.h +++ b/zypp/NVRAD.h @@ -14,6 +14,7 @@ #include "zypp/NVRA.h" #include "zypp/Dependencies.h" +#include "zypp/Resolvable.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -69,7 +70,7 @@ namespace zypp /** \relates NVRAD Stream output */ std::ostream & operator<<( std::ostream & str, const NVRAD & obj ); - + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// diff --git a/zypp/NeedAType.h b/zypp/NeedAType.h index 902818f..bbb6aee 100644 --- a/zypp/NeedAType.h +++ b/zypp/NeedAType.h @@ -58,7 +58,7 @@ namespace zypp /** Offer a License text and methods to remember confirmation. */ typedef std::string License; - + /** An rpm package group value. Also provide access to a * (singleton) tree like group hierarchy which contains * all existing groups. No more need to fiddle with YStringTreeItem @@ -73,15 +73,6 @@ namespace zypp /** Vendor. Worth a typedef. Maybe a class unifying the strings. */ typedef std::string Vendor; - /** Id used inside ZMD */ - typedef long ZmdId; - - /** Handle data depending on a locale. Translated strings, maybe - other too. */ - template - struct MultiLocale : public std::map - {}; - //@} ///////////////////////////////////////////////////////////////// } // namespace zypp diff --git a/zypp/Package.cc b/zypp/Package.cc index dcef8f7..4a88e5a 100644 --- a/zypp/Package.cc +++ b/zypp/Package.cc @@ -10,9 +10,6 @@ * */ #include "zypp/Package.h" -#include "zypp/base/Exception.h" - -using namespace std; /////////////////////////////////////////////////////////////////// namespace zypp @@ -25,8 +22,8 @@ namespace zypp // METHOD NAME : Package::Package // METHOD TYPE : Ctor // - Package::Package( const NVRAD & nvrad_r ) - : ResObject( TraitsType::kind, nvrad_r ) + Package::Package( const sat::Solvable & solvable_r ) + : ResObject( solvable_r ) {} /////////////////////////////////////////////////////////////////// @@ -44,76 +41,76 @@ namespace zypp /////////////////////////////////////////////////////////////////// Changelog Package::changelog() const - { return pimpl().changelog(); } + { return Changelog(); } /** */ std::string Package::buildhost() const - { return pimpl().buildhost(); } + { return std::string(); } /** */ std::string Package::distribution() const - { return pimpl().distribution(); } + { return std::string(); } /** */ Label Package::license() const - { return pimpl().license(); } + { return Label(); } /** */ std::string Package::packager() const - { return pimpl().packager(); } + { return std::string(); } /** */ PackageGroup Package::group() const - { return pimpl().group(); } + { return PackageGroup(); } Package::Keywords Package::keywords() const - { return pimpl().keywords(); } + { return Keywords(); } /** Don't ship it as class Url, because it might be * in fact anything but a legal Url. */ std::string Package::url() const - { return pimpl().url(); } + { return std::string(); } /** */ std::string Package::os() const - { return pimpl().os(); } + { return std::string(); } /** */ Text Package::prein() const - { return pimpl().prein(); } + { return Text(); } /** */ Text Package::postin() const - { return pimpl().postin(); } + { return Text(); } /** */ Text Package::preun() const - { return pimpl().preun(); } + { return Text(); } /** */ Text Package::postun() const - { return pimpl().postun(); } + { return Text(); } /** */ ByteCount Package::sourcesize() const - { return pimpl().sourcesize(); } + { return ByteCount(); } /** */ std::list Package::authors() const - { return pimpl().authors(); } + { return std::list(); } /** */ std::list Package::filenames() const - { return pimpl().filenames(); } + { return std::list(); } OnMediaLocation Package::location() const - { return pimpl().location(); } + { return OnMediaLocation(); } std::string Package::sourcePkgName() const - { return pimpl().sourcePkgName(); } + { return std::string(); } Edition Package::sourcePkgEdition() const - { return pimpl().sourcePkgEdition(); } + { return Edition(); } ///////////////////////////////////////////////////////////////// } // namespace zypp diff --git a/zypp/Package.h b/zypp/Package.h index 3047c05..1cc1ef3 100644 --- a/zypp/Package.h +++ b/zypp/Package.h @@ -13,7 +13,8 @@ #define ZYPP_PACKAGE_H #include "zypp/ResObject.h" -#include "zypp/detail/PackageImplIf.h" +#include "zypp/PackageKeyword.h" +#include "zypp/Changelog.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -30,7 +31,6 @@ namespace zypp class Package : public ResObject { public: - typedef detail::PackageImplIf Impl; typedef Package Self; typedef ResTraits TraitsType; typedef TraitsType::PtrType Ptr; @@ -98,15 +98,9 @@ namespace zypp OnMediaLocation location() const; protected: - Package( const NVRAD & nvrad_r ); + Package( const sat::Solvable & solvable_r ); /** Dtor */ virtual ~Package(); - - private: - /** Access implementation */ - virtual Impl & pimpl() = 0; - /** Access implementation */ - virtual const Impl & pimpl() const = 0; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/Patch.cc b/zypp/Patch.cc index f3fd3f6..9954773 100644 --- a/zypp/Patch.cc +++ b/zypp/Patch.cc @@ -11,8 +11,6 @@ */ #include "zypp/Patch.h" -using namespace std; - /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// @@ -24,8 +22,8 @@ namespace zypp // METHOD NAME : Patch::Patch // METHOD TYPE : Ctor // - Patch::Patch( const NVRAD & nvrad_r ) - : ResObject( TraitsType::kind, nvrad_r ) + Patch::Patch( const sat::Solvable & solvable_r ) + : ResObject( solvable_r ) {} /////////////////////////////////////////////////////////////////// @@ -43,34 +41,89 @@ namespace zypp /////////////////////////////////////////////////////////////////// std::string Patch::id() const - { return pimpl().id(); } + { return std::string(); } Date Patch::timestamp() const - { return pimpl().timestamp(); } + { return Date(); } std::string Patch::category() const - { return pimpl().category(); } + { return std::string(); } bool Patch::reboot_needed() const - { return pimpl().reboot_needed(); } + { return false; } bool Patch::affects_pkg_manager() const - { return pimpl().affects_pkg_manager(); } + { return false; } Patch::AtomList Patch::atoms() const - { return pimpl().all_atoms(); } + { +#warning Implement PATCH::ATOMS +#if 0 + if ( ! _atomlist ) + { + if ( ! hasBackRef() ) + { + // We are not jet connected to the Resolvable that + // contains our dependencies. + return AtomList(); + } + + // lazy init + _atomlist.reset( new AtomList ); + + // Build the list using the repositories resolvables. + // Installed Patches (no repository) have this method overloaded. + if ( repository() ) + { + const CapSet & requires( self()->dep( Dep::REQUIRES ) ); + const ResStore & store( repository().resolvables() ); + + for_( req, requires.begin(), requires.end() ) + { + // lookup Patch requirements that refer to an Atom, Script or Message. + if ( refersTo( *req ) || refersTo