YUMSourceImpl.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_SOURCE_YUM_YUMSOURCEIMPL_H
00013 #define ZYPP_SOURCE_YUM_YUMSOURCEIMPL_H
00014 
00015 #include "zypp/source/SourceImpl.h"
00016 #include "zypp/detail/ResImplTraits.h"
00017 #include "zypp/source/yum/YUMPackageImpl.h"
00018 #include "zypp/parser/yum/YUMParserData.h"
00019 #include "zypp/Package.h"
00020 #include "zypp/Atom.h"
00021 #include "zypp/Message.h"
00022 #include "zypp/Script.h"
00023 #include "zypp/Patch.h"
00024 #include "zypp/Product.h"
00025 #include "zypp/Selection.h"
00026 #include "zypp/Pattern.h"
00027 
00028 using namespace zypp::parser::yum;
00029 
00031 namespace zypp
00032 { 
00033 
00034   namespace source
00035   { 
00036     namespace yum
00037     { 
00038 
00040       //
00041       //        CLASS NAME : YUMSourceImpl
00042       //
00045       class YUMSourceImpl : public SourceImpl
00046       {
00047       public:
00052         YUMSourceImpl();
00053 
00054       public:
00055 
00056         virtual void storeMetadata(const Pathname & cache_dir_r);
00057         
00058         virtual std::string type(void) const
00059         { return typeString(); }
00060 
00065         static std::string typeString(void)
00066         { return "YUM"; }
00067 
00068         virtual void createResolvables(Source_Ref source_r);
00069 
00070         Package::Ptr createPackage(
00071           Source_Ref source_r,
00072           const zypp::parser::yum::YUMPrimaryData & parsed,
00073           const zypp::parser::yum::YUMFileListData & filelist,
00074           const zypp::parser::yum::YUMOtherData & other,
00075           zypp::detail::ResImplTraits<zypp::source::yum::YUMPackageImpl>::Ptr & impl
00076         );
00077         Atom::Ptr augmentPackage(
00078           Source_Ref source_r,
00079           const zypp::parser::yum::YUMPatchPackage & parsed
00080         );
00081         Selection::Ptr createGroup(
00082           Source_Ref source_r,
00083           const zypp::parser::yum::YUMGroupData & parsed
00084         );
00085         Pattern::Ptr createPattern(
00086           Source_Ref source_r,
00087           const zypp::parser::yum::YUMPatternData & parsed
00088         );
00089         Message::Ptr createMessage(
00090           Source_Ref source_r,
00091           const zypp::parser::yum::YUMPatchMessage & parsed,
00092           Patch::constPtr patch
00093         );
00094         Script::Ptr createScript(
00095           Source_Ref source_r,
00096           const zypp::parser::yum::YUMPatchScript & parsed
00097         );
00098         Patch::Ptr createPatch(
00099           Source_Ref source_r,
00100           const zypp::parser::yum::YUMPatchData & parsed
00101         );
00102         Product::Ptr createProduct(
00103           Source_Ref source_r,
00104           const zypp::parser::yum::YUMProductData & parsed
00105         );
00106 
00107 
00108         Dependencies createDependencies(
00109           const zypp::parser::yum::YUMObjectData & parsed,
00110           const Resolvable::Kind my_kind
00111         );
00112 
00113         Dependencies createGroupDependencies(
00114           const zypp::parser::yum::YUMGroupData & parsed
00115         );
00116 
00117         Capability createCapability(const YUMDependency & dep,
00118                                     const Resolvable::Kind & my_kind);
00119       private:
00124         virtual void factoryInit();
00125         
00129         void checkMetadataChecksums(bool from_cache);
00130 
00131       private:
00132         bool cacheExists();
00133         std::list<Pathname> _metadata_files;
00134         Pathname _repomd_file;
00135         Pathname _repomd_signature;
00136         Pathname _repomd_key;
00137 
00138         typedef struct {
00139             zypp::detail::ResImplTraits<zypp::source::yum::YUMPackageImpl>::Ptr impl;
00140             zypp::Package::Ptr package;
00141         } ImplAndPackage;
00142 
00143         typedef std::map<zypp::NVRA, ImplAndPackage> PackageImplMapT;
00144         PackageImplMapT _package_impl;
00145 
00146       public:
00147         static bool checkCheckSum (const Pathname & filename, std::string csum_type, const std::string & csum);
00148 
00149       };
00150 
00152     } // namespace yum
00154   } // namespace source
00157 } // namespace zypp
00159 #endif // ZYPP_SOURCE_YUM_YUMSOURCEIMPL_H

Generated on Thu May 4 16:03:28 2006 for zypp by  doxygen 1.4.6