#include "zypp/parser/susetags/ContentFileReader.h"
#include "zypp/parser/susetags/RepoIndex.h"
-#include "zypp/ZConfig.h"
-
using std::endl;
#undef ZYPP_BASE_LOGGER_LOGGROUP
#define ZYPP_BASE_LOGGER_LOGGROUP "parser::susetags"
void ContentFileReader::parse( const InputStream & input_r,
const ProgressData::ReceiverFnc & fnc_r )
{
- MIL << "Start parsing " << input_r << endl;
+ MIL << "Start parsing content repoindex" << input_r << endl;
if ( ! input_r.stream() )
{
std::ostringstream s;
if ( ! ticks.toMin() )
userRequestedAbort( 0 );
- Arch sysarch( ZConfig::instance().systemArchitecture() );
-
iostr::EachLine line( input_r );
for( ; line; line.next() )
{
//
// ReppoIndex related data:
//
- else if ( key == "DEFAULTBASE" )
- {
- _pimpl->repoindex().defaultBase = Arch(value);
- }
else if ( key == "DESCRDIR" )
{
_pimpl->repoindex().descrdir = value;
{
_pimpl->repoindex().datadir = value;
}
- else if ( key == "FLAGS" )
- {
- str::split( value, std::back_inserter( _pimpl->repoindex().flags ) );
- }
else if ( key == "KEY" )
{
if ( _pimpl->setFileCheckSum( _pimpl->repoindex().signingKeys, value ) )
ZYPP_THROW( ParseException( errPrefix( line.lineNo(), "Expected [KEY algorithm checksum filename]", *line ) ) );
}
}
- else if ( key == "LANGUAGE" )
- {
- _pimpl->repoindex().language;
- }
- else if ( key == "LINGUAS" )
- {
- std::set<std::string> strval;
- str::split( value, std::inserter( strval, strval.end() ) );
- for ( std::set<std::string>::const_iterator it = strval.begin(); it != strval.end(); ++it )
- {
- _pimpl->repoindex().languages.push_back( Locale(*it) );
- }
- }
else if ( key == "META" )
{
if ( _pimpl->setFileCheckSum( _pimpl->repoindex().metaFileChecksums, value ) )
ZYPP_THROW( ParseException( errPrefix( line.lineNo(), "Expected [algorithm checksum filename]", *line ) ) );
}
}
- else if ( key == "TIMEZONE" )
+ else
{
- _pimpl->repoindex().timezone = value;
- }
- else
- { WAR << errPrefix( line.lineNo(), "Unknown tag", *line ) << endl; }
+ DBG << errPrefix( line.lineNo(), "ignored", *line ) << endl;
+ }
if ( ! ticks.set( input_r.stream().tellg() ) )
//_datadir = _repoIndex->datadir; // path below reporoot
- for ( RepoIndex::FileChecksumMap::const_iterator it = _repoindex->metaFileChecksums.begin();
- it != _repoindex->metaFileChecksums.end();
- ++it )
+ for_( it, _repoindex->metaFileChecksums.begin(), _repoindex->metaFileChecksums.end() )
{
// omit unwanted translations
if ( str::hasPrefix( it->first, "packages" ) )
this->enqueueDigested(location);
}
- for ( RepoIndex::FileChecksumMap::const_iterator it = _repoindex->signingKeys.begin();
- it != _repoindex->signingKeys.end();
- ++it )
+ for_( it, _repoindex->mediaFileChecksums.begin(), _repoindex->mediaFileChecksums.end() )
{
+ // Repo adopts license files listed in HASH
+ if ( it->first != "license.tar.gz" )
+ continue;
+
+ MIL << "adding job " << it->first << endl;
+ OnMediaLocation location( repoInfo().path() + it->first, 1 );
+ location.setChecksum( it->second );
+ this->enqueueDigested(location);
+ }
+
+ for_( it, _repoindex->signingKeys.begin(),_repoindex->signingKeys.end() )
+ {
+ MIL << "adding job " << it->first << endl;
OnMediaLocation location( repoInfo().path() + it->first, 1 );
location.setChecksum( it->second );
this->enqueueDigested(location);