string tmpurl;
while (getline(tmpfstream.stream(), tmpurl))
{
- if ( tmpurl[0] == '#' )
- continue;
- try {
- my_urls.push_back(Url(tmpurl));
- }
- catch (...)
- {;} // ignore malformed urls
+ my_urls.push_back(Url(tmpurl));
}
return my_urls;
}
/** Parse a local mirrorlist \a listfile_r and return usable URLs */
- inline std::vector<Url> RepoMirrorListParse( const Url & url_r, const Pathname & listfile_r, bool mirrorListForceMetalink_r )
+ inline std::vector<Url> RepoMirrorListParse( const Url & url_r, const Pathname & listfile_r )
{
USR << url_r << " " << listfile_r << endl;
std::vector<Url> mirrorurls;
- if ( mirrorListForceMetalink_r || url_r.asString().find( "/metalink" ) != string::npos )
+ if ( url_r.asString().find( "/metalink" ) != string::npos )
mirrorurls = RepoMirrorListParseXML( listfile_r );
else
mirrorurls = RepoMirrorListParseTXT( listfile_r );
} // namespace
///////////////////////////////////////////////////////////////////
- RepoMirrorList::RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r, bool mirrorListForceMetalink_r )
+
+ RepoMirrorList::RepoMirrorList( const Url & url_r, const Pathname & metadatapath_r )
{
if ( url_r.getScheme() == "file" )
{
// never cache for local mirrorlist
- _urls = RepoMirrorListParse( url_r, url_r.getPathName(), mirrorListForceMetalink_r );
+ _urls = RepoMirrorListParse( url_r, url_r.getPathName() );
}
else if ( ! PathInfo( metadatapath_r).isDir() )
{
// no cachedir
RepoMirrorListTempProvider provider( url_r ); // RAII: lifetime of any downloaded files
- _urls = RepoMirrorListParse( url_r, provider.localfile(), mirrorListForceMetalink_r );
+ _urls = RepoMirrorListParse( url_r, provider.localfile() );
}
else
{
// have cachedir
Pathname cachefile( metadatapath_r );
- if ( mirrorListForceMetalink_r || url_r.asString().find( "/metalink" ) != string::npos )
+ if ( url_r.asString().find( "/metalink" ) != string::npos )
cachefile /= "mirrorlist.xml";
else
cachefile /= "mirrorlist.txt";
zypp::filesystem::hardlinkCopy( provider.localfile(), cachefile );
}
- _urls = RepoMirrorListParse( url_r, cachefile, mirrorListForceMetalink_r );
+ _urls = RepoMirrorListParse( url_r, cachefile );
if( _urls.empty() )
{
DBG << "Removing Cachefile as it contains no URLs" << endl;