From: Duncan Mac-Vicar P Date: Tue, 24 Jan 2006 15:58:13 +0000 (+0000) Subject: done X-Git-Tag: 6.6.0~5810 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=409720a3622875ac42660d49272206ca43d230d9;p=platform%2Fupstream%2Flibzypp.git done --- diff --git a/zypp/parser/tagfile/ProductMetadataParser.cc b/zypp/parser/tagfile/ProductMetadataParser.cc index 0b1d01db0..5166f0456 100644 --- a/zypp/parser/tagfile/ProductMetadataParser.cc +++ b/zypp/parser/tagfile/ProductMetadataParser.cc @@ -85,23 +85,40 @@ namespace zypp entry_r.release_notes_url = value; else if(key == "ARCH") parseLine( key, modifier, value, entry_r.arch); + else if(key == "DEFAULTBASE") + entry_r.default_base = value; + else if(key == "REQUIRES") + parseLine( key, value, entry_r.requires); + else if(key == "LINGUAS") + parseLine( key, value, entry_r.languages); + else if(key == "LABEL") + parseLine( key, modifier, value, entry_r.label); + else if(key == "DESCRDIR") + entry_r.description_dir = value; + else if(key == "DATADIR") + entry_r.data_dir = value; + else if(key == "FLAGS") + parseLine( key, value, entry_r.flags); + else if(key == "LANGUAGE") + entry_r.language = value; + else if(key == "TIMEZONE") + entry_r.timezone = value; else DBG << "parse error" << std::endl; } else { - std::cout << "** No Match found **\n"; + DBG << "** No Match found: " << buffer << std::endl; } - //std::cout << "hola: [" << buffer << "]" << std::endl; } } void ProductMetadataParser::parseLine( const string &key, const string &modif, const string &value, map< string, list > &container) { - if( modif.size() == 0) - str::split( value, std::back_inserter(container["default"]), " "); + if ( modif.size() == 0) + parseLine( key, value, container["default"]); else - str::split( value, std::back_inserter(container[modif]), " "); + parseLine( key, value, container[modif]); } void ProductMetadataParser::parseLine( const string &key, const string &modif, const string &value, map< string, string > &container) @@ -112,6 +129,12 @@ namespace zypp container[modif] = value; } + void ProductMetadataParser::parseLine( const string &key, const string &value, std::list &container) + { + str::split( value, std::back_inserter(container), " "); + } + + ///////////////////////////////////////////////////////////////// } // namespace tagfile /////////////////////////////////////////////////////////////////// diff --git a/zypp/parser/tagfile/ProductMetadataParser.h b/zypp/parser/tagfile/ProductMetadataParser.h index 267901fb9..345c01a94 100644 --- a/zypp/parser/tagfile/ProductMetadataParser.h +++ b/zypp/parser/tagfile/ProductMetadataParser.h @@ -54,7 +54,7 @@ namespace zypp std::string release_notes_url; std::map< std::string, std::list > arch; std::string default_base; - std::string requires; + std::list requires; std::list languages; std::map< std::string, std::string > label; std::string description_dir; @@ -84,14 +84,18 @@ namespace zypp */ void parse( const Pathname & file_r, ProductEntry &entry_r ); /* Parse a key.modifier (std::list of std::strings) + * That means, translatable tag with multiple values * the default modifier will get the modifier of default (LABEL.de, LABEL as LANGUAGE.default) */ - void parseLine( const std::string &key, const std::string &modifr, const std::string &value, std::map< std::string, std::list > &container); + void parseLine( const std::string &key, const std::string &modif, const std::string &value, std::map< std::string, std::list > &container); /* - * same as above, but the value is a single std::string + * same as above, but the value is a single std::string, this means, translatable tags, with only 1 value */ void parseLine( const std::string &key,const std::string &modif, const std::string &value, std::map< std::string, std::string > &container); - + /* + * Non translatable tag with multiple values + */ + void parseLine( const std::string &key, const std::string &value, std::list &container); }; ///////////////////////////////////////////////////////////////////