00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ULPackagesParser_h
00022 #define ULPackagesParser_h
00023
00024 #include <string>
00025 #include <list>
00026 #include <map>
00027 #include <utility>
00028 #include <fstream>
00029
00030 #include <y2util/Pathname.h>
00031 #include <y2util/LangCode.h>
00032 #include <y2util/TaggedParser.h>
00033 #include <y2util/TaggedFile.h>
00034 #include <y2util/TagCacheRetrievalPtr.h>
00035
00036 #include <y2pm/PMError.h>
00037 #include <y2pm/MediaAccessPtr.h>
00038
00039 #include <y2pm/PkgArch.h>
00040
00041 #include <y2pm/PMPackagePtr.h>
00042 #include <y2pm/PMULPackageDataProviderPtr.h>
00043 #include <y2pm/InstSrcPtr.h>
00044
00045 #include <y2pm/ULPackagesParserPtr.h>
00046
00047 class ULPackagesParser : public CountedRep {
00048 private:
00049
00050 const InstSrcPtr _source;
00051
00052
00053 enum Tags {
00054 PACKAGE,
00055 REQUIRES,
00056 PREREQUIRES,
00057 PROVIDES,
00058 CONFLICTS,
00059 OBSOLETES,
00060 RECOMMENDS,
00061 SUGGESTS,
00062 LOCATION,
00063 SIZE,
00064 BUILDTIME,
00065 SOURCERPM,
00066 GROUP,
00067 LICENSE,
00068 AUTHORS,
00069 SHAREWITH,
00070 KEYWORDS,
00071
00072
00073
00074 SUMMARY,
00075 DESCRIPTION,
00076 INSNOTIFY,
00077 DELNOTIFY,
00078 LICENSETOCONFIRM,
00079
00080
00081 DU,
00082
00083 NUM_TAGS
00084 };
00085
00086
00087
00088 TaggedParser _parser;
00089
00090 TaggedFile::TagSet _tagset;
00091
00092
00093 std::list<PkgArch> _allowed_archs;
00094
00095
00096
00097
00098 typedef std::map <std::string, std::pair<PMPackagePtr, PMULPackageDataProviderPtr> > pkgmaptype;
00099 pkgmaptype _pkgmap;
00100
00101
00102 bool allowedArch (const PkgArch& arch) const;
00103
00104
00105 PMError fromCache (TagCacheRetrievalPtr pkgcache, TagCacheRetrievalPtr localecache, TagCacheRetrievalPtr ducache);
00106
00107
00108 PMError fromLocale ();
00109
00110
00111 PMError fromDU ();
00112
00113
00114
00115
00116 PMError fromPath (const Pathname& path, const Pathname& localepath, const Pathname& dupath);
00117
00118
00119 PMError fromPathLocale (const Pathname& path);
00120
00121
00122 PMError fromPathDU (const Pathname& path);
00123
00124 public:
00125 ULPackagesParser (const InstSrcPtr source);
00126 ~ULPackagesParser();
00127
00133 PMError fromMediaDir (std::list<PMPackagePtr>& packages,
00134 MediaAccessPtr media_r, const Pathname& descr_dir_r,
00135 const std::list<PkgArch>& allowed_archs, const LangCode& locale);
00136
00137 };
00138
00139 #endif //ULPackagesParser_h