Author: jkupec Date: Tue Jun 5 12:30:35 2007 New Revision: 5672 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5672&view=rev Log: moved YUMParser from zypp2 to zypp, renamed to RepoParser Added: trunk/libzypp/zypp/parser/yum/RepoParser.cc - copied, changed from r5668, trunk/libzypp/zypp2/parser/yum/YUMParser.cc trunk/libzypp/zypp/parser/yum/RepoParser.h - copied, changed from r5668, trunk/libzypp/zypp2/parser/yum/YUMParser.h Removed: trunk/libzypp/zypp2/parser/yum/YUMParser.cc trunk/libzypp/zypp2/parser/yum/YUMParser.h Modified: trunk/libzypp/devel/devel.jkupec/YUMParser_test.cc trunk/libzypp/zypp/CMakeLists.txt trunk/libzypp/zypp2/CMakeLists.txt trunk/libzypp/zypp2/RepoManager.cc Modified: trunk/libzypp/devel/devel.jkupec/YUMParser_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.jkupec/YUMParser_test.cc?rev=5672&r1=5671&r2=5672&view=diff ============================================================================== --- trunk/libzypp/devel/devel.jkupec/YUMParser_test.cc (original) +++ trunk/libzypp/devel/devel.jkupec/YUMParser_test.cc Tue Jun 5 12:30:35 2007 @@ -4,7 +4,7 @@ #include "zypp/base/LogControl.h" #include "zypp/base/Measure.h" #include "zypp2/cache/CacheStore.h" -#include "zypp2/parser/yum/YUMParser.h" +#include "zypp/parser/yum/RepoParser.h" #undef ZYPP_BASE_LOGGER_LOGGROUP #define ZYPP_BASE_LOGGER_LOGGROUP "yumparsertest" @@ -45,7 +45,7 @@ MIL << "creating PrimaryFileParser" << endl; Measure parse_primary_timer("primary.xml.gz parsing"); - parser::yum::YUMParser parser( repository_id, store, &progress_function); + parser::yum::RepoParser parser( repository_id, store, &progress_function); parser.parse(argv[1]); store.commit(); Modified: trunk/libzypp/zypp/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CMakeLists.txt?rev=5672&r1=5671&r2=5672&view=diff ============================================================================== --- trunk/libzypp/zypp/CMakeLists.txt (original) +++ trunk/libzypp/zypp/CMakeLists.txt Tue Jun 5 12:30:35 2007 @@ -533,6 +533,7 @@ parser/yum/YUMPrimaryParser.cc parser/yum/YUMProductParser.cc parser/yum/YUMRepomdParser.cc + parser/yum/RepoParser.cc parser/yum/FileReaderBaseImpl.cc parser/yum/RepomdFileReader.cc parser/yum/PatchesFileReader.cc @@ -556,6 +557,7 @@ parser/yum/YUMPrimaryParser.h parser/yum/YUMProductParser.h parser/yum/YUMRepomdParser.h + parser/yum/RepoParser.h parser/yum/FileReaderBase.h parser/yum/FileReaderBaseImpl.h parser/yum/RepomdFileReader.h Copied: trunk/libzypp/zypp/parser/yum/RepoParser.cc (from r5668, trunk/libzypp/zypp2/parser/yum/YUMParser.cc) URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/RepoParser.cc?p2=trunk/libzypp/zypp/parser/yum/RepoParser.cc&p1=trunk/libzypp/zypp2/parser/yum/YUMParser.cc&r1=5668&r2=5672&rev=5672&view=diff ============================================================================== --- trunk/libzypp/zypp2/parser/yum/YUMParser.cc (original) +++ trunk/libzypp/zypp/parser/yum/RepoParser.cc Tue Jun 5 12:30:35 2007 @@ -6,7 +6,7 @@ | /_____||_| |_| |_| | | | \---------------------------------------------------------------------*/ -/** \file zypp2/parser/yum/YUMParser.cc +/** \file zypp2/parser/yum/RepoParser.cc * YUM parser implementation. */ #include <iostream> @@ -26,7 +26,7 @@ #include "zypp/parser/yum/OtherFileReader.h" #include "zypp/parser/yum/FilelistsFileReader.h" -#include "YUMParser.h" +#include "zypp/parser/yum/RepoParser.h" #undef ZYPP_BASE_LOGGER_LOGGROUP @@ -54,9 +54,9 @@ /** * Structure encapsulating YUM parser data type and filename. */ - struct YUMParserJob + struct RepoParserJob { - YUMParserJob(const Pathname & filename, const YUMResourceType & type) + RepoParserJob(const Pathname & filename, const YUMResourceType & type) : _filename(filename), _type(type) {} const Pathname & filename() const { return _filename; } @@ -72,9 +72,9 @@ /////////////////////////////////////////////////////////////////////////// // - // CLASS NAME : YUMParser::Impl + // CLASS NAME : RepoParser::Impl // - class YUMParser::Impl : private base::NonCopyable + class RepoParser::Impl : private base::NonCopyable { public: /** CTOR */ @@ -84,7 +84,7 @@ const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() ); - /** Implementation of \ref YUMParser::parse(Pathname) */ + /** Implementation of \ref RepoParser::parse(Pathname) */ void parse(const Pathname &cache_dir); /** @@ -171,7 +171,7 @@ data::ResolvableDataConsumer & _consumer; /** List of parser jobs read from repomd.xml and patches.xml files. */ - std::list<YUMParserJob> _jobs; + std::list<RepoParserJob> _jobs; /** Progress reporting object for overall YUM parser progress. */ ProgressData _ticks; @@ -179,33 +179,33 @@ /////////////////////////////////////////////////////////////////////////// - YUMParser::Impl::Impl( + RepoParser::Impl::Impl( const data::RecordId & repository_id, data::ResolvableDataConsumer & consumer, const ProgressData::ReceiverFnc & progress) : _repository_id(repository_id), _consumer(consumer) { - _ticks.name("YUMParser"); + _ticks.name("RepoParser"); _ticks.sendTo(progress); } // ------------------------------------------------------------------------- - bool YUMParser::Impl::repomd_CB( + bool RepoParser::Impl::repomd_CB( const OnMediaLocation & loc, const YUMResourceType & dtype) { DBG << "Adding " << dtype - << " (" << loc.filename() << ") to YUMParser jobs " << endl; + << " (" << loc.filename() << ") to RepoParser jobs " << endl; - _jobs.push_back(YUMParserJob(loc.filename(), dtype)); + _jobs.push_back(RepoParserJob(loc.filename(), dtype)); return true; } // ------------------------------------------------------------------------- - bool YUMParser::Impl::primary_CB(const data::Package_Ptr & package_r) + bool RepoParser::Impl::primary_CB(const data::Package_Ptr & package_r) { _consumer.consumePackage( _repository_id, package_r ); @@ -221,19 +221,19 @@ // ------------------------------------------------------------------------- - bool YUMParser::Impl::patches_CB( + bool RepoParser::Impl::patches_CB( const OnMediaLocation & loc, const string & patch_id) { - DBG << "Adding patch " << loc.filename() << " to YUMParser jobs " << endl; + DBG << "Adding patch " << loc.filename() << " to RepoParser jobs " << endl; - _jobs.push_back(YUMParserJob(loc.filename(), YUMResourceType::PATCH)); + _jobs.push_back(RepoParserJob(loc.filename(), YUMResourceType::PATCH)); return true; } // ------------------------------------------------------------------------- - bool YUMParser::Impl::patch_CB(const data::Patch_Ptr & patch) + bool RepoParser::Impl::patch_CB(const data::Patch_Ptr & patch) { _consumer.consumePatch( _repository_id, patch ); @@ -247,7 +247,7 @@ // ------------------------------------------------------------------------- - bool YUMParser::Impl::other_CB( + bool RepoParser::Impl::other_CB( const data::Resolvable_Ptr & res_ptr, const Changelog & changelog) { _consumer.consumeChangelog(_repository_id, res_ptr, changelog); @@ -264,7 +264,7 @@ // ------------------------------------------------------------------------- - bool YUMParser::Impl::filelist_CB( + bool RepoParser::Impl::filelist_CB( const data::Resolvable_Ptr & res_ptr, const data::Filenames & filenames) { _consumer.consumeFilelist(_repository_id, res_ptr, filenames); @@ -281,7 +281,7 @@ // -------------------------------------------------------------------------- - bool YUMParser::Impl::pattern_CB(const data::Pattern_Ptr & product_ptr) + bool RepoParser::Impl::pattern_CB(const data::Pattern_Ptr & product_ptr) { _consumer.consumePattern(_repository_id, product_ptr); @@ -292,7 +292,7 @@ // -------------------------------------------------------------------------- - bool YUMParser::Impl::product_CB(const data::Product_Ptr & product_ptr) + bool RepoParser::Impl::product_CB(const data::Product_Ptr & product_ptr) { _consumer.consumeProduct(_repository_id, product_ptr); @@ -304,11 +304,11 @@ // -------------------------------------------------------------------------- - void YUMParser::Impl::parse(const Pathname &cache_dir) + void RepoParser::Impl::parse(const Pathname &cache_dir) { zypp::parser::yum::RepomdFileReader( cache_dir + "/repodata/repomd.xml", - bind(&YUMParser::Impl::repomd_CB, this, _1, _2)); + bind(&RepoParser::Impl::repomd_CB, this, _1, _2)); _ticks.range(_jobs.size()); @@ -321,12 +321,12 @@ // -------------------------------------------------------------------------- - void YUMParser::Impl::doJobs(const Pathname &cache_dir) + void RepoParser::Impl::doJobs(const Pathname &cache_dir) { - for(list<YUMParserJob>::const_iterator it = _jobs.begin(); + for(list<RepoParserJob>::const_iterator it = _jobs.begin(); it != _jobs.end(); ++it) { - YUMParserJob job = *it; + RepoParserJob job = *it; MIL << "going to parse " << job.type() << " file " << job.filename() << endl; @@ -337,7 +337,7 @@ { zypp::parser::yum::PrimaryFileReader( cache_dir + job.filename(), - bind(&YUMParser::Impl::primary_CB, this, _1), + bind(&RepoParser::Impl::primary_CB, this, _1), &progress_function); break; } @@ -346,7 +346,7 @@ { zypp::source::yum::PatchesFileReader( cache_dir + job.filename(), - bind(&YUMParser::Impl::patches_CB, this, _1, _2)); + bind(&RepoParser::Impl::patches_CB, this, _1, _2)); // reset progress reporter max value (number of jobs changed if // there are patches to parse) _ticks.range(_jobs.size()); @@ -357,7 +357,7 @@ { zypp::parser::yum::PatchFileReader( cache_dir + job.filename(), - bind(&YUMParser::Impl::patch_CB, this, _1)); + bind(&RepoParser::Impl::patch_CB, this, _1)); break; } @@ -367,7 +367,7 @@ /* zypp::parser::yum::Impl::OtherFileReader( cache_dir + job.filename(), - bind(&YUMParser::other_CB, this, _1, _2), + bind(&RepoParser::other_CB, this, _1, _2), &progress_function); */ break; @@ -377,7 +377,7 @@ { zypp::parser::yum::FilelistsFileReader( cache_dir + job.filename(), - bind(&YUMParser::Impl::filelist_CB, this, _1, _2), + bind(&RepoParser::Impl::filelist_CB, this, _1, _2), &progress_function); break; } @@ -386,7 +386,7 @@ { zypp::parser::yum::PatternFileReader( cache_dir + job.filename(), - bind(&YUMParser::Impl::pattern_CB, this, _1)); + bind(&RepoParser::Impl::pattern_CB, this, _1)); break; } @@ -394,7 +394,7 @@ { zypp::parser::yum::ProductFileReader( cache_dir + job.filename(), - bind(&YUMParser::Impl::product_CB, this, _1)); + bind(&RepoParser::Impl::product_CB, this, _1)); break; } @@ -414,11 +414,11 @@ /////////////////////////////////////////////////////////////////// // - // CLASS : YUMParser + // CLASS : RepoParser // /////////////////////////////////////////////////////////////////// - YUMParser::YUMParser( + RepoParser::RepoParser( const data::RecordId & repository_id, data::ResolvableDataConsumer & consumer, const ProgressData::ReceiverFnc & progress) @@ -427,11 +427,11 @@ {} - YUMParser::~YUMParser() + RepoParser::~RepoParser() {} - void YUMParser::parse(const Pathname & cache_dir) + void RepoParser::parse(const Pathname & cache_dir) { _pimpl->parse(cache_dir); } Copied: trunk/libzypp/zypp/parser/yum/RepoParser.h (from r5668, trunk/libzypp/zypp2/parser/yum/YUMParser.h) URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/RepoParser.h?p2=trunk/libzypp/zypp/parser/yum/RepoParser.h&p1=trunk/libzypp/zypp2/parser/yum/YUMParser.h&r1=5668&r2=5672&rev=5672&view=diff ============================================================================== --- trunk/libzypp/zypp2/parser/yum/YUMParser.h (original) +++ trunk/libzypp/zypp/parser/yum/RepoParser.h Tue Jun 5 12:30:35 2007 @@ -6,12 +6,12 @@ | /_____||_| |_| |_| | | | \---------------------------------------------------------------------*/ -/** \file zypp2/parser/yum/YUMParser.h +/** \file zypp2/parser/yum/RepoParser.h * * YUM parser public API definition. */ -#ifndef YUMPARSER_H_ -#define YUMPARSER_H_ +#ifndef ZYPP_PARSER_YUM_REPOPARSER_H_ +#define ZYPP_PARSER_YUM_REPOPARSER_H_ #include "zypp/base/PtrTypes.h" #include "zypp/base/NonCopyable.h" @@ -31,10 +31,10 @@ /** - * YUM metada parser. + * Main YUM repository metada parser. * * Reads repomd.xml file to get the list of files to parse and enques them - * as YUMParserJobs. Then uses *FileReader classes to parse the files and + * as RepoParserJobs. Then uses *FileReader classes to parse the files and * a \ref ResolvableDataConsumer to process the read data (typically to * store them in a database). * @@ -44,7 +44,7 @@ * cache::CacheStore store(dbdir); * data::RecordId repository_id = store.lookupOrAppendRepository(sourceurl, "/"); * - * YUMParser parser(repository_id, store, &progress_function); + * RepoParser parser(repository_id, store, &progress_function); * parser.parse(source_cache_dir); * * store.commit(); @@ -57,7 +57,7 @@ * \see FilelistsFileReader, PatchesFileReader, PatchFileReader * \see PatternFileReader, ProductFileReader */ - class YUMParser : private base::NonCopyable + class RepoParser : private base::NonCopyable { public: @@ -68,7 +68,7 @@ * \param consumer consumer of parsed data * \param progress progress reporting function */ - YUMParser( + RepoParser( const data::RecordId & repository_id, data::ResolvableDataConsumer & consumer, const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc() @@ -77,7 +77,7 @@ /** * DTOR */ - ~YUMParser(); + ~RepoParser(); /** * Starts parsing of repository cache dir located at \a path. @@ -99,6 +99,6 @@ } // ns parser } // ns zypp -#endif /*YUMPARSER_H_*/ +#endif /*ZYPP_PARSER_YUM_REPOPARSER_H_*/ // vim: set ts=2 sts=2 sw=2 et ai: Modified: trunk/libzypp/zypp2/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/CMakeLists.txt?rev=5672&r1=5671&r2=5672&view=diff ============================================================================== --- trunk/libzypp/zypp2/CMakeLists.txt (original) +++ trunk/libzypp/zypp2/CMakeLists.txt Tue Jun 5 12:30:35 2007 @@ -122,14 +122,6 @@ ) -SET( zypp2_parser_yum_SRCS - parser/yum/YUMParser.cc -) - -SET( zypp2_parser_yum_HEADERS - parser/yum/YUMParser.h -) - #INSTALL( FILES # ${zypp2_repository_sqlite-repository_HEADERS} # DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp2/repository/sqlite-repository Modified: trunk/libzypp/zypp2/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/RepoManager.cc?rev=5672&r1=5671&r2=5672&view=diff ============================================================================== --- trunk/libzypp/zypp2/RepoManager.cc (original) +++ trunk/libzypp/zypp2/RepoManager.cc Tue Jun 5 12:30:35 2007 @@ -27,7 +27,7 @@ #include "zypp/MediaSetAccess.h" #include "zypp/source/yum/YUMDownloader.h" -#include "zypp2/parser/yum/YUMParser.h" +#include "zypp/parser/yum/RepoParser.h" #include "zypp/source/susetags/SUSETagsDownloader.h" #include "zypp2/parser/susetags/RepoParser.h" @@ -299,7 +299,7 @@ { case RepoType::RPMMD_e : { - parser::yum::YUMParser parser(id, store); + parser::yum::RepoParser parser(id, store); parser.parse(rawpath); // no error } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org