// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: sourcelist.cc,v 1.14 1999/07/20 05:53:33 jgg Exp $
+// $Id: sourcelist.cc,v 1.17 1999/10/17 07:30:23 jgg Exp $
/* ######################################################################
List of Sources
{
case Deb:
if (Dist[Dist.size() - 1] == '/')
- Res = URI + Dist;
+ {
+ if (Dist != "/")
+ Res = URI + Dist;
+ else
+ Res = URI;
+ }
else
Res = URI + "dists/" + Dist + '/' + Section +
"/binary-" + _config->Find("APT::Architecture") + '/';
case Deb:
Res += SiteOnly(URI) + ' ';
if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
+ {
+ if (Dist != "/")
+ Res += Dist;
+ }
else
Res += Dist + '/' + Section;
{
case Deb:
if (Dist[Dist.size() - 1] == '/')
- Res = URI + Dist;
+ {
+ if (Dist != "/")
+ Res = URI + Dist;
+ else
+ Res = URI;
+ }
else
Res = URI + "dists/" + Dist + '/' + Section +
"/binary-" + _config->Find("APT::Architecture") + '/';
case DebSrc:
Res += SiteOnly(URI) + ' ';
if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
+ {
+ if (Dist != "/")
+ Res += Dist;
+ }
else
Res += Dist + '/' + Section;
case Deb:
Res += SiteOnly(URI) + ' ';
if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
+ {
+ if (Dist != "/")
+ Res += Dist;
+ }
else
Res += Dist + '/' + Section;
case Deb:
Res += SiteOnly(URI) + ' ';
if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
+ {
+ if (Dist != "/")
+ Res += Dist;
+ }
else
Res += Dist + '/' + Section;
/* */
string pkgSourceList::Item::SiteOnly(string URI) const
{
- unsigned int Pos = URI.find(':');
- if (Pos == string::npos || Pos + 3 > URI.length())
- return URI;
- if (URI[Pos + 1] != '/' || URI[Pos + 2] != '/')
- return URI;
-
- Pos = URI.find('/',Pos + 3);
- if (Pos == string::npos)
- return URI;
- return string(URI,0,Pos);
+ ::URI U(URI);
+ U.User = string();
+ U.Password = string();
+ U.Path = string();
+ U.Port = 0;
+ return U;
}
/*}}}*/