Author: mlandres Date: Fri Nov 9 11:18:04 2007 New Revision: 7762 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7762&view=rev Log: Dont throw on unknown yum resource type. Modified: trunk/libzypp/zypp/parser/yum/RepoParser.cc trunk/libzypp/zypp/repo/yum/ResourceType.cc trunk/libzypp/zypp/repo/yum/ResourceType.h Modified: trunk/libzypp/zypp/parser/yum/RepoParser.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/RepoParser.cc?rev=7762&r1=7761&r2=7762&view=diff ============================================================================== --- trunk/libzypp/zypp/parser/yum/RepoParser.cc (original) +++ trunk/libzypp/zypp/parser/yum/RepoParser.cc Fri Nov 9 11:18:04 2007 @@ -7,7 +7,7 @@ | | \---------------------------------------------------------------------*/ /** \file zypp/parser/yum/RepoParser.cc - * YUM repository metadata parser implementation. + * YUM repository metadata parser implementation. */ #include <iostream> @@ -103,7 +103,7 @@ * * \param package_r pointer to package data */ - bool primary_CB(const data::Packagebase_Ptr & package_r); + bool primary_CB(const data::Packagebase_Ptr & package_r); /** * Callback for processing data returned from \ref PatchesFileReader. @@ -322,7 +322,7 @@ MIL << "Total files size: " << totalsize << endl; _ticks.range(totalsize); _ticks.toMin(); - + doJobs(cache_dir); _ticks.toMax(); @@ -338,10 +338,10 @@ RepoParserJob job = *it; // FIXME better way to do progress here? int jobsize = PathInfo(cache_dir + job.filename()).size(); - - MIL << "going to parse " << job.type() << " file " + + MIL << "going to parse " << job.type() << " file " << job.filename() << " (" << jobsize << " bytes)" << endl; - + switch(job.type().toEnum()) { // parse primary.xml.gz @@ -431,7 +431,7 @@ break; } - case ResourceType::PRODUCTS_e: + case ResourceType::PRODUCT_e: { ProductFileReader( cache_dir + job.filename(), Modified: trunk/libzypp/zypp/repo/yum/ResourceType.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/yum/ResourceType.cc?rev=7762&r1=7761&r2=7762&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/yum/ResourceType.cc (original) +++ trunk/libzypp/zypp/repo/yum/ResourceType.cc Fri Nov 9 11:18:04 2007 @@ -22,6 +22,7 @@ static std::mapstd::string,ResourceType::Type _table; + const ResourceType ResourceType::NONE(ResourceType::NONE_e); const ResourceType ResourceType::REPOMD(ResourceType::REPOMD_e); const ResourceType ResourceType::PRIMARY(ResourceType::PRIMARY_e); const ResourceType ResourceType::OTHER(ResourceType::OTHER_e); @@ -29,7 +30,7 @@ const ResourceType ResourceType::GROUP(ResourceType::GROUP_e); const ResourceType ResourceType::PATCHES(ResourceType::PATCHES_e); const ResourceType ResourceType::PATCH(ResourceType::PATCH_e); - const ResourceType ResourceType::PRODUCTS(ResourceType::PRODUCTS_e); + const ResourceType ResourceType::PRODUCT(ResourceType::PRODUCT_e); const ResourceType ResourceType::PATTERNS(ResourceType::PATTERNS_e); @@ -49,7 +50,7 @@ _table["group"] = ResourceType::GROUP_e; _table["patches"] = ResourceType::PATCHES_e; _table["patch"] = ResourceType::PATCH_e; - _table["products"] = ResourceType::PRODUCTS_e; + _table["product"] = ResourceType::PRODUCT_e; _table["patterns"] = ResourceType::PATTERNS_e; _table["NONE"] = _table["none"] = ResourceType::NONE_e; } @@ -58,8 +59,7 @@ = _table.find(strval_r); if (it == _table.end()) { - ZYPP_THROW(Exception( - "ResourceType parse: illegal string value '" + strval_r + "'")); + return ResourceType::NONE_e; } return it->second; } @@ -78,7 +78,7 @@ _table[GROUP_e] = "group"; _table[PATCHES_e] = "patches"; _table[PATCH_e] = "patch"; - _table[PRODUCTS_e] = "products"; + _table[PRODUCT_e] = "product"; _table[PATTERNS_e] = "patterns"; _table[NONE_e] = "NONE"; } Modified: trunk/libzypp/zypp/repo/yum/ResourceType.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/yum/ResourceType.h?rev=7762&r1=7761&r2=7762&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/yum/ResourceType.h (original) +++ trunk/libzypp/zypp/repo/yum/ResourceType.h Fri Nov 9 11:18:04 2007 @@ -22,10 +22,11 @@ /** - * + * */ struct ResourceType { + static const ResourceType NONE; // unknown static const ResourceType REPOMD; static const ResourceType PRIMARY; static const ResourceType OTHER; @@ -55,7 +56,7 @@ explicit ResourceType(const std::string & strval_r); Type toEnum() const { return _type; } - + ResourceType::Type parse(const std::string & strval_r); const std::string & asString() const; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org