, _pkgGpgCheck( indeterminate )
, _validRepoSignature( indeterminate )
, keeppackages(indeterminate)
- , _mirrorListForceMetalink(false)
, type(repo::RepoType::NONE_e)
, emptybaseurls(false)
{}
public:
static const unsigned defaultPriority = 99;
- static const unsigned noPriority = unsigned(-1);
void setProbedType( const repo::RepoType & t ) const
{
{
emptybaseurls = true;
DBG << "MetadataPath: " << metadatapath << endl;
- repo::RepoMirrorList rmurls( mlurl, metadatapath, _mirrorListForceMetalink );
+ repo::RepoMirrorList rmurls( mlurl, metadatapath );
_baseUrls.raw().insert( _baseUrls.raw().end(), rmurls.getUrls().begin(), rmurls.getUrls().end() );
}
return _baseUrls;
RepoVariablesReplacedUrlList & gpgKeyUrls()
{ return _gpgKeyUrls; }
-
- const std::set<std::string> & contentKeywords() const
- { hasContent()/*init if not yet done*/; return _keywords.second; }
-
void addContent( const std::string & keyword_r )
- { _keywords.second.insert( keyword_r ); if ( ! hasContent() ) _keywords.first = true; }
+ { _keywords.insert( keyword_r ); }
- bool hasContent() const
+ bool hasContent( const std::string & keyword_r ) const
{
- if ( !_keywords.first && ! metadatapath.empty() )
+ if ( _keywords.empty() && ! metadatapath.empty() )
{
// HACK directly check master index file until RepoManager offers
- // some content probing and zypper uses it.
+ // some content probing ans zypepr uses it.
/////////////////////////////////////////////////////////////////
MIL << "Empty keywords...." << metadatapath << endl;
Pathname master;
xml::Reader reader( master );
while ( reader.seekToNode( 2, "content" ) )
{
- _keywords.second.insert( reader.nodeText().asString() );
+ _keywords.insert( reader.nodeText().asString() );
reader.seekToEndNode( 2, "content" );
}
- _keywords.first = true; // valid content in _keywords even if empty
+ _keywords.insert( "" ); // valid content in _keywords even if empty
}
else if ( PathInfo( (master=metadatapath/"/content") ).isFile() )
{
if ( str::split( line_r, std::back_inserter(words) ) > 1
&& words[0].length() == 12 /*"REPOKEYWORDS"*/ )
{
- this->_keywords.second.insert( ++words.begin(), words.end() );
+ this->_keywords.insert( ++words.begin(), words.end() );
}
return true; // mult. occurrances are ok.
}
return( ! str::startsWith( line_r, "META " ) ); // no need to parse into META section.
} );
- _keywords.first = true; // valid content in _keywords even if empty
+ _keywords.insert( "" );
}
/////////////////////////////////////////////////////////////////
}
- return _keywords.first;
+ return( _keywords.find( keyword_r ) != _keywords.end() );
}
- bool hasContent( const std::string & keyword_r ) const
- { return( hasContent() && _keywords.second.find( keyword_r ) != _keywords.second.end() ); }
-
/** Signature check result needs to be stored/retrieved from _metadatapath.
* Don't call them from outside validRepoSignature/setValidRepoSignature
*/
public:
TriBool keeppackages;
RepoVariablesReplacedUrl _mirrorListUrl;
- bool _mirrorListForceMetalink;
repo::RepoType type;
Pathname path;
std::string service;
private:
mutable RepoVariablesReplacedUrlList _baseUrls;
- mutable std::pair<FalseBool, std::set<std::string> > _keywords;
+ mutable std::set<std::string> _keywords;
RepoVariablesReplacedUrlList _gpgKeyUrls;
unsigned RepoInfo::defaultPriority()
{ return Impl::defaultPriority; }
- unsigned RepoInfo::noPriority()
- { return Impl::noPriority; }
-
void RepoInfo::setPriority( unsigned newval_r )
{ _pimpl->priority = newval_r ? newval_r : Impl::defaultPriority; }
void RepoInfo::setMirrorListUrl( const Url & url_r ) // Raw
- { _pimpl->_mirrorListUrl.raw() = url_r; _pimpl->_mirrorListForceMetalink = false; }
-
- void RepoInfo::setMetalinkUrl( const Url & url_r ) // Raw
- { _pimpl->_mirrorListUrl.raw() = url_r; _pimpl->_mirrorListForceMetalink = true; }
+ { _pimpl->_mirrorListUrl.raw() = url_r; }
void RepoInfo::setGpgKeyUrls( url_set urls )
{ _pimpl->gpgKeyUrls().raw().swap( urls ); }
bool RepoInfo::baseUrlSet() const
{ return _pimpl->baseurl2dump(); }
- const std::set<std::string> & RepoInfo::contentKeywords() const
- { return _pimpl->contentKeywords(); }
void RepoInfo::addContent( const std::string & keyword_r )
{ _pimpl->addContent( keyword_r ); }
- bool RepoInfo::hasContent() const
- { return _pimpl->hasContent(); }
-
bool RepoInfo::hasContent( const std::string & keyword_r ) const
{ return _pimpl->hasContent( keyword_r ); }
return std::string();
Locale getLang( Locale::bestMatch( avlocales, lang_r ) );
- if ( !getLang && avlocales.find( Locale::noCode ) == avlocales.end() )
+ if ( getLang == Locale::noCode
+ && avlocales.find( Locale::noCode ) == avlocales.end() )
{
WAR << "License.tar.gz contains no fallback text! " << *this << endl;
// Using the fist locale instead of returning no text at all.
// now extract the license file.
static const std::string licenseFileFallback( "license.txt" );
- std::string licenseFile( !getLang ? licenseFileFallback
- : str::form( "license.%s.txt", getLang.c_str() ) );
+ std::string licenseFile( getLang == Locale::noCode
+ ? licenseFileFallback
+ : str::form( "license.%s.txt", getLang.code().c_str() ) );
ExternalProgram::Arguments cmd;
cmd.push_back( "tar" );
str << tag_r << value_r << std::endl;
});
- strif( (_pimpl->_mirrorListForceMetalink ? "- metalink : " : "- mirrorlist : "), rawMirrorListUrl().asString() );
+ strif( "- mirrorlist : ", rawMirrorListUrl().asString() );
strif( "- path : ", path().asString() );
str << "- type : " << type() << std::endl;
str << "- priority : " << priority() << std::endl;
str << "path="<< path() << endl;
if ( ! (rawMirrorListUrl().asString().empty()) )
- str << (_pimpl->_mirrorListForceMetalink ? "metalink=" : "mirrorlist=") << rawMirrorListUrl() << endl;
+ str << "mirrorlist=" << rawMirrorListUrl() << endl;
str << "type=" << type().asString() << endl;
if (!(tmpstr = gpgKeyUrl().asString()).empty())
str << " gpgkey=\"" << escape(tmpstr) << "\"";
if (!(tmpstr = mirrorListUrl().asString()).empty())
- str << (_pimpl->_mirrorListForceMetalink ? " metalink=\"" : " mirrorlist=\"") << escape(tmpstr) << "\"";
+ str << " mirrorlist=\"" << escape(tmpstr) << "\"";
str << ">" << endl;
if ( _pimpl->baseurl2dump() )