00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: InstSrcDataUL.h 00014 00015 Author: Michael Andres <ma@suse.de> 00016 Maintainer: Michael Andres <ma@suse.de> 00017 00018 Purpose: Concrete InstSrcData able to handle UnitedLinux style layout. 00019 00020 /-*/ 00021 #ifndef InstSrcDataUL_h 00022 #define InstSrcDataUL_h 00023 00024 #include <iosfwd> 00025 #include <fstream> 00026 #include <y2util/LangCode.h> 00027 #include <y2util/TaggedFile.h> 00028 #include <y2util/TagCacheRetrieval.h> 00029 00030 #include <y2pm/PMULPackageDataProviderPtr.h> 00031 #include <y2pm/PMULSelectionDataProviderPtr.h> 00032 #include <y2pm/InstSrcDataULPtr.h> 00033 #include <y2pm/InstSrcData.h> 00034 #include <y2pm/InstSrcPtr.h> 00035 #include <y2pm/PMPackage.h> 00036 #include <y2pm/PMSelection.h> 00037 00038 #include <y2pm/ULParsePackagesLang.h> 00039 class ULParsePackagesLang; 00040 00042 // 00043 // CLASS NAME : InstSrcDataUL 00047 class InstSrcDataUL : public InstSrcData { 00048 REP_BODY(InstSrcDataUL); 00049 00050 private: 00054 std::list<PMSelectionPtr> _selections; 00055 std::list<PMPackagePtr> _packages; 00056 00057 public: 00058 00063 const std::list<PMSelectionPtr>& getSelections() const { return _selections; } 00064 00069 const std::list<PMPackagePtr>& getPackages() const { return _packages; } 00070 00076 const std::vector<PMYouPatchPtr>& getPatches (void) const { return InstData::getPatches(); } 00077 00081 virtual void preferredLocaleChanged() const; 00082 00086 void reparsePackagesLang( ULParsePackagesLang & parser_r ) const; 00087 00091 void adjustDpLangData( PMPackagePtr pkg_r, const ULParsePackagesLang::Entry & entry_r ) const; 00092 00093 public: 00094 00098 typedef InstSrcError Error; 00099 00100 public: 00101 00102 InstSrcDataUL(); 00103 ~InstSrcDataUL(); 00104 00108 virtual PMError writeCache( const Pathname & cache_dir_r ) const; 00109 00110 public: 00111 00121 static PMError tryGetDescr( InstSrcDescrPtr & ndescr_r, 00122 MediaAccessPtr media_r, const Pathname & product_dir_r ); 00123 00133 static PMError tryGetData( const InstSrcPtr source, InstSrcDataPtr & ndata_r, 00134 MediaAccessPtr media_r, Pathname descr_dir_r, 00135 const std::list<PkgArch>& allowed_archs, const LangCode& locale); 00136 00137 private: 00138 00139 friend class InstSrc; 00144 static PMError initDataCache( const Pathname & cache_dir_r, const InstSrcPtr source_r ); 00145 00146 }; 00147 00149 00150 #endif // InstSrcDataUL_h