Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / repo / RepoMirrorList.cc
index 5477838..ad44f25 100644 (file)
@@ -79,24 +79,18 @@ namespace zypp
        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 );
@@ -124,24 +118,25 @@ namespace zypp
     } // 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";
@@ -158,7 +153,7 @@ namespace zypp
          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;