- append path to baseurl of service repos (workaround for broke path
authorJan Kupec <jkupec@suse.cz>
Thu, 11 Sep 2008 21:44:13 +0000 (21:44 +0000)
committerJan Kupec <jkupec@suse.cz>
Thu, 11 Sep 2008 21:44:13 +0000 (21:44 +0000)
  handling in libzypp)

zypp/RepoManager.cc

index 38b1db5..c1a1718 100644 (file)
@@ -1530,9 +1530,28 @@ namespace zypp
     // set service alias and base url for all collected repositories
     for_( it, collector.repos.begin(), collector.repos.end() )
     {
+      Url url;
+
       // if the repo url was not set by the repoindex parser, set service's url
       if ( it->baseUrlsEmpty() )
-        it->setBaseUrl( service.url() );
+        url = service.url();
+      else
+        // service repo can contain only one URL now, so no need to iterate
+        url = *it->baseUrlsBegin();
+
+      // libzypp currently has problem with separate url + path handling
+      // so just append the path to the baseurl
+      if (!it->path().empty())
+      {
+        Pathname path(url.getPathName());
+        path /= it->path();
+        url.setPathName( path.asString() );
+        it->setPath("");
+      }
+
+      // save the url
+      it->setBaseUrl( url );
+      // set refrence to the parent service
       it->setService( service.alias() );
     }