X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ad00ae81eb9e1f5384f8fe32879d483c72bbdace..65a1e968442361247b646dc61843f841235114e0:/apt-pkg/sourcelist.cc?ds=sidebyside diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index faae6a330..61d5dc7ab 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.4 1998/07/19 04:22:04 jgg Exp $ +// $Id: sourcelist.cc,v 1.10 1999/01/27 02:48:52 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->Find("APT::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; } /*}}}*/ @@ -195,6 +195,48 @@ string pkgSourceList::Item::PackagesInfo() const 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; + }; + 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: + 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 */ @@ -212,6 +254,9 @@ string pkgSourceList::Item::ArchiveInfo(pkgCache::VerIterator Ver) const Res += " "; Res += Ver.ParentPkg().Name(); + Res += " "; + Res += Ver.VerStr(); + break; }; return Res;