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 using namespace zypp::filesystem;
00030 
00032 namespace zypp
00033 { 
00034 
00035   namespace source
00036   { 
00037     namespace yum
00038     { 
00039 
00044 
00045       //
00046       //        CLASS NAME : YUMSourceImpl
00047       //
00050       class YUMSourceImpl : public SourceImpl
00051       {
00052       public:
00053         
00058         YUMSourceImpl();
00059 
00060       public:
00061 
00062         virtual Date timestamp() const;
00063         virtual void storeMetadata(const Pathname & cache_dir_r);
00064         
00065         virtual std::string type(void) const
00066         { return typeString(); }
00067 
00072         static std::string typeString(void)
00073         { return "YUM"; }
00074 
00075         virtual void createResolvables(Source_Ref source_r);
00076 
00081         bool downloadNeeded(const Pathname & localdir);
00082         
00083         Package::Ptr createPackage(
00084           Source_Ref source_r,
00085           const zypp::parser::yum::YUMPrimaryData & parsed,
00086           const zypp::parser::yum::YUMFileListData & filelist,
00087           const zypp::parser::yum::YUMOtherData & other,
00088           zypp::detail::ResImplTraits<zypp::source::yum::YUMPackageImpl>::Ptr & impl
00089         );
00090         Atom::Ptr augmentPackage(
00091           Source_Ref source_r,
00092           const zypp::parser::yum::YUMPatchPackage & parsed
00093         );
00094         Selection::Ptr createGroup(
00095           Source_Ref source_r,
00096           const zypp::parser::yum::YUMGroupData & parsed
00097         );
00098         Pattern::Ptr createPattern(
00099           Source_Ref source_r,
00100           const zypp::parser::yum::YUMPatternData & parsed
00101         );
00102         Message::Ptr createMessage(
00103           Source_Ref source_r,
00104           const zypp::parser::yum::YUMPatchMessage & parsed,
00105           Patch::constPtr patch
00106         );
00107         Script::Ptr createScript(
00108           Source_Ref source_r,
00109           const zypp::parser::yum::YUMPatchScript & parsed
00110         );
00111         Patch::Ptr createPatch(
00112           Source_Ref source_r,
00113           const zypp::parser::yum::YUMPatchData & parsed
00114         );
00115         Product::Ptr createProduct(
00116           Source_Ref source_r,
00117           const zypp::parser::yum::YUMProductData & parsed
00118         );
00119 
00120 
00121         Dependencies createDependencies(
00122           const zypp::parser::yum::YUMObjectData & parsed,
00123           const Resolvable::Kind my_kind
00124         );
00125 
00126         Dependencies createGroupDependencies(
00127           const zypp::parser::yum::YUMGroupData & parsed
00128         );
00129 
00130         Capability createCapability(const YUMDependency & dep,
00131                                     const Resolvable::Kind & my_kind);
00132       private:
00137         virtual void factoryInit();
00138         
00142         void checkMetadataChecksums() const;
00143       private:
00144         
00145         const Pathname metadataRoot() const;
00146         bool cacheExists();
00147         const TmpDir downloadMetadata();
00148         void saveMetadataTo(const Pathname & dir_r);
00149         const Pathname repomdFile() const;
00150         const Pathname repomdFileSignature() const;
00151         const Pathname repomdFileKey() const;
00152         
00153         typedef struct {
00154             zypp::detail::ResImplTraits<zypp::source::yum::YUMPackageImpl>::Ptr impl;
00155             zypp::Package::Ptr package;
00156         } ImplAndPackage;
00157 
00158         typedef std::map<zypp::NVRA, ImplAndPackage> PackageImplMapT;
00159         PackageImplMapT _package_impl;
00160 
00161       public:
00162         static bool checkCheckSum (const Pathname & filename, std::string csum_type, const std::string & csum);
00163 
00164       };
00165 
00167     } // namespace yum
00169   } // namespace source
00172 } // namespace zypp
00174 #endif // ZYPP_SOURCE_YUM_YUMSOURCEIMPL_H

Generated on Thu Jul 6 00:07:25 2006 for zypp by  doxygen 1.4.6