void parsePackagesLang( SuseTagsImpl::Ptr sourceimpl, const Pathname & file_r, const Locale & lang_r, const PkgContent & content_r )
{
PackagesLangParser p ( sourceimpl, content_r, lang_r);
- MIL << "Starting with " << content_r.size() << " packages" << endl;
+ MIL << "Package descriptions/translations parser: [" << file_r << "]. Source [" << sourceimpl->selfSourceRef().alias() << "] at URL:[" << sourceimpl->selfSourceRef().url().asString() << "]. Starting with " << content_r.size() << " packages" << std::endl;
try
{
p.parse( file_r );
catch(zypp::parser::tagfile::ParseException &e)
{
ZYPP_CAUGHT(e);
- ERR << "Packages Lang " << file_r << " is broken." << std::endl;
+ ERR << "Bad Source [" << sourceimpl->selfSourceRef().alias() << "] at URL:[" << sourceimpl->selfSourceRef().url().asString() << "]. Packages descriptions/translations " << file_r << " is broken. You will not see translations." << std::endl;
return;
}
- MIL << "packages.LANG parser done. [ Total packages: " << content_r.size() << " ] [ Package data: " << sourceimpl->_package_data.size() << " ]" << std::endl;
+ MIL << "Source [" << sourceimpl->selfSourceRef().alias() << "] at URL:[" << sourceimpl->selfSourceRef().url().asString() << "]. packages.LANG parser done. [ Total packages: " << content_r.size() << " ] [ Package data: " << sourceimpl->_package_data.size() << " ]" << std::endl;
return;
}
{
std::vector<std::string> words;
if ( str::split( stag_r.value, std::back_inserter(words) ) != 4 )
- ZYPP_THROW( ParseException( "Expected [name version release arch], got [" + stag_r.value +"]") );
+ ZYPP_THROW( ParseException( "packages.DU - Expected [name version release arch], got [" + stag_r.value +"]") );
_pkg_pending = true;
_current_nvrad = NVRAD( words[0], Edition(words[1],words[2]), Arch(words[3]) );
}
else
{
- //ZYPP_THROW( ParseException( "Loc" ) );
- ERR << "warning found unexpected tag " << stag_r.name << std::endl;
+ //ZYPP_THROW( ParseException( "Unknown tag" ) );
+ ERR << "packages.DU - ERROR! found unexpected tag " << stag_r.name << std::endl;
}
}
}
else
{
- ERR << "Error parsing package size entry" << "[" << *it << "]" << std::endl;
- ZYPP_THROW( ParseException( "Dir" ) );
+ ZYPP_THROW( ParseException( std::string("Error parsing package size entry") + "[" + *it + "]" ) );
}
}
result[_current_nvrad] = usage;
capset.insert( CapFactory().parse( ResTraits<Package>::kind, *it ) );
}
catch (Exception & excpt_r) {
- ZYPP_CAUGHT(excpt_r);
+ ZYPP_THROW( ParseException("Bad source ["+ _source.alias() +"] at URL:[" + _source.url().asString() + "]. Can't parse capability: [" + *it + "]" ) );
}
}
}
str::split( stag_r.value, std::back_inserter(words) );
if ( str::split( stag_r.value, std::back_inserter(words) ) != 4 )
- ZYPP_THROW( ParseException( "Pkg error, we expected NVRA here, got: " + stag_r.value ) );
+ ZYPP_THROW( ParseException("Bad source ["+ _source.alias() +"] at URL:[" + _source.url().asString() + "]. error, we expected NVRA here, got: " + stag_r.value ) );
std::string arch = words[3];
#warning read comment in file
{
std::vector<std::string> words;
if ( str::split( stag_r.value, std::back_inserter(words) ) != 2 )
- ZYPP_THROW( ParseException( stag_r.name + " - Expected [type checksum], got [" + stag_r.value +"]") );
+ ZYPP_THROW( ParseException("Bad source ["+ _source.alias() +"] at URL:[" + _source.url().asString() + "]. Key: [" + stag_r.name + "] - Expected [type checksum], got [" + stag_r.value +"]"));
_pkgImpl->_checksum = CheckSum(words[0], words[1]);
}
str::split( stag_r.value, std::back_inserter(words) );
if ( str::split( stag_r.value, std::back_inserter(words) ) != 4 )
- ZYPP_THROW( ParseException( "Shr tag is wrong, expected NVRA, got: " + stag_r.value ) );
+ ZYPP_THROW( ParseException("Bad source ["+ _source.alias() +"] at URL:[" + _source.url().asString() + "]. Shr tag is wrong, expected NVRA, got: " + stag_r.value ) );
std::string arch = words[3];
NVRA shared_desc( words[0], Edition( words[1], words[2] ), Arch(arch));
{
std::vector<std::string> words;
if ( str::split( stag_r.value, std::back_inserter(words) ) != 2 )
- ZYPP_THROW( ParseException( "Siz" ) );
+ ZYPP_THROW( ParseException("Bad source ["+ _source.alias() +"] at URL:[" + _source.url().asString() + "]. Siz tag wrong. Got [" + stag_r.value + "]" ) );
_pkgImpl->_archivesize = str::strtonum<unsigned long>(words[0]);
_pkgImpl->_size = str::strtonum<unsigned long>(words[1]);
}
else
{
- ZYPP_THROW( ParseException( "Loc" ) );
+ ZYPP_THROW( ParseException("Bad source ["+ _source.alias() +"] at URL:[" + _source.url().asString() + "]. Bad [Loc] tag. Got: [" + stag_r.value + "]"));
}
// ignore path
}
catch(zypp::parser::tagfile::ParseException &e)
{
ZYPP_CAUGHT(e);
- ERR << "Package file " << file_r << " is broken." << std::endl;
- return PkgContent();
+ ERR << "Source [" << source_r.alias() << "] at URL:[" << source_r.url().asString() << "] has a broken packages file." << std::endl;
+ ZYPP_RETHROW(e);
}
return p.result();
}
catch(zypp::parser::tagfile::ParseException &e)
{
ZYPP_CAUGHT(e);
- ERR << "Disk usage " << file_r << " is broken." << std::endl;
- return PkgDiskUsage();
+ ERR << "Broken disk usage file " << file_r << ". Ignoring." << std::endl;
+ ZYPP_RETHROW(e);
}
return duParser.result;
}
{
std::ifstream file(file_r.asString().c_str());
- if (!file) {
- ZYPP_THROW (Exception("Can't read product file :" + file_r.asString()));
+ if (!file)
+ {
+ ZYPP_THROW (Exception("Bad source ["+ source_r.alias() +"] at URL:[" + source_r.url().asString() + "]. Can't open product file: [" + file_r.asString() + "]"));
}
std::string buffer;
if(boost::regex_match(buffer, what, e, boost::match_extra))
{
if ( what.size() < 5 )
- std::cout << "ups!!!!" << std::endl;
+ {
+ ZYPP_THROW (Exception("Corrupt source? ["+ source_r.alias() +"] at URL:[" + source_r.url().asString() + "]. Can't parse line: [" + buffer + "]"));
+ }
std::string key = what[2];
std::string value = what[5];
}
catch( ... )
{
- // do not add
+ ZYPP_THROW (Exception("Bad source ["+ source_r.alias() +"] at URL:[" + source_r.url().asString() + "]. Ilegal update Url: [" + *i + "]"));
}
}
}
else if(key == "VOLATILE_CONTENT")
volatile_content = true;
else
- DBG << "Unknown key [" << key << "] with value [" << value << "]" << std::endl;
+ {
+ ZYPP_THROW (Exception("Corrupt source ["+ source_r.alias() +"] at URL:[" + source_r.url().asString() + "]. Unknown key: [" + key + "] with value [" + value + "]"));
+ }
}
else if (!buffer.empty())
{
- DBG << "** No Match found: " << buffer << std::endl;
+ WAR << "Ignoring line [" << buffer << "] in source ["<< source_r.alias() << "] at URL:[" + source_r.url().asString() << "]." << std::endl;
}
} // end while
// finished parsing, store result
str::split( value, std::back_inserter(splitted), " ");
if (splitted.size() != 3)
{
- ERR << "Parse error in checksum. Expected [type checksum file], got [" << value << "]" << std::endl;
+ ZYPP_THROW (Exception("Parse error in checksum entry. Expected [algorithm checksum filename], got [" + value + "]"));
}
else
{
Selection::Ptr parseSelection( Source_Ref source_r, const Pathname & file_r )
{
- MIL << "Starting to parse selection " << file_r << std::endl;
+ MIL << "Parsing selection " << file_r << " on source [" << source_r.alias() << "] at URL:[" << source_r.url().asString() << "]." << std::endl;
+
SelectionTagFileParser p;
try
{
catch(zypp::parser::tagfile::ParseException &e)
{
ZYPP_CAUGHT(e);
- ERR << "Selection " << file_r << " is broken." << std::endl;
+ ERR << "Selection " << file_r << " on source [" << source_r.alias() << "] at URL:[" << source_r.url().asString() << "] is broken. Ignoring selection." << std::endl;
+
return 0L;
}
// attach the source
selImpl->_name = words[0];
break;
default:
- ZYPP_THROW( parser::tagfile::ParseException( "Expected [name [version] [release] [arch] ], got [" + tag.value +"]") );
+ ZYPP_THROW( parser::tagfile::ParseException( "Selection " + _file_r.asString() + ". Expected [name [version] [release] [arch] ], got [" + tag.value +"]"));
break;
}
}