-// SourceList::Item::SetURI - Set the URI /*{{{*/
-// ---------------------------------------------------------------------
-/* For simplicity we strip the scheme off the uri */
-bool pkgSourceList::Item::SetURI(string S)
-{
- if (S.empty() == true)
- return false;
-
- if (S.find(':') == string::npos)
- return false;
-
- S = SubstVar(S,"$(ARCH)",_config->Find("APT::Architecture"));
-
- // Make sure that the URN is / postfixed
- URI = S;
- if (URI[URI.size() - 1] != '/')
- URI += '/';
-
- return true;
-}
- /*}}}*/
-// SourceList::Item::PackagesURI - Returns a URI to the packages file /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-string pkgSourceList::Item::PackagesURI() const
-{
- string Res;
- switch (Type)
- {
- case Deb:
- if (Dist[Dist.size() - 1] == '/')
- Res = URI + Dist;
- else
- Res = URI + "dists/" + Dist + '/' + Section +
- "/binary-" + _config->Find("APT::Architecture") + '/';
-
- Res += "Packages";
- break;
-
- case DebSrc:
- if (Dist[Dist.size() - 1] == '/')
- Res = URI + Dist;
- else
- Res = URI + "dists/" + Dist + '/' + Section +
- "/source/";
-
- Res += "Sources";
- break;
- };
- return Res;
-}
- /*}}}*/
-// SourceList::Item::PackagesInfo - Shorter version of the URI /*{{{*/
-// ---------------------------------------------------------------------
-/* This is a shorter version that is designed to be < 60 chars or so */
-string pkgSourceList::Item::PackagesInfo() const
-{
- string Res;
- switch (Type)
- {
- case Deb:
- Res += SiteOnly(URI) + ' ';
- if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
- else
- Res += Dist + '/' + Section;
-
- Res += " Packages";
- break;
-
- case DebSrc:
- Res += SiteOnly(URI) + ' ';
- if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
- else
- Res += Dist + '/' + Section;
-
- Res += " Sources";
- break;
- };
- return Res;
-}
- /*}}}*/
-// SourceList::Item::ReleaseURI - Returns a URI to the release file /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-string pkgSourceList::Item::ReleaseURI() const
-{
- string Res;
- switch (Type)
- {
- case Deb:
- if (Dist[Dist.size() - 1] == '/')
- Res = URI + Dist;
- else
- Res = URI + "dists/" + Dist + '/' + Section +
- "/binary-" + _config->Find("APT::Architecture") + '/';
-
- Res += "Release";
- break;
-
- case DebSrc:
- if (Dist[Dist.size() - 1] == '/')
- Res = URI + Dist;
- else
- Res = URI + "dists/" + Dist + '/' + Section +
- "/source/";
-
- Res += "Release";
- break;
- };
- return Res;
-}
- /*}}}*/
-// SourceList::Item::ReleaseInfo - Shorter version of the URI /*{{{*/
-// ---------------------------------------------------------------------
-/* This is a shorter version that is designed to be < 60 chars or so */
-string pkgSourceList::Item::ReleaseInfo() const
-{
- string Res;
- switch (Type)
- {
- case Deb:
- case DebSrc:
- Res += SiteOnly(URI) + ' ';
- if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
- else
- Res += Dist + '/' + Section;
-
- Res += " Release";
- break;
- };
- return Res;
-}
- /*}}}*/
-// SourceList::Item::ArchiveInfo - Shorter version of the archive spec /*{{{*/
-// ---------------------------------------------------------------------
-/* This is a shorter version that is designed to be < 60 chars or so */
-string pkgSourceList::Item::ArchiveInfo(pkgCache::VerIterator Ver) const
-{
- string Res;
- switch (Type)
- {
- case DebSrc:
- case Deb:
- Res += SiteOnly(URI) + ' ';
- if (Dist[Dist.size() - 1] == '/')
- Res += Dist;
- else
- Res += Dist + '/' + Section;
-
- Res += " ";
- Res += Ver.ParentPkg().Name();
- Res += " ";
- Res += Ver.VerStr();
-
- break;
- };
- return Res;
-}
- /*}}}*/
-// SourceList::Item::ArchiveURI - Returns a URI to the given archive /*{{{*/