| |
\---------------------------------------------------------------------*/
/** \file zypp/parser/yum/RepoParser.cc
- * YUM repository metadata parser implementation.
+ * YUM repository metadata parser implementation.
*/
#include <iostream>
*
* \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.
MIL << "Total files size: " << totalsize << endl;
_ticks.range(totalsize);
_ticks.toMin();
-
+
doJobs(cache_dir);
_ticks.toMax();
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
break;
}
- case ResourceType::PRODUCTS_e:
+ case ResourceType::PRODUCT_e:
{
ProductFileReader(
cache_dir + job.filename(),
static std::map<std::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);
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);
_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;
}
= _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;
}
_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";
}
/**
- *
+ *
*/
struct ResourceType
{
+ static const ResourceType NONE; // unknown
static const ResourceType REPOMD;
static const ResourceType PRIMARY;
static const ResourceType OTHER;
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;