X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/0118833a3b3e65ad7296863aa7d49574eb615f83..e5a1f2ff4cd1300364c7c644958583a8af704173:/apt-pkg/sourcelist.cc diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index c9d0285a9..bea2d91c8 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: sourcelist.cc,v 1.6 1998/10/15 07:00:01 jgg Exp $ +// $Id: sourcelist.cc,v 1.12 1999/03/05 19:36:49 jgg Exp $ /* ###################################################################### List of Sources @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -41,7 +41,7 @@ pkgSourceList::pkgSourceList(string File) /* */ bool pkgSourceList::ReadMainList() { - return Read(_config->FindDir("Dir::Etc::sourcelist")); + return Read(_config->FindFile("Dir::Etc::sourcelist")); } /*}}}*/ // SourceList::Read - Parse the sourcelist file /*{{{*/ @@ -114,7 +114,7 @@ bool pkgSourceList::Read(string File) debugging. */ ostream &operator <<(ostream &O,pkgSourceList::Item &Itm) { - O << Itm.Type << ' ' << Itm.URI << ' ' << Itm.Dist << ' ' << Itm.Section; + O << (int)Itm.Type << ' ' << Itm.URI << ' ' << Itm.Dist << ' ' << Itm.Section; return O; } /*}}}*/ @@ -129,7 +129,13 @@ bool pkgSourceList::Item::SetType(string S) return true; } - return true; + if (S == "deb-src") + { + Type = DebSrc; + return true; + } + + return false; } /*}}}*/ // SourceList::Item::SetURI - Set the URI /*{{{*/ @@ -170,6 +176,16 @@ string pkgSourceList::Item::PackagesURI() const 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; } @@ -191,6 +207,16 @@ string pkgSourceList::Item::PackagesInfo() const Res += " Packages"; break; + + case DebSrc: + Res += SiteOnly(URI) + ' '; + if (Dist[Dist.size() - 1] == '/') + Res += Dist; + else + Res += Dist + '/' + Section; + + Res += " Sources"; + break; }; return Res; } @@ -212,6 +238,16 @@ string pkgSourceList::Item::ReleaseURI() const 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; } @@ -225,6 +261,7 @@ string pkgSourceList::Item::ReleaseInfo() const switch (Type) { case Deb: + case DebSrc: Res += SiteOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') Res += Dist; @@ -245,6 +282,7 @@ string pkgSourceList::Item::ArchiveInfo(pkgCache::VerIterator Ver) const string Res; switch (Type) { + case DebSrc: case Deb: Res += SiteOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') @@ -254,6 +292,9 @@ string pkgSourceList::Item::ArchiveInfo(pkgCache::VerIterator Ver) const Res += " "; Res += Ver.ParentPkg().Name(); + Res += " "; + Res += Ver.VerStr(); + break; }; return Res; @@ -268,6 +309,7 @@ string pkgSourceList::Item::ArchiveURI(string File) const switch (Type) { case Deb: + case DebSrc: Res = URI + File; break; };